@namiml/web-sdk 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/ContextConsumer.d.ts +11 -0
  3. package/dist/components/ContextProvider.d.ts +45 -0
  4. package/dist/components/NamiElement.d.ts +10 -0
  5. package/dist/components/Paywall.d.ts +17 -0
  6. package/dist/components/TemplateComponent.d.ts +2 -0
  7. package/dist/components/containers/BackgroundContainer.d.ts +10 -0
  8. package/dist/components/containers/Container.d.ts +10 -0
  9. package/dist/components/containers/Content.d.ts +10 -0
  10. package/dist/components/containers/Footer.d.ts +10 -0
  11. package/dist/components/containers/Header.d.ts +11 -0
  12. package/dist/components/containers/ProductContainer.d.ts +10 -0
  13. package/dist/components/elements/Button.d.ts +11 -0
  14. package/dist/components/elements/Image.d.ts +9 -0
  15. package/dist/components/elements/SegmentPicker.d.ts +11 -0
  16. package/dist/components/elements/SegmentPickerItem.d.ts +15 -0
  17. package/dist/components/elements/Spacer.d.ts +9 -0
  18. package/dist/components/elements/Text.d.ts +27 -0
  19. package/dist/components/index.d.ts +30 -0
  20. package/dist/components/productDetails.d.ts +3 -0
  21. package/dist/components/styles/reset.d.ts +2 -0
  22. package/dist/components/utils/actionTap.d.ts +13 -0
  23. package/dist/components/utils/eventConst.d.ts +5 -0
  24. package/dist/components/utils/helpers.d.ts +17 -0
  25. package/dist/components/utils/iconMap.d.ts +1 -0
  26. package/dist/components/utils/impression.d.ts +4 -0
  27. package/dist/components/utils/products.d.ts +18 -0
  28. package/dist/components/utils/state.d.ts +13 -0
  29. package/dist/components/utils/styles.d.ts +21 -0
  30. package/dist/core/errors.d.ts +46 -0
  31. package/dist/core/withRetry.d.ts +1 -0
  32. package/dist/decorators/index.d.ts +2 -0
  33. package/dist/nami/api.d.ts +20 -0
  34. package/dist/nami/campaign.d.ts +47 -0
  35. package/dist/nami/customer.d.ts +91 -0
  36. package/dist/nami/emitter.d.ts +12 -0
  37. package/dist/nami/index.d.ts +9 -0
  38. package/dist/nami/namiRefs.d.ts +7 -0
  39. package/dist/nami/paywalls.d.ts +31 -0
  40. package/dist/nami/profile.d.ts +12 -0
  41. package/dist/nami/utils/purchase.d.ts +3 -0
  42. package/dist/nami-web.cjs +20 -22
  43. package/dist/nami-web.d.ts +185 -115
  44. package/dist/nami-web.js +20 -22
  45. package/dist/nami-web.mjs +20 -22
  46. package/dist/nami-web.umd.js +21 -23
  47. package/dist/repositories/campaignRule.repository.d.ts +13 -0
  48. package/dist/repositories/config.repository.d.ts +5 -0
  49. package/dist/repositories/device.repository.d.ts +10 -0
  50. package/dist/repositories/paywall.repository.d.ts +8 -0
  51. package/dist/repositories/products.repository.d.ts +6 -0
  52. package/dist/services/logger.service.d.ts +13 -0
  53. package/dist/services/session.service.d.ts +4 -0
  54. package/dist/services/storage.service.d.ts +61 -0
  55. package/dist/types/api.d.ts +28 -0
  56. package/dist/types/campaign.d.ts +21 -0
  57. package/dist/types/components/containers.d.ts +67 -0
  58. package/dist/types/components/elements.d.ts +79 -0
  59. package/dist/types/components/index.d.ts +117 -0
  60. package/dist/types/config.d.ts +43 -0
  61. package/dist/types/device.d.ts +35 -0
  62. package/dist/types/errors.d.ts +11 -0
  63. package/dist/types/languages.d.ts +1 -0
  64. package/dist/types/loglevel.d.ts +7 -0
  65. package/dist/types/paywall.d.ts +222 -0
  66. package/dist/types/products.d.ts +34 -0
  67. package/dist/types/profile.d.ts +20 -0
  68. package/dist/types/purchase.d.ts +45 -0
  69. package/dist/types/sku.d.ts +35 -0
  70. package/dist/types/utils.d.ts +1 -0
  71. package/dist/utils/config.d.ts +5 -0
  72. package/dist/utils/const.d.ts +1 -0
  73. package/dist/utils/device.d.ts +3 -0
  74. package/dist/utils/events.d.ts +30 -0
  75. package/dist/utils/fonts.d.ts +7 -0
  76. package/dist/utils/ssr-shim.d.ts +1 -0
  77. package/package.json +9 -5
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,(function(e){"use strict";const t=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}},n=new WeakMap,r=e=>{let t=n.get(e);return void 0===t&&n.set(e,t=new Map),t},s=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(r(this)).map((([e,t])=>({name:e,value:t})))}get shadowRoot(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}setAttribute(e,t){r(this).set(e,String(t))}removeAttribute(e){r(this).delete(e)}toggleAttribute(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}hasAttribute(e){return r(this).has(e)}attachShadow(e){const t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}attachInternals(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");const e=new t(this);return this.__internals=e,e}getAttribute(e){return r(this).get(e)??null}},i=class extends s{};"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=i);const{NAMI_SDK_VERSION:o="3.2.0",PRODUCTION:a="production",DEVELOPMENT:c="development",PLATFORM_ID_REQUIRED:l="Platform ID is required",DEVICE_ID_REQUIRED:u="Device ID is required",EXTERNAL_ID_REQUIRED:h="External ID is required",SDK_NOT_INITIALIZED:d="SDK has not been initialized. Make sure to call Nami.configure() first!",CAMPAIGN_NOT_AVAILABLE:p="Campaign is not available",UNABLE_TO_UPDATE_CDP_ID:f="Unable to update CDP id in anonymous mode",ANONYMOUS_MODE_ALREADY_ON:g="Anonymous mode is already turned on.",ANONYMOUS_MODE_ALREADY_OFF:m="Anonymous mode is already turned off.",ANONYMOUS_MODE_LOGIN_NOT_ALLOWED:b="Login/logout are not available in anonymous mode",AUTH_DEVICE:y="nami_auth_device",NAMI_CONFIGURATION:_="nami_configuration",NAMI_PROFILE:w="nami_profile",API_CONFIG:v="api_config",API_CAMPAIGN_RULES:A="api_campaign_rules",API_PAYWALLS:k="api_paywalls",API_PRODUCTS:S="api_products",INITIAL_APP_CONFIG:x="initial_app_config",INITIAL_CAMPAIGN_RULES:$="initial_campaign_rules",INITIAL_PAYWALLS:E="initial_paywalls",INITIAL_PRODUCTS:C="initial_products",CUSTOMER_ATTRIBUTES_KEY_PREFIX:I="nami_cmr_attributes_",ANONYMOUS_MODE:P="nami_anonymous_mode",API_VERSION:O="v3",BASE_URL_PATH:M=`sdk/${O}/platform`,BASE_URL:R="https://app.namiml.com",BASE_STAGING_URL:L="https://app-staging.namiml.com",CUSTOM_HOST_PREFIX:T="namiAPIHost=",USE_STAGING_API:N="useStagingAPI",EXTENDED_CLIENT_INFO_PREFIX:z="extendedClientInfo",EXTENDED_CLIENT_INFO_DELIMITER:D=":",EXTENDED_PLATFORM:U="extended-platform",EXTENDED_PLATFORM_VERSION:F="extended-platform-version",API_MAX_CALLS_LIMIT:j=2,API_RETRY_DELAY_SEC:H=2,STATUS_SUCCESS:B=200,STATUS_BAD_REQUEST:X=400,STATUS_NOT_FOUND:V=404,STATUS_INTERNAL_SERVER_ERROR:W=500,INITIAL_SUCCESS:G="Initial success",RECONFIG_SUCCESS:q="Reconfig success",ALREADY_CONFIGURED:Y="Already configured",AVAILABLE_CAMPAIGNS_CHANGED:K="AvailableCampaignsChanged",PAYWALL_ACTION_EVENT:Q="PaywallActionEvent",SKU_TEXT_REGEX:Z=/\$\{sku\.(\w+)(:\d+)?\}/g,VAR_REGEX:J=/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g,CORS_PROXY_URL:ee="https://hosted-content-staging.namiml.com",CORS_PROXY_URL_LOCAL:te="http://localhost:8001"}={};var ne;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(ne||(ne={}));const re={debug:ne.DEBUG,info:ne.INFO,warn:ne.WARN,error:ne.ERROR};const se=new class{constructor(){this.setLogger=e=>{this.currentLogLevel=re[e]||ne.WARN}}debug(e,...t){this.shouldLog(ne.DEBUG)&&console.debug(this.formatMessage(ne.DEBUG,e,...t))}info(e,...t){this.shouldLog(ne.INFO)&&console.info(this.formatMessage(ne.INFO,e,...t))}warn(e,...t){this.shouldLog(ne.WARN)&&console.warn(this.formatMessage(ne.WARN,e,...t))}error(e,...t){this.shouldLog(ne.ERROR)&&console.error(this.formatMessage(ne.ERROR,e,...t))}shouldLog(e){return e>=this.currentLogLevel}formatMessage(e,t,...n){const r=ne[e];return`[${(new Date).toISOString()}] [${r}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}};const ie=new class{setDevice(e){this.setItem(y,e)}getDevice(){return this.getItem(y)}resetDevice(){this.resetItem(y)}getAnonymousMode(){return this.getItem(P)}setAnonymousMode(e){this.setItem(P,e)}clearAnonymousMode(){this.resetItem(P)}setAppConfig(e,t){this.setItem(e,t)}getAppConfig(e){return this.getItem(e)}setCampaignRules(e,t){this.setItem(e,t)}getCampaignRules(e){return this.getItem(e)}setPaywalls(e,t){this.setItem(e,t)}getPaywalls(e){return this.getItem(e)}setProducts(e,t){this.setItem(e,t)}getProducts(e){return this.getItem(e)}setNamiConfig(e){this.setItem(_,e)}getNamiConfig(){return this.getItem(_)}setCustomerAttribute(e,t){this.setItem(I+e,t)}getCustomerAttribute(e){return this.getItem(I+e)}getAllCustomerAttributes(){return Object.keys(localStorage).filter((e=>e.includes(I))).map((e=>e.replace(I,"")))}clearCustomerAttribute(e){const t=I+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}clearAllCustomerAttributes(){Object.keys(localStorage).filter((e=>e.includes(I))).map((e=>this.resetItem(e)))}setNamiProfile(e){this.setItem(w,e)}getNamiProfile(){return this.getItem(w)}removeNamiProfile(){this.resetItem(w)}setItem(e,t){try{const n=JSON.stringify(t);localStorage.setItem(e,n)}catch(e){se.error("Error setting item in localStorage:",e)}}getItem(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return se.error("Error getting item from localStorage:",e,": ",t),null}}resetItem(e){try{localStorage.removeItem(e)}catch(e){se.error("Error removing item from localStorage:",e)}}clear(){try{localStorage.clear()}catch(e){se.error("Error clearing localStorage:",e)}}};class oe extends Error{constructor(e,t){super(t),this.statusCode=e,this.status=e,this.message=`RetryLimitExceededError: ${this.message}`}}class ae extends Error{constructor(){super(d)}}class ce extends Error{constructor(){super(l)}}class le extends Error{constructor(){super(u)}}class ue extends Error{constructor(){super(h)}}class he extends Error{constructor(){super(p)}}class de extends Error{constructor(){super(g)}}class pe extends Error{constructor(){super(m)}}class fe extends Error{constructor(){super(m)}}class ge extends Error{constructor(){super(f)}}class me extends Error{constructor(e){super(e),this.message=`BadRequestError: ${this.message}`}}class be extends Error{constructor(e){super(e),this.message=`NotFoundError: ${this.message}`}}class ye extends Error{constructor(e,t){super(t),this.statusCode=e,this.message=`ClientError: ${this.message}`}}class _e extends Error{constructor(e){super(e),this.message=`ServerError: ${this.message}`}}const we=(e,t)=>{if(e==X)throw new me(t);if(e==V)throw new be(t);if(e>X&&e<W)throw new ye(e,t);if(e>=W)throw new _e(t)};function ve(e,t,n,r){var s,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}async function Ae(e,t,n=j){let r=0;const s=async()=>{const i=t?await fetch(e,t):await fetch(e);if(!i.ok){if(r++,r<=n){const e=1e3*(r+H);return await new Promise((t=>setTimeout(t,e))),s()}throw new oe(i.status,`Request failed after ${n} retries`)}return i};return(await s()).json()}"function"==typeof SuppressedError&&SuppressedError;const ke=e=>{let t;if(e?.includes(N))t=L;else{const n=e?.find((e=>e.includes(T)));t=n?n.split("=")[1]:R}return t=t.replace(/\/$/,""),t+"/"+M},Se=e=>{const t=ie.getAppConfig(v)||ie.getAppConfig(x);return t?.capabilities?.includes(e)};function xe(e,t,n){const r=n.value;return n.value=function(...e){if(!this.platformID)throw new ce;return r.apply(this,e)},n}function $e(e,t,n){const r=n.value;return n.value=function(...e){const t=ie.getDevice();if(!t?.id)throw new le;return r.apply(this,e)},n}class Ee{static{this.instance=new Ee}get deviceID(){return ie.getDevice().id}static configure(e){this.instance.configure(e)}configure(e){this.baseURL=ke(e.namiCommands),this.platformID=e.appPlatformId}async login(e){if(!e)throw new ue;const t=`device/${this.deviceID}/login/`,n={external_id:e};return await this.requestBodyAPI(t,n,"PUT")}async logout(){const e=`device/${this.deviceID}/logout/`;return await this.requestBodyAPI(e,{},"PUT")}async fetchAPI(e){const t=`${this.baseURL}/${this.platformID}/`+e;return await Ae(t)}async requestBodyAPI(e,t,n="POST"){const r=`${this.baseURL}/${this.platformID}/`+e,s={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return await Ae(r,s)}}ve([$e],Ee.prototype,"login",null),ve([$e],Ee.prototype,"logout",null),ve([xe],Ee.prototype,"fetchAPI",null),ve([xe],Ee.prototype,"requestBodyAPI",null);var Ce="object"==typeof global&&global&&global.Object===Object&&global,Ie="object"==typeof self&&self&&self.Object===Object&&self,Pe=Ce||Ie||Function("return this")(),Oe=Pe.Symbol,Me=Object.prototype,Re=Me.hasOwnProperty,Le=Me.toString,Te=Oe?Oe.toStringTag:void 0;var Ne=Object.prototype.toString;var ze="[object Null]",De="[object Undefined]",Ue=Oe?Oe.toStringTag:void 0;function Fe(e){return null==e?void 0===e?De:ze:Ue&&Ue in Object(e)?function(e){var t=Re.call(e,Te),n=e[Te];try{e[Te]=void 0;var r=!0}catch(e){}var s=Le.call(e);return r&&(t?e[Te]=n:delete e[Te]),s}(e):function(e){return Ne.call(e)}(e)}function je(e){return null!=e&&"object"==typeof e}var He="[object Symbol]";function Be(e){return"symbol"==typeof e||je(e)&&Fe(e)==He}var Xe=Array.isArray,Ve=1/0,We=Oe?Oe.prototype:void 0,Ge=We?We.toString:void 0;function qe(e){if("string"==typeof e)return e;if(Xe(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(e,qe)+"";if(Be(e))return Ge?Ge.call(e):"";var t=e+"";return"0"==t&&1/e==-Ve?"-0":t}function Ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ke(e){return e}var Qe="[object AsyncFunction]",Ze="[object Function]",Je="[object GeneratorFunction]",et="[object Proxy]";function tt(e){if(!Ye(e))return!1;var t=Fe(e);return t==Ze||t==Je||t==Qe||t==et}var nt,rt=Pe["__core-js_shared__"],st=(nt=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||""))?"Symbol(src)_1."+nt:"";var it=Function.prototype.toString;function ot(e){if(null!=e){try{return it.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var at=/^\[object .+?Constructor\]$/,ct=Function.prototype,lt=Object.prototype,ut=ct.toString,ht=lt.hasOwnProperty,dt=RegExp("^"+ut.call(ht).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pt(e){return!(!Ye(e)||(t=e,st&&st in t))&&(tt(e)?dt:at).test(ot(e));var t}function ft(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return pt(n)?n:void 0}var gt=ft(Pe,"WeakMap");function mt(e){return e!=e}function bt(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var s=e.length,i=n+-1;++i<s;)if(t(e[i],i,e))return i;return-1}(e,mt,n)}(e,t,0)>-1}var yt=9007199254740991,_t=/^(?:0|[1-9]\d*)$/;function wt(e,t){var n=typeof e;return!!(t=null==t?yt:t)&&("number"==n||"symbol"!=n&&_t.test(e))&&e>-1&&e%1==0&&e<t}function vt(e,t){return e===t||e!=e&&t!=t}var At=9007199254740991;function kt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=At}var St=Object.prototype;function xt(e){return je(e)&&"[object Arguments]"==Fe(e)}var $t=Object.prototype,Et=$t.hasOwnProperty,Ct=$t.propertyIsEnumerable,It=xt(function(){return arguments}())?xt:function(e){return je(e)&&Et.call(e,"callee")&&!Ct.call(e,"callee")};var Pt="object"==typeof e&&e&&!e.nodeType&&e,Ot=Pt&&"object"==typeof module&&module&&!module.nodeType&&module,Mt=Ot&&Ot.exports===Pt?Pe.Buffer:void 0,Rt=(Mt?Mt.isBuffer:void 0)||function(){return!1},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var Tt,Nt="object"==typeof e&&e&&!e.nodeType&&e,zt=Nt&&"object"==typeof module&&module&&!module.nodeType&&module,Dt=zt&&zt.exports===Nt&&Ce.process,Ut=function(){try{var e=zt&&zt.require&&zt.require("util").types;return e||Dt&&Dt.binding&&Dt.binding("util")}catch(e){}}(),Ft=Ut&&Ut.isTypedArray,jt=Ft?(Tt=Ft,function(e){return Tt(e)}):function(e){return je(e)&&kt(e.length)&&!!Lt[Fe(e)]},Ht=Object.prototype.hasOwnProperty;function Bt(e,t){var n=Xe(e),r=!n&&It(e),s=!n&&!r&&Rt(e),i=!n&&!r&&!s&&jt(e),o=n||r||s||i,a=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var l in e)!Ht.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||wt(l,c))||a.push(l);return a}var Xt=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Vt=Object.prototype.hasOwnProperty;function Wt(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||St))return Xt(e);var t,n,r=[];for(var s in Object(e))Vt.call(e,s)&&"constructor"!=s&&r.push(s);return r}function Gt(e){return null!=(t=e)&&kt(t.length)&&!tt(t)?Bt(e):Wt(e);var t}var qt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yt=/^\w*$/;function Kt(e,t){if(Xe(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Be(e))||(Yt.test(e)||!qt.test(e)||null!=t&&e in Object(t))}var Qt=ft(Object,"create");var Zt=Object.prototype.hasOwnProperty;var Jt=Object.prototype.hasOwnProperty;function en(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function tn(e,t){for(var n=e.length;n--;)if(vt(e[n][0],t))return n;return-1}en.prototype.clear=function(){this.__data__=Qt?Qt(null):{},this.size=0},en.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},en.prototype.get=function(e){var t=this.__data__;if(Qt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Zt.call(t,e)?t[e]:void 0},en.prototype.has=function(e){var t=this.__data__;return Qt?void 0!==t[e]:Jt.call(t,e)},en.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Qt&&void 0===t?"__lodash_hash_undefined__":t,this};var nn=Array.prototype.splice;function rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rn.prototype.clear=function(){this.__data__=[],this.size=0},rn.prototype.delete=function(e){var t=this.__data__,n=tn(t,e);return!(n<0)&&(n==t.length-1?t.pop():nn.call(t,n,1),--this.size,!0)},rn.prototype.get=function(e){var t=this.__data__,n=tn(t,e);return n<0?void 0:t[n][1]},rn.prototype.has=function(e){return tn(this.__data__,e)>-1},rn.prototype.set=function(e,t){var n=this.__data__,r=tn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var sn=ft(Pe,"Map");function on(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function an(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}an.prototype.clear=function(){this.size=0,this.__data__={hash:new en,map:new(sn||rn),string:new en}},an.prototype.delete=function(e){var t=on(this,e).delete(e);return this.size-=t?1:0,t},an.prototype.get=function(e){return on(this,e).get(e)},an.prototype.has=function(e){return on(this,e).has(e)},an.prototype.set=function(e,t){var n=on(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var cn="Expected a function";function ln(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(cn);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(ln.Cache||an),n}ln.Cache=an;var un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hn=/\\(\\)?/g,dn=function(e){var t=ln(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(un,(function(e,n,r,s){t.push(r?s.replace(hn,"$1"):n||e)})),t}));function pn(e,t){return Xe(e)?e:Kt(e,t)?[e]:dn(function(e){return null==e?"":qe(e)}(e))}var fn=1/0;function gn(e){if("string"==typeof e||Be(e))return e;var t=e+"";return"0"==t&&1/e==-fn?"-0":t}function mn(e,t){for(var n=0,r=(t=pn(t,e)).length;null!=e&&n<r;)e=e[gn(t[n++])];return n&&n==r?e:void 0}function bn(e){var t=this.__data__=new rn(e);this.size=t.size}bn.prototype.clear=function(){this.__data__=new rn,this.size=0},bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},bn.prototype.get=function(e){return this.__data__.get(e)},bn.prototype.has=function(e){return this.__data__.has(e)},bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof rn){var r=n.__data__;if(!sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new an(r)}return n.set(e,t),this.size=n.size,this};var yn=Object.prototype.propertyIsEnumerable,_n=Object.getOwnPropertySymbols,wn=_n?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[s++]=o)}return i}(_n(e),(function(t){return yn.call(e,t)})))}:function(){return[]};function vn(e){return function(e,t,n){var r=t(e);return Xe(e)?r:function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}(r,n(e))}(e,Gt,wn)}var An=ft(Pe,"DataView"),kn=ft(Pe,"Promise"),Sn=ft(Pe,"Set"),xn="[object Map]",$n="[object Promise]",En="[object Set]",Cn="[object WeakMap]",In="[object DataView]",Pn=ot(An),On=ot(sn),Mn=ot(kn),Rn=ot(Sn),Ln=ot(gt),Tn=Fe;(An&&Tn(new An(new ArrayBuffer(1)))!=In||sn&&Tn(new sn)!=xn||kn&&Tn(kn.resolve())!=$n||Sn&&Tn(new Sn)!=En||gt&&Tn(new gt)!=Cn)&&(Tn=function(e){var t=Fe(e),n="[object Object]"==t?e.constructor:void 0,r=n?ot(n):"";if(r)switch(r){case Pn:return In;case On:return xn;case Mn:return $n;case Rn:return En;case Ln:return Cn}return t});var Nn=Pe.Uint8Array;function zn(e){for(var t=-1,n=null==e?0:e.length,r=0,s=[];++t<n;){var i=e[t];i&&(s[r++]=i)}return s}function Dn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new an;++t<n;)this.add(e[t])}function Un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Fn(e,t){return e.has(t)}Dn.prototype.add=Dn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(e){return this.__data__.has(e)};var jn=1,Hn=2;function Bn(e,t,n,r,s,i){var o=n&jn,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=i.get(e),u=i.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,p=n&Hn?new Dn:void 0;for(i.set(e,t),i.set(t,e);++h<a;){var f=e[h],g=t[h];if(r)var m=o?r(g,f,h,t,e,i):r(f,g,h,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!Un(t,(function(e,t){if(!Fn(p,t)&&(f===e||s(f,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(f!==g&&!s(f,g,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d}function Xn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Vn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Wn=1,Gn=2,qn="[object Boolean]",Yn="[object Date]",Kn="[object Error]",Qn="[object Map]",Zn="[object Number]",Jn="[object RegExp]",er="[object Set]",tr="[object String]",nr="[object Symbol]",rr="[object ArrayBuffer]",sr="[object DataView]",ir=Oe?Oe.prototype:void 0,or=ir?ir.valueOf:void 0;var ar=1,cr=Object.prototype.hasOwnProperty;var lr=1,ur="[object Arguments]",hr="[object Array]",dr="[object Object]",pr=Object.prototype.hasOwnProperty;function fr(e,t,n,r,s,i){var o=Xe(e),a=Xe(t),c=o?hr:Tn(e),l=a?hr:Tn(t),u=(c=c==ur?dr:c)==dr,h=(l=l==ur?dr:l)==dr,d=c==l;if(d&&Rt(e)){if(!Rt(t))return!1;o=!0,u=!1}if(d&&!u)return i||(i=new bn),o||jt(e)?Bn(e,t,n,r,s,i):function(e,t,n,r,s,i,o){switch(n){case sr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rr:return!(e.byteLength!=t.byteLength||!i(new Nn(e),new Nn(t)));case qn:case Yn:case Zn:return vt(+e,+t);case Kn:return e.name==t.name&&e.message==t.message;case Jn:case tr:return e==t+"";case Qn:var a=Xn;case er:var c=r&Wn;if(a||(a=Vn),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Gn,o.set(e,t);var u=Bn(a(e),a(t),r,s,i,o);return o.delete(e),u;case nr:if(or)return or.call(e)==or.call(t)}return!1}(e,t,c,n,r,s,i);if(!(n&lr)){var p=u&&pr.call(e,"__wrapped__"),f=h&&pr.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return i||(i=new bn),s(g,m,n,r,i)}}return!!d&&(i||(i=new bn),function(e,t,n,r,s,i){var o=n&ar,a=vn(e),c=a.length;if(c!=vn(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:cr.call(t,u)))return!1}var h=i.get(e),d=i.get(t);if(h&&d)return h==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var f=o;++l<c;){var g=e[u=a[l]],m=t[u];if(r)var b=o?r(m,g,u,t,e,i):r(g,m,u,e,t,i);if(!(void 0===b?g===m||s(g,m,n,r,i):b)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var y=e.constructor,_=t.constructor;y==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof _&&_ instanceof _||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,s,i))}function gr(e,t,n,r,s){return e===t||(null==e||null==t||!je(e)&&!je(t)?e!=e&&t!=t:fr(e,t,n,r,gr,s))}var mr=1,br=2;function yr(e){return e==e&&!Ye(e)}function _r(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function wr(e){var t=function(e){for(var t=Gt(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,yr(s)]}return t}(e);return 1==t.length&&t[0][2]?_r(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var s=n.length,i=s;if(null==e)return!i;for(e=Object(e);s--;){var o=n[s];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++s<i;){var a=(o=n[s])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u=new bn;if(!gr(l,c,mr|br,r,u))return!1}}return!0}(n,0,t)}}function vr(e,t){return null!=e&&t in Object(e)}function Ar(e,t){return null!=e&&function(e,t,n){for(var r=-1,s=(t=pn(t,e)).length,i=!1;++r<s;){var o=gn(t[r]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}return i||++r!=s?i:!!(s=null==e?0:e.length)&&kt(s)&&wt(o,s)&&(Xe(e)||It(e))}(e,t,vr)}var kr=1,Sr=2;function xr(e,t){return Kt(e)&&yr(t)?_r(gn(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:mn(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?Ar(n,e):gr(t,r,kr|Sr)}}function $r(e){return Kt(e)?(t=gn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return mn(t,e)}}(e);var t}function Er(e,t){return gr(e,t)}var Cr=Sn&&1/Vn(new Sn([,-0]))[1]==1/0?function(e){return new Sn(e)}:function(){},Ir=200;function Pr(e,t){return e&&e.length?function(e,t,n){var r=-1,s=bt,i=e.length,o=!0,a=[],c=a;if(i>=Ir){var l=t?null:Cr(e);if(l)return Vn(l);o=!1,s=Fn,c=new Dn}else c=t?[]:a;e:for(;++r<i;){var u=e[r],h=t?t(u):u;if(u=0!==u?u:0,o&&h==h){for(var d=c.length;d--;)if(c[d]===h)continue e;t&&c.push(h),a.push(u)}else s(c,h,n)||(c!==a&&c.push(h),a.push(u))}return a}(e,"function"==typeof(n=t)?n:null==n?Ke:"object"==typeof n?Xe(n)?xr(n[0],n[1]):wr(n):$r(n)):[];var n}var Or,Mr="object"==typeof Reflect?Reflect:null,Rr=Mr&&"function"==typeof Mr.apply?Mr.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Or=Mr&&"function"==typeof Mr.ownKeys?Mr.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Lr=Number.isNaN||function(e){return e!=e};function Tr(){Tr.init.call(this)}Tr.EventEmitter=Tr,Tr.prototype._events=void 0,Tr.prototype._eventsCount=0,Tr.prototype._maxListeners=void 0;var Nr,zr=10;function Dr(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Ur(e){return void 0===e._maxListeners?Tr.defaultMaxListeners:e._maxListeners}function Fr(e,t,n,r){var s,i,o,a;if(Dr(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"==typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(s=Ur(e))>0&&o.length>s&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function jr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Hr(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=jr.bind(r);return s.listener=n,r.wrapFn=s,s}function Br(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):Vr(s,s.length)}function Xr(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function Vr(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(Tr,"defaultMaxListeners",{enumerable:!0,get:function(){return zr},set:function(e){if("number"!=typeof e||e<0||Lr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");zr=e}}),Tr.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Tr.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Lr(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Tr.prototype.getMaxListeners=function(){return Ur(this)},Tr.prototype.emit=function(e){var t=[];for(let e=1;e<arguments.length;e++)t.push(arguments[e]);var n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var o=r[e];if(void 0===o)return!1;if("function"==typeof o)Rr(o,this,t);else{var a=o.length,c=Vr(o,a);for(let e=0;e<a;++e)Rr(c[e],this,t)}return!0},Tr.prototype.addListener=function(e,t){return Fr(this,e,t,!1)},Tr.prototype.on=Tr.prototype.addListener,Tr.prototype.prependListener=function(e,t){return Fr(this,e,t,!0)},Tr.prototype.once=function(e,t){return Dr(t),this.on(e,Hr(this,e,t)),this},Tr.prototype.prependOnceListener=function(e,t){return Dr(t),this.prependListener(e,Hr(this,e,t)),this},Tr.prototype.removeListener=function(e,t){var n,r,s,i,o;if(Dr(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,s=i;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},Tr.prototype.off=Tr.prototype.removeListener,Tr.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var s,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(s=i[r])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},Tr.prototype.listeners=function(e){return Br(this,e,!0)},Tr.prototype.rawListeners=function(e){return Br(this,e,!1)},Tr.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Xr.call(e,t)},Tr.prototype.listenerCount=Xr,Tr.prototype.eventNames=function(){return this._eventsCount>0?Or(this._events):[]};class Wr{constructor(){this.emitter=new Tr}static getInstance(){return this.instance||(this.instance=new Wr),this.instance}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}emit(e,...t){this.emitter.emit(e,...t)}addListener(e,t){this.emitter.addListener(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}listeners(e){return this.emitter.listeners(e)}listenerCount(e){return this.emitter.listenerCount(e)}}class Gr extends Ee{constructor(e,t){super(),super.configure(e),this.currentFormFactor=t}async fetchCampaignRules(e){const t=ie.getDevice();let n;return n=t?.id?await this.getCampaigns(t.id):await this.getAnonymousCampaigns(),n=n?.filter((e=>e.form_factors.some((e=>e.form_factor===this.currentFormFactor)))),n=n?.filter((t=>{const n=e.find((e=>e.id==t.paywall));if(n)return t})),ie.setCampaignRules(A,n),this.invokeAvailableCampaignsResponseHandler(),n}invokeAvailableCampaignsResponseHandler(e){const t=Wr.getInstance().listeners(K);if(!e){const t=ie.getCampaignRules(A)??[],n=ie.getCampaignRules($)??[];e=Pr(zn([...t,...n]),"rule")}t.forEach((t=>{t(e)}))}async getAnonymousCampaigns(){const e="campaign_rules/";let t;try{t=await this.fetchAPI(e)}catch(t){throw se.error(we(t.status,e)),t}return t.results}async getCampaigns(e){const t=`device/${e}/campaign_rules/`;let n;try{n=await this.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw se.error(we(e.status,t)),e}return n.results}fallbackData(){const e=ie.getCampaignRules(A)||ie.getCampaignRules($);return e?{count:e.length,results:e}:null}}class qr extends Ee{constructor(e){super(),super.configure(e)}async createOrUpdateDevice(e){const t=ie.getDevice();return t?.id?this.isEqualDevices(t,e)?t:this.updateDevice(t.id,e):this.createDevice(e)}async createDevice(e){const t=await this.requestAPIData("device/",e);return t&&ie.setDevice(t),t}async updateDevice(e,t){const n=await this.requestAPIData(`device/${e}/`,t,"PUT");return n&&ie.setDevice(n),n}async updateDeviceField(e,t){const n={[e]:t},r=ie.getDevice();if(!r?.id)throw new le;const s=await this.requestAPIData(`device/${r.id}/`,n,"PATCH");return s&&ie.setDevice(s),s}async requestAPIData(e,t,n="POST"){let r=null;try{r=await this.requestBodyAPI(e,t,n)}catch(t){if(r=ie.getDevice(),!r)throw se.error(we(t.status,e)),t}return r}isEqualDevices(e,t){const n={...e,...t},r=Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{});return Er(r,e)}}!function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management"}(Nr||(Nr={}));class Yr extends Ee{constructor(e){super(),super.configure(e)}async fetchProducts(){if(Se(Nr.THIRD_PARTY_TRANSACTIONS))return null;let e;try{e=await this.fetchAPI("products/")}catch(t){if(e=this.fallbackData(),!e)throw se.error(we(t.status,"products/")),t}return e.results&&ie.setProducts(S,e.results),e.results}fallbackData(){const e=ie.getProducts(S)||ie.getProducts(C);return e?{count:e.length,results:e}:null}}class Kr extends Ee{constructor(e){super(),super.configure(e)}async fetchPaywalls(){const e=ie.getDevice();let t;return t=e?.id?await this.getPaywalls(e.id):await this.getAnonymousPaywalls(),t&&ie.setPaywalls(k,t),t}async getAnonymousPaywalls(e=o){const t=`paywalls/?sdk_version=${e}`;let n;try{n=await this.fetchAPI(t)}catch(e){throw se.error(we(e.status,t)),e}return n.results}async getPaywalls(e){const t=`device/${e}/paywalls/`;let n;try{n=await this.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw se.error(we(e.status,t)),e}return n.results}fallbackData(){const e=ie.getPaywalls(k)||ie.getPaywalls(E);return e?{count:e.length,results:e}:null}}class Qr extends Ee{constructor(e){super(),super.configure(e)}async fetchConfig(){let e=null;try{e=await this.fetchAPI("config/")}catch(t){if(e=ie.getAppConfig(v)||ie.getAppConfig(x),!e)throw se.error(we(t.status,"config/")),t}return e&&ie.setAppConfig(v,e),e}}const Zr={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Jr={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},es={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ts={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ns={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class rs{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=rs.getVersionPrecision(e),s=rs.getVersionPrecision(t);let i=Math.max(r,s),o=0;const a=rs.map([e,t],(e=>{const t=i-rs.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return rs.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(o=i-Math.min(r,s)),i-=1;i>=o;){if(a[0][i]>a[1][i])return 1;if(a[0][i]===a[1][i]){if(i===o)return 0;i-=1}else if(a[0][i]<a[1][i])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,s;if(Object.assign)return Object.assign(e,...t);for(r=0,s=t.length;r<s;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach((t=>{n[t]=e[t]}))}}return e}static getBrowserAlias(e){return Zr[e]}static getBrowserTypeByAlias(e){return Jr[e]||""}}const ss=/version\/(\d+(\.?_?\d+)+)/i,is=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=rs.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=rs.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=rs.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=rs.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=rs.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=rs.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=rs.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=rs.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=rs.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=rs.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=rs.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=rs.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=rs.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=rs.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=rs.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=rs.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=rs.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=rs.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=rs.getFirstMatch(ss,e)||rs.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=rs.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=rs.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=rs.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=rs.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=rs.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=rs.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=rs.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=rs.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=rs.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=rs.getFirstMatch(ss,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:rs.getFirstMatch(t,e),version:rs.getSecondMatch(t,e)}}}];var os=[{test:[/Roku\/DVP/],describe(e){const t=rs.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:ts.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=rs.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:ts.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=rs.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=rs.getWindowsVersionName(t);return{name:ts.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:ts.iOS},n=rs.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=rs.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=rs.getMacOSVersionName(t),r={name:ts.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=rs.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:ts.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=rs.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=rs.getAndroidVersionName(t),r={name:ts.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=rs.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:ts.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=rs.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||rs.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||rs.getFirstMatch(/\bbb(\d+)/i,e);return{name:ts.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=rs.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:ts.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=rs.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:ts.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:ts.Linux})},{test:[/CrOS/],describe:()=>({name:ts.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=rs.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:ts.PlayStation4,version:t}}}],as=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=rs.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:es.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:es.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:es.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:es.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:es.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:es.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:es.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=rs.getFirstMatch(/(ipod|iphone)/i,e);return{type:es.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:es.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:es.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:es.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:es.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:es.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:es.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:es.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:es.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:es.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:es.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:es.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:es.tv})}],cs=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ns.Blink};const t=rs.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ns.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ns.Trident},n=rs.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ns.Presto},n=rs.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:ns.Gecko},n=rs.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ns.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ns.WebKit},n=rs.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class ls{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=rs.find(is,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=rs.find(os,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=rs.find(as,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=rs.find(cs,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return rs.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let s=0;if(Object.keys(e).forEach((i=>{const o=e[i];"string"==typeof o?(r[i]=o,s+=1):"object"==typeof o&&(t[i]=o,n+=1)})),n>0){const e=Object.keys(t),n=rs.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=rs.find(e,(e=>this.isPlatform(e)));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(s>0){const e=Object.keys(r),t=rs.find(e,(e=>this.isBrowser(e,!0)));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const s=rs.getBrowserTypeByAlias(r);return t&&s&&(r=s.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(rs.compareVersions(s,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some((e=>this.is(e)))}}class us{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new ls(e,t)}static parse(e){return new ls(e).getResult()}static get BROWSER_MAP(){return Jr}static get ENGINE_MAP(){return ns}static get OS_MAP(){return ts}static get PLATFORMS_MAP(){return es}}const hs={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},ds=e=>{const t=us.getParser(window.navigator.userAgent),n=t.getPlatform(),r={os_version:t.getOSVersion()||null,os_name:t.getOSName()||null,browser_name:t.getBrowserName()||null,browser_version:t.getBrowserVersion()||null,sdk_client:"web",sdk_version:o,language:window.navigator.language};if(n.type&&(r.form_factor=hs[n.type]),n.model&&(r.device_model=n.model),e&&e.length>0){const t=(e=>{const t=e?.find((e=>e.includes(z)));if(!e||!t)return null;const n=t.split(D);return{platform:n[1],version:n[2]}})(e);r.extended_platform=t?.platform||null,r.extended_platform_version=t?.version||null}return r};class ps{static{this.instance=new ps}async init(e){this.storeInitialValues(e),await this.initAndFetchRequiredData(e)}storeInitialValues(e){ie.setNamiConfig(e);const t=e.initialConfig;t?.campaign_rules&&ie.setCampaignRules($,t.campaign_rules),t?.appConfig&&ie.setAppConfig(x,t.appConfig),t?.paywalls&&ie.setPaywalls(E,t.paywalls),t?.products&&ie.setProducts(C,t.products)}async initAndFetchRequiredData(e){const t=new qr(e);let n;if(!ie.getAnonymousMode()){const r=ds(e.namiCommands);n=await t.createOrUpdateDevice(r)}const r=e.formFactor??n?.form_factor;Gr.instance=new Gr(e,r),Kr.instance=new Kr(e),Yr.instance=new Yr(e),Qr.instance=new Qr(e),qr.instance=t,await Promise.all([Qr.instance.fetchConfig(),Yr.instance.fetchProducts(),Kr.instance.fetchPaywalls().then((e=>Gr.instance.fetchCampaignRules(e)))])}}class fs{static{this.instance=new fs}#e=!1;get isInitialized(){return this.#e}static async configure(e){if(!e.appPlatformId)throw new ce;return await fs.instance.initializeSDK(e)}async initializeSDK(e){let t=!1,n=!1;const r=this.#e?ie.getNamiConfig():null;if(se.setLogger(e.logLevel),null!==r){if(Er(e,r))return se.warn("Nami SDK is already configured, ignoring this configure call."),{sdkInitialized:!0,configureState:Y};n=!0;const s=ke(e.namiCommands),i=ke(r.namiCommands);e.appPlatformId==r.appPlatformId&&s==i||(t=!0),e.languageCode===r.languageCode&&e.logLevel==r.logLevel||(n=!0)}t&&(se.info("SDK full reconfigure called"),ie.resetDevice()),this.#e=!0,Ee.configure(e),await ps.instance.init(e),se.info("SDK successfully initialized!");return{sdkInitialized:!0,configureState:n||t?q:G}}}var gs,ms;!function(e){e.REGISTER_BUY_SKU="RegisterBuySKU",e.PAYWALL_CLOSE_REQUESTED="PaywallCloseRequested",e.PAYWALL_SIGNIN_REQUESTED="PaywallSignInRequested",e.PAYWALL_RESTORE_REQUESTED="PaywallRestoreRequested",e.PAYWALL_DEEPLINK_ACTION="PaywallDeeplinkAction"}(gs||(gs={})),e.NamiPaywallAction=void 0,(ms=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",ms.SELECT_SKU="SELECT_SKU",ms.RESTORE_PURCHASES="RESTORE_PURCHASES",ms.SIGN_IN="SIGN_IN",ms.CLOSE_PAYWALL="CLOSE_PAYWALL",ms.SHOW_PAYWALL="SHOW_PAYWALL",ms.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",ms.PURCHASE_SUCCESS="PURCHASE_SUCCESS",ms.PURCHASE_FAILED="PURCHASE_FAILED",ms.PURCHASE_CANCELLED="PURCHASE_CANCELLED",ms.PURCHASE_PENDING="PURCHASE_PENDING",ms.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",ms.PURCHASE_DEFERRED="PURCHASE_DEFERRED";class bs{constructor(){this.emitter=Wr.getInstance()}static{this.instance=new bs}static allPaywalls(){if(!this.instance.sdkInitialized)throw new ae;return Pr(zn([...ie.getPaywalls(k)??[],...ie.getPaywalls(E)??[]]),"id")}static setProductDetails(e){this.instance.productDetails=e}static registerSignInHandler(e){return this.instance.emitter.addListener(gs.PAYWALL_SIGNIN_REQUESTED,e),()=>{this.instance.emitter.removeListener(gs.PAYWALL_SIGNIN_REQUESTED,e)}}static registerCloseHandler(e){return this.instance.emitter.addListener(gs.PAYWALL_CLOSE_REQUESTED,e),()=>{this.instance.emitter.removeListener(gs.PAYWALL_CLOSE_REQUESTED,e)}}static registerDeeplinkActionHandler(e){return this.instance.emitter.addListener(gs.PAYWALL_DEEPLINK_ACTION,e),()=>{this.instance.emitter.removeListener(gs.PAYWALL_DEEPLINK_ACTION,e)}}static registerBuySkuHandler(e){return this.instance.emitter.addListener(gs.REGISTER_BUY_SKU,e),()=>{this.instance.emitter.removeListener(gs.REGISTER_BUY_SKU,e)}}static registerRestoreHandler(e){return this.instance.emitter.addListener(gs.PAYWALL_RESTORE_REQUESTED,e),()=>{this.instance.emitter.removeListener(gs.PAYWALL_RESTORE_REQUESTED,e)}}static buySkuComplete(){se.info("TODO: Implement buySkuComplete")}static buySkuCancel(){se.info("TODO: Implement buySkuCancel")}get sdkInitialized(){return fs.instance.isInitialized}getProductDetails(e){return(this.productDetails??[]).find((t=>t.name===e))}}const ys=globalThis,_s=ys.ShadowRoot&&(void 0===ys.ShadyCSS||ys.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ws=Symbol(),vs=new WeakMap;let As=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ws)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(_s&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=vs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&vs.set(t,e))}return e}toString(){return this.cssText}};const ks=e=>new As("string"==typeof e?e:e+"",void 0,ws),Ss=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new As(n,e,ws)},xs=(e,t)=>{if(_s)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=ys.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},$s=_s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return ks(t)})(e):e,{is:Es,defineProperty:Cs,getOwnPropertyDescriptor:Is,getOwnPropertyNames:Ps,getOwnPropertySymbols:Os,getPrototypeOf:Ms}=Object,Rs=globalThis,Ls=Rs.trustedTypes,Ts=Ls?Ls.emptyScript:"",Ns=Rs.reactiveElementPolyfillSupport,zs=(e,t)=>e,Ds={toAttribute(e,t){switch(t){case Boolean:e=e?Ts:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Us=(e,t)=>!Es(e,t),Fs={attribute:!0,type:String,converter:Ds,reflect:!1,hasChanged:Us};Symbol.metadata??=Symbol("metadata"),Rs.litPropertyMetadata??=new WeakMap;let js=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Fs){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Cs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=Is(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const i=r?.call(this);s.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fs}static _$Ei(){if(this.hasOwnProperty(zs("elementProperties")))return;const e=Ms(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zs("properties"))){const e=this.properties,t=[...Ps(e),...Os(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift($s(e))}else void 0!==e&&t.push($s(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:Ds).toAttribute(t,n.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Ds;this._$Em=r,this[r]=s.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??Us)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}};js.elementStyles=[],js.shadowRootOptions={mode:"open"},js[zs("elementProperties")]=new Map,js[zs("finalized")]=new Map,Ns?.({ReactiveElement:js}),(Rs.reactiveElementVersions??=[]).push("2.0.4");const Hs=globalThis,Bs=Hs.trustedTypes,Xs=Bs?Bs.createPolicy("lit-html",{createHTML:e=>e}):void 0,Vs="$lit$",Ws=`lit$${Math.random().toFixed(9).slice(2)}$`,Gs="?"+Ws,qs=`<${Gs}>`,Ys=document,Ks=()=>Ys.createComment(""),Qs=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Zs=Array.isArray,Js="[ \t\n\f\r]",ei=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ti=/-->/g,ni=/>/g,ri=RegExp(`>|${Js}(?:([^\\s"'>=/]+)(${Js}*=${Js}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),si=/'/g,ii=/"/g,oi=/^(?:script|style|textarea|title)$/i,ai=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),ci=ai(1),li=ai(2),ui=Symbol.for("lit-noChange"),hi=Symbol.for("lit-nothing"),di=new WeakMap,pi=Ys.createTreeWalker(Ys,129);function fi(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Xs?Xs.createHTML(t):t}const gi=(e,t)=>{const n=e.length-1,r=[];let s,i=2===t?"<svg>":"",o=ei;for(let t=0;t<n;t++){const n=e[t];let a,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),null!==c);)u=o.lastIndex,o===ei?"!--"===c[1]?o=ti:void 0!==c[1]?o=ni:void 0!==c[2]?(oi.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=ri):void 0!==c[3]&&(o=ri):o===ri?">"===c[0]?(o=s??ei,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?ri:'"'===c[3]?ii:si):o===ii||o===si?o=ri:o===ti||o===ni?o=ei:(o=ri,s=void 0);const h=o===ri&&e[t+1].startsWith("/>")?" ":"";i+=o===ei?n+qs:l>=0?(r.push(a),n.slice(0,l)+Vs+n.slice(l)+Ws+h):n+Ws+(-2===l?t:h)}return[fi(e,i+(e[n]||"<?>")+(2===t?"</svg>":"")),r]};class mi{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let s=0,i=0;const o=e.length-1,a=this.parts,[c,l]=gi(e,t);if(this.el=mi.createElement(c,n),pi.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=pi.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(Vs)){const t=l[i++],n=r.getAttribute(e).split(Ws),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:s,name:o[2],strings:n,ctor:"."===o[1]?vi:"?"===o[1]?Ai:"@"===o[1]?ki:wi}),r.removeAttribute(e)}else e.startsWith(Ws)&&(a.push({type:6,index:s}),r.removeAttribute(e));if(oi.test(r.tagName)){const e=r.textContent.split(Ws),t=e.length-1;if(t>0){r.textContent=Bs?Bs.emptyScript:"";for(let n=0;n<t;n++)r.append(e[n],Ks()),pi.nextNode(),a.push({type:2,index:++s});r.append(e[t],Ks())}}}else if(8===r.nodeType)if(r.data===Gs)a.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(Ws,e+1));)a.push({type:7,index:s}),e+=Ws.length-1}s++}}static createElement(e,t){const n=Ys.createElement("template");return n.innerHTML=e,n}}function bi(e,t,n=e,r){if(t===ui)return t;let s=void 0!==r?n._$Co?.[r]:n._$Cl;const i=Qs(t)?void 0:t._$litDirective$;return s?.constructor!==i&&(s?._$AO?.(!1),void 0===i?s=void 0:(s=new i(e),s._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=s:n._$Cl=s),void 0!==s&&(t=bi(e,s._$AS(e,t.values),s,r)),t}class yi{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Ys).importNode(t,!0);pi.currentNode=r;let s=pi.nextNode(),i=0,o=0,a=n[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new _i(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new Si(s,this,e)),this._$AV.push(t),a=n[++o]}i!==a?.index&&(s=pi.nextNode(),i++)}return pi.currentNode=Ys,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class _i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=hi,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=bi(this,e,t),Qs(e)?e===hi||null==e||""===e?(this._$AH!==hi&&this._$AR(),this._$AH=hi):e!==this._$AH&&e!==ui&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>Zs(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==hi&&Qs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ys.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=mi.createElement(fi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new yi(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=di.get(e.strings);return void 0===t&&di.set(e.strings,t=new mi(e)),t}k(e){Zs(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const s of e)r===t.length?t.push(n=new _i(this.S(Ks()),this.S(Ks()),this,this.options)):n=t[r],n._$AI(s),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class wi{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,s){this.type=1,this._$AH=hi,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=hi}_$AI(e,t=this,n,r){const s=this.strings;let i=!1;if(void 0===s)e=bi(this,e,t,0),i=!Qs(e)||e!==this._$AH&&e!==ui,i&&(this._$AH=e);else{const r=e;let o,a;for(e=s[0],o=0;o<s.length-1;o++)a=bi(this,r[n+o],t,o),a===ui&&(a=this._$AH[o]),i||=!Qs(a)||a!==this._$AH[o],a===hi?e=hi:e!==hi&&(e+=(a??"")+s[o+1]),this._$AH[o]=a}i&&!r&&this.j(e)}j(e){e===hi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class vi extends wi{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===hi?void 0:e}}class Ai extends wi{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==hi)}}class ki extends wi{constructor(e,t,n,r,s){super(e,t,n,r,s),this.type=5}_$AI(e,t=this){if((e=bi(this,e,t,0)??hi)===ui)return;const n=this._$AH,r=e===hi&&n!==hi||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==hi&&(n===hi||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Si{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){bi(this,e)}}const xi=Hs.litHtmlPolyfillSupport;xi?.(mi,_i),(Hs.litHtmlVersions??=[]).push("3.1.4");class $i extends js{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=n?.renderBefore??null;r._$litPart$=s=new _i(t.insertBefore(Ks(),e),e,void 0,n??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ui}}$i._$litElement$=!0,$i.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:$i});const Ei=globalThis.litElementPolyfillSupport;Ei?.({LitElement:$i}),(globalThis.litElementVersions??=[]).push("4.0.6");const Ci=Ss`
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,(function(e){"use strict";const t=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}},n=new WeakMap,r=e=>{let t=n.get(e);return void 0===t&&n.set(e,t=new Map),t},s=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(r(this)).map((([e,t])=>({name:e,value:t})))}get shadowRoot(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}setAttribute(e,t){r(this).set(e,String(t))}removeAttribute(e){r(this).delete(e)}toggleAttribute(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}hasAttribute(e){return r(this).has(e)}attachShadow(e){const t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}attachInternals(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");const e=new t(this);return this.__internals=e,e}getAttribute(e){return r(this).get(e)??null}},i=class extends s{};"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=i);const{NAMI_SDK_VERSION:o="3.2.0",PRODUCTION:a="production",DEVELOPMENT:c="development",PLATFORM_ID_REQUIRED:l="Platform ID is required",DEVICE_ID_REQUIRED:u="Device ID is required",EXTERNAL_ID_REQUIRED:h="External ID is required",SDK_NOT_INITIALIZED:d="SDK has not been initialized. Make sure to call Nami.configure() first!",CAMPAIGN_NOT_AVAILABLE:p="Campaign is not available",UNABLE_TO_UPDATE_CDP_ID:f="Unable to update CDP id in anonymous mode",ANONYMOUS_MODE_ALREADY_ON:m="Anonymous mode is already turned on.",ANONYMOUS_MODE_ALREADY_OFF:g="Anonymous mode is already turned off.",ANONYMOUS_MODE_LOGIN_NOT_ALLOWED:y="Login/logout are not available in anonymous mode",SESSION_REQUIRED:b="Session is required",AUTH_DEVICE:_="nami_auth_device",NAMI_CONFIGURATION:w="nami_configuration",NAMI_PROFILE:v="nami_profile",API_CONFIG:S="api_config",API_CAMPAIGN_RULES:A="api_campaign_rules",API_PAYWALLS:k="api_paywalls",API_PRODUCTS:x="api_products",INITIAL_APP_CONFIG:E="initial_app_config",INITIAL_CAMPAIGN_RULES:$="initial_campaign_rules",INITIAL_PAYWALLS:I="initial_paywalls",INITIAL_PRODUCTS:C="initial_products",CUSTOMER_ATTRIBUTES_KEY_PREFIX:P="nami_cmr_attributes_",ANONYMOUS_MODE:O="nami_anonymous_mode",KEY_SESSION_COUNTER:M="nami_session_counter",INITIAL_SESSION_COUNTER_VALUE:R=1,NAMI_LAST_IMPRESSION_ID:L="nami_last_impression_id",NAMI_SESSION_ID:T="nami_session_id",API_VERSION:N="v3",BASE_URL_PATH:D=`sdk/${N}/platform`,BASE_URL:z="https://app.namiml.com",BASE_STAGING_URL:F="https://app-staging.namiml.com",CUSTOM_HOST_PREFIX:U="namiAPIHost=",USE_STAGING_API:B="useStagingAPI",EXTENDED_CLIENT_INFO_PREFIX:j="extendedClientInfo",EXTENDED_CLIENT_INFO_DELIMITER:H=":",EXTENDED_PLATFORM:X="extended-platform",EXTENDED_PLATFORM_VERSION:V="extended-platform-version",API_MAX_CALLS_LIMIT:G=2,API_RETRY_DELAY_SEC:W=2,DEVICE_API_TIMEOUT_LIMIT:Y=3e3,STATUS_SUCCESS:q=200,STATUS_BAD_REQUEST:K=400,STATUS_NOT_FOUND:Q=404,STATUS_INTERNAL_SERVER_ERROR:Z=500,INITIAL_SUCCESS:J="Initial success",RECONFIG_SUCCESS:ee="Reconfig success",ALREADY_CONFIGURED:te="Already configured",AVAILABLE_CAMPAIGNS_CHANGED:ne="AvailableCampaignsChanged",PAYWALL_ACTION_EVENT:re="PaywallActionEvent",SKU_TEXT_REGEX:se=/\$\{sku\.(\w+)(:\d+)?\}/g,VAR_REGEX:ie=/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g,CORS_PROXY_URL:oe="https://hosted-content-staging.namiml.com",CORS_PROXY_URL_LOCAL:ae="http://localhost:8001"}={};var ce;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(ce||(ce={}));const le={debug:ce.DEBUG,info:ce.INFO,warn:ce.WARN,error:ce.ERROR};const ue=new class{constructor(){this.setLogger=e=>{this.currentLogLevel=e?le[e]:ce.WARN}}debug(e,...t){this.shouldLog(ce.DEBUG)&&console.debug(this.formatMessage(ce.DEBUG,e,...t))}info(e,...t){this.shouldLog(ce.INFO)&&console.info(this.formatMessage(ce.INFO,e,...t))}warn(e,...t){this.shouldLog(ce.WARN)&&console.warn(this.formatMessage(ce.WARN,e,...t))}error(e,...t){this.shouldLog(ce.ERROR)&&console.error(this.formatMessage(ce.ERROR,e,...t))}shouldLog(e){return e>=this.currentLogLevel}formatMessage(e,t,...n){const r=ce[e];return`[${(new Date).toISOString()}] [${r}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}};const he=new class{setDevice(e){this.setItem(_,e)}getDevice(){return this.getItem(_)}resetDevice(){this.resetItem(_)}getAnonymousMode(){return this.getItem(O)||!1}setAnonymousMode(e){this.setItem(O,e)}clearAnonymousMode(){this.resetItem(O)}setAppConfig(e,t){this.setItem(e,t)}getAppConfig(e){return this.getItem(e)}setCampaignRules(e,t){this.setItem(e,t)}getCampaignRules(e){return this.getItem(e)}setPaywalls(e,t){this.setItem(e,t)}getPaywalls(e){return this.getItem(e)}setProducts(e,t){this.setItem(e,t)}getProducts(e){return this.getItem(e)}setNamiConfig(e){this.setItem(w,e)}getNamiConfig(){return this.getItem(w)}setCustomerAttribute(e,t){this.setItem(P+e,t)}getCustomerAttribute(e){return this.getItem(P+e)}getAllCustomerAttributes(){return Object.keys(localStorage).filter((e=>e.includes(P))).map((e=>e.replace(P,"")))}clearCustomerAttribute(e){const t=P+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}clearAllCustomerAttributes(){Object.keys(localStorage).filter((e=>e.includes(P))).map((e=>this.resetItem(e)))}setNamiProfile(e){this.setItem(v,e)}getNamiProfile(){return this.getItem(v)}removeNamiProfile(){this.resetItem(v)}setSessionCounter(){const e=this.getItem(M),t=e?parseInt(e):R||R;this.setItem(M,t+1)}setLastImpressionId(e){e&&this.setItem(L,e)}getLastImpressionId(){return this.getItem(L)??""}setSessionId(e){e&&this.setItem(T,e)}getSessionId(){return this.getItem(T)}clearSessionId(){this.resetItem(T)}setItem(e,t){try{const n=JSON.stringify(t);localStorage.setItem(e,n)}catch(e){ue.error("Error setting item in localStorage:",e)}}getItem(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return ue.error("Error getting item from localStorage:",e,": ",t),null}}resetItem(e){try{localStorage.removeItem(e)}catch(e){ue.error("Error removing item from localStorage:",e)}}clear(){try{localStorage.clear()}catch(e){ue.error("Error clearing localStorage:",e)}}};class de extends Error{constructor(e,t){super(t),this.statusCode=e,this.status=e,this.message=`RetryLimitExceededError: ${this.message}`}}class pe extends Error{constructor(){super(d)}}class fe extends Error{constructor(){super(l)}}class me extends Error{constructor(){super(u)}}class ge extends Error{constructor(){super(h)}}class ye extends Error{constructor(){super(p)}}class be extends Error{constructor(){super(m)}}class _e extends Error{constructor(){super(g)}}class we extends Error{constructor(){super(g)}}class ve extends Error{constructor(){super(f)}}class Se extends Error{constructor(e){super(e),this.message=`BadRequestError: ${this.message}`}}class Ae extends Error{constructor(e){super(e),this.message=`NotFoundError: ${this.message}`}}class ke extends Error{constructor(e,t){super(t),this.statusCode=e,this.message=`ClientError: ${this.message}`}}class xe extends Error{constructor(e){super(e),this.message=`ServerError: ${this.message}`}}const Ee=(e,t)=>{if(e==K)throw new Se(t);if(e==Q)throw new Ae(t);if(e>K&&e<Z)throw new ke(e,t);if(e>=Z)throw new xe(t)};function $e(e,t,n,r){var s,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}async function Ie(e,t,n=G){let r=0;const s=async()=>{const i=t?await fetch(e,t):await fetch(e);if(!i.ok){if(r++,r<=n){const e=1e3*(r+W);return await new Promise((t=>setTimeout(t,e))),s()}throw new de(i.status,`Request failed after ${n} retries`)}return i};return(await s()).json()}var Ce;"function"==typeof SuppressedError&&SuppressedError,function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management"}(Ce||(Ce={}));const Pe=e=>{let t;if(e?.includes(B))t=F;else{const n=e?.find((e=>e.includes(U)));t=n?n.split("=")[1]:z}return t=t.replace(/\/$/,""),t+"/"+D},Oe=e=>{const t=he.getAppConfig(S)||he.getAppConfig(E);return t?.capabilities?.includes(e)||!1},Me=e=>!Oe(Ce.THIRD_PARTY_TRANSACTIONS);function Re(e,t,n){const r=n.value;return n.value=function(...e){if(!this.platformID)throw new fe;return r.apply(this,e)},n}function Le(e,t,n){const r=n.value;return n.value=function(...e){const t=he.getDevice();if(!t?.id)throw new me;return r.apply(this,e)},n}class Te{static{this.instance=new Te}get deviceID(){return he.getDevice()?.id}static configure(e){this.instance.configure(e)}configure(e){this.baseURL=Pe(e.namiCommands),this.platformID=e.appPlatformId}async login(e){if(!e)throw new ge;const t=`device/${this.deviceID}/login/`,n={external_id:e};return await this.requestBodyAPI(t,n,"PUT")}async logout(){const e=`device/${this.deviceID}/logout/`;return await this.requestBodyAPI(e,{},"PUT")}async startSession(e){const t=`device/${this.deviceID}/session/`,n=await this.requestBodyAPI(t,{start_time:e,app_env:"production"});he.setSessionCounter(),n.id&&he.setSessionId(n.id)}async postImpression(e){const t=`device/${this.deviceID}/impression/`,n=await this.requestBodyAPI(t,e,"POST",!0);n.id&&he.setLastImpressionId(n.id)}async postConversion(e){const t=`device/${this.deviceID}/transaction/`;await this.requestBodyAPI(t,e,"POST",!0)}async purchaseValidation(e){const t=`device/${this.deviceID}/purchase_event/`;await this.requestBodyAPI(t,e,"PUT")}async fetchAPI(e){const t=`${this.baseURL}/${this.platformID}/`+e;return await Ie(t)}async requestBodyAPI(e,t,n="POST",r=!1,s){const i=`${this.baseURL}/${this.platformID}/`+e,o={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:r};return s?await this.timeoutRequest(i,o,s):await Ie(i,o)}async timeoutRequest(e,t,n){const r=new AbortController,s=setTimeout((()=>r.abort()),n);t.signal=r.signal;const i=await fetch(e,t);return clearTimeout(s),i.json()}}$e([Le],Te.prototype,"login",null),$e([Le],Te.prototype,"logout",null),$e([Le],Te.prototype,"startSession",null),$e([Le],Te.prototype,"postImpression",null),$e([Le],Te.prototype,"postConversion",null),$e([Le],Te.prototype,"purchaseValidation",null),$e([Re],Te.prototype,"fetchAPI",null),$e([Re],Te.prototype,"requestBodyAPI",null);var Ne="object"==typeof global&&global&&global.Object===Object&&global,De="object"==typeof self&&self&&self.Object===Object&&self,ze=Ne||De||Function("return this")(),Fe=ze.Symbol,Ue=Object.prototype,Be=Ue.hasOwnProperty,je=Ue.toString,He=Fe?Fe.toStringTag:void 0;var Xe=Object.prototype.toString;var Ve="[object Null]",Ge="[object Undefined]",We=Fe?Fe.toStringTag:void 0;function Ye(e){return null==e?void 0===e?Ge:Ve:We&&We in Object(e)?function(e){var t=Be.call(e,He),n=e[He];try{e[He]=void 0;var r=!0}catch(e){}var s=je.call(e);return r&&(t?e[He]=n:delete e[He]),s}(e):function(e){return Xe.call(e)}(e)}function qe(e){return null!=e&&"object"==typeof e}var Ke="[object Symbol]";function Qe(e){return"symbol"==typeof e||qe(e)&&Ye(e)==Ke}var Ze=Array.isArray,Je=1/0,et=Fe?Fe.prototype:void 0,tt=et?et.toString:void 0;function nt(e){if("string"==typeof e)return e;if(Ze(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(e,nt)+"";if(Qe(e))return tt?tt.call(e):"";var t=e+"";return"0"==t&&1/e==-Je?"-0":t}function rt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function st(e){return e}var it="[object AsyncFunction]",ot="[object Function]",at="[object GeneratorFunction]",ct="[object Proxy]";function lt(e){if(!rt(e))return!1;var t=Ye(e);return t==ot||t==at||t==it||t==ct}var ut,ht=ze["__core-js_shared__"],dt=(ut=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||""))?"Symbol(src)_1."+ut:"";var pt=Function.prototype.toString;function ft(e){if(null!=e){try{return pt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var mt=/^\[object .+?Constructor\]$/,gt=Function.prototype,yt=Object.prototype,bt=gt.toString,_t=yt.hasOwnProperty,wt=RegExp("^"+bt.call(_t).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vt(e){return!(!rt(e)||(t=e,dt&&dt in t))&&(lt(e)?wt:mt).test(ft(e));var t}function St(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return vt(n)?n:void 0}var At=St(ze,"WeakMap");function kt(e){return e!=e}function xt(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n){for(var r=e.length,s=n+-1;++s<r;)if(t(e[s],s,e))return s;return-1}(e,kt,n)}(e,t,0)>-1}var Et=9007199254740991,$t=/^(?:0|[1-9]\d*)$/;function It(e,t){var n=typeof e;return!!(t=null==t?Et:t)&&("number"==n||"symbol"!=n&&$t.test(e))&&e>-1&&e%1==0&&e<t}function Ct(e,t){return e===t||e!=e&&t!=t}var Pt=9007199254740991;function Ot(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Pt}var Mt=Object.prototype;function Rt(e){return qe(e)&&"[object Arguments]"==Ye(e)}var Lt=Object.prototype,Tt=Lt.hasOwnProperty,Nt=Lt.propertyIsEnumerable,Dt=Rt(function(){return arguments}())?Rt:function(e){return qe(e)&&Tt.call(e,"callee")&&!Nt.call(e,"callee")};var zt="object"==typeof e&&e&&!e.nodeType&&e,Ft=zt&&"object"==typeof module&&module&&!module.nodeType&&module,Ut=Ft&&Ft.exports===zt?ze.Buffer:void 0,Bt=(Ut?Ut.isBuffer:void 0)||function(){return!1},jt={};jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Arguments]"]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object Boolean]"]=jt["[object DataView]"]=jt["[object Date]"]=jt["[object Error]"]=jt["[object Function]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object WeakMap]"]=!1;var Ht,Xt="object"==typeof e&&e&&!e.nodeType&&e,Vt=Xt&&"object"==typeof module&&module&&!module.nodeType&&module,Gt=Vt&&Vt.exports===Xt&&Ne.process,Wt=function(){try{var e=Vt&&Vt.require&&Vt.require("util").types;return e||Gt&&Gt.binding&&Gt.binding("util")}catch(e){}}(),Yt=Wt&&Wt.isTypedArray,qt=Yt?(Ht=Yt,function(e){return Ht(e)}):function(e){return qe(e)&&Ot(e.length)&&!!jt[Ye(e)]},Kt=Object.prototype.hasOwnProperty;function Qt(e,t){var n=Ze(e),r=!n&&Dt(e),s=!n&&!r&&Bt(e),i=!n&&!r&&!s&&qt(e),o=n||r||s||i,a=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var l in e)!Kt.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||It(l,c))||a.push(l);return a}var Zt=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;function en(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Mt))return Zt(e);var t,n,r=[];for(var s in Object(e))Jt.call(e,s)&&"constructor"!=s&&r.push(s);return r}function tn(e){return null!=(t=e)&&Ot(t.length)&&!lt(t)?Qt(e):en(e);var t}var nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/;function sn(e,t){if(Ze(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qe(e))||(rn.test(e)||!nn.test(e)||null!=t&&e in Object(t))}var on=St(Object,"create");var an=Object.prototype.hasOwnProperty;var cn=Object.prototype.hasOwnProperty;function ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function un(e,t){for(var n=e.length;n--;)if(Ct(e[n][0],t))return n;return-1}ln.prototype.clear=function(){this.__data__=on?on(null):{},this.size=0},ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ln.prototype.get=function(e){var t=this.__data__;if(on){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return an.call(t,e)?t[e]:void 0},ln.prototype.has=function(e){var t=this.__data__;return on?void 0!==t[e]:cn.call(t,e)},ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=on&&void 0===t?"__lodash_hash_undefined__":t,this};var hn=Array.prototype.splice;function dn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=function(){this.__data__=[],this.size=0},dn.prototype.delete=function(e){var t=this.__data__,n=un(t,e);return!(n<0)&&(n==t.length-1?t.pop():hn.call(t,n,1),--this.size,!0)},dn.prototype.get=function(e){var t=this.__data__,n=un(t,e);return n<0?void 0:t[n][1]},dn.prototype.has=function(e){return un(this.__data__,e)>-1},dn.prototype.set=function(e,t){var n=this.__data__,r=un(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var pn=St(ze,"Map");function fn(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=function(){this.size=0,this.__data__={hash:new ln,map:new(pn||dn),string:new ln}},mn.prototype.delete=function(e){var t=fn(this,e).delete(e);return this.size-=t?1:0,t},mn.prototype.get=function(e){return fn(this,e).get(e)},mn.prototype.has=function(e){return fn(this,e).has(e)},mn.prototype.set=function(e,t){var n=fn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var gn="Expected a function";function yn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(gn);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(yn.Cache||mn),n}yn.Cache=mn;var bn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_n=/\\(\\)?/g,wn=function(e){var t=yn(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(bn,(function(e,n,r,s){t.push(r?s.replace(_n,"$1"):n||e)})),t}));function vn(e,t){return Ze(e)?e:sn(e,t)?[e]:wn(function(e){return null==e?"":nt(e)}(e))}var Sn=1/0;function An(e){if("string"==typeof e||Qe(e))return e;var t=e+"";return"0"==t&&1/e==-Sn?"-0":t}function kn(e,t){for(var n=0,r=(t=vn(t,e)).length;null!=e&&n<r;)e=e[An(t[n++])];return n&&n==r?e:void 0}function xn(e){var t=this.__data__=new dn(e);this.size=t.size}xn.prototype.clear=function(){this.__data__=new dn,this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xn.prototype.get=function(e){return this.__data__.get(e)},xn.prototype.has=function(e){return this.__data__.has(e)},xn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof dn){var r=n.__data__;if(!pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this};var En=Object.prototype.propertyIsEnumerable,$n=Object.getOwnPropertySymbols,In=$n?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[s++]=o)}return i}($n(e),(function(t){return En.call(e,t)})))}:function(){return[]};function Cn(e){return function(e,t,n){var r=t(e);return Ze(e)?r:function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}(r,n(e))}(e,tn,In)}var Pn=St(ze,"DataView"),On=St(ze,"Promise"),Mn=St(ze,"Set"),Rn="[object Map]",Ln="[object Promise]",Tn="[object Set]",Nn="[object WeakMap]",Dn="[object DataView]",zn=ft(Pn),Fn=ft(pn),Un=ft(On),Bn=ft(Mn),jn=ft(At),Hn=Ye;(Pn&&Hn(new Pn(new ArrayBuffer(1)))!=Dn||pn&&Hn(new pn)!=Rn||On&&Hn(On.resolve())!=Ln||Mn&&Hn(new Mn)!=Tn||At&&Hn(new At)!=Nn)&&(Hn=function(e){var t=Ye(e),n="[object Object]"==t?e.constructor:void 0,r=n?ft(n):"";if(r)switch(r){case zn:return Dn;case Fn:return Rn;case Un:return Ln;case Bn:return Tn;case jn:return Nn}return t});var Xn=ze.Uint8Array;function Vn(e){for(var t=-1,n=null==e?0:e.length,r=0,s=[];++t<n;){var i=e[t];i&&(s[r++]=i)}return s}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}function Wn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Yn(e,t){return e.has(t)}Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Gn.prototype.has=function(e){return this.__data__.has(e)};var qn=1,Kn=2;function Qn(e,t,n,r,s,i){var o=n&qn,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=i.get(e),u=i.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,p=n&Kn?new Gn:void 0;for(i.set(e,t),i.set(t,e);++h<a;){var f=e[h],m=t[h];if(r)var g=o?r(m,f,h,t,e,i):r(f,m,h,e,t,i);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!Wn(t,(function(e,t){if(!Yn(p,t)&&(f===e||s(f,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(f!==m&&!s(f,m,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d}function Zn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Jn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var er=1,tr=2,nr="[object Boolean]",rr="[object Date]",sr="[object Error]",ir="[object Map]",or="[object Number]",ar="[object RegExp]",cr="[object Set]",lr="[object String]",ur="[object Symbol]",hr="[object ArrayBuffer]",dr="[object DataView]",pr=Fe?Fe.prototype:void 0,fr=pr?pr.valueOf:void 0;var mr=1,gr=Object.prototype.hasOwnProperty;var yr=1,br="[object Arguments]",_r="[object Array]",wr="[object Object]",vr=Object.prototype.hasOwnProperty;function Sr(e,t,n,r,s,i){var o=Ze(e),a=Ze(t),c=o?_r:Hn(e),l=a?_r:Hn(t),u=(c=c==br?wr:c)==wr,h=(l=l==br?wr:l)==wr,d=c==l;if(d&&Bt(e)){if(!Bt(t))return!1;o=!0,u=!1}if(d&&!u)return i||(i=new xn),o||qt(e)?Qn(e,t,n,r,s,i):function(e,t,n,r,s,i,o){switch(n){case dr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case hr:return!(e.byteLength!=t.byteLength||!i(new Xn(e),new Xn(t)));case nr:case rr:case or:return Ct(+e,+t);case sr:return e.name==t.name&&e.message==t.message;case ar:case lr:return e==t+"";case ir:var a=Zn;case cr:var c=r&er;if(a||(a=Jn),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=tr,o.set(e,t);var u=Qn(a(e),a(t),r,s,i,o);return o.delete(e),u;case ur:if(fr)return fr.call(e)==fr.call(t)}return!1}(e,t,c,n,r,s,i);if(!(n&yr)){var p=u&&vr.call(e,"__wrapped__"),f=h&&vr.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return i||(i=new xn),s(m,g,n,r,i)}}return!!d&&(i||(i=new xn),function(e,t,n,r,s,i){var o=n&mr,a=Cn(e),c=a.length;if(c!=Cn(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:gr.call(t,u)))return!1}var h=i.get(e),d=i.get(t);if(h&&d)return h==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var f=o;++l<c;){var m=e[u=a[l]],g=t[u];if(r)var y=o?r(g,m,u,t,e,i):r(m,g,u,e,t,i);if(!(void 0===y?m===g||s(m,g,n,r,i):y)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,s,i))}function Ar(e,t,n,r,s){return e===t||(null==e||null==t||!qe(e)&&!qe(t)?e!=e&&t!=t:Sr(e,t,n,r,Ar,s))}var kr=1,xr=2;function Er(e){return e==e&&!rt(e)}function $r(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Ir(e){var t=function(e){for(var t=tn(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,Er(s)]}return t}(e);return 1==t.length&&t[0][2]?$r(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var s=n.length,i=s;if(null==e)return!i;for(e=Object(e);s--;){var o=n[s];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++s<i;){var a=(o=n[s])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u=new xn;if(!Ar(l,c,kr|xr,r,u))return!1}}return!0}(n,0,t)}}function Cr(e,t){return null!=e&&t in Object(e)}function Pr(e,t){return null!=e&&function(e,t,n){for(var r=-1,s=(t=vn(t,e)).length,i=!1;++r<s;){var o=An(t[r]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}return i||++r!=s?i:!!(s=null==e?0:e.length)&&Ot(s)&&It(o,s)&&(Ze(e)||Dt(e))}(e,t,Cr)}var Or=1,Mr=2;function Rr(e,t){return sn(e)&&Er(t)?$r(An(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:kn(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?Pr(n,e):Ar(t,r,Or|Mr)}}function Lr(e){return sn(e)?(t=An(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return kn(t,e)}}(e);var t}function Tr(e,t){return Ar(e,t)}var Nr=Mn&&1/Jn(new Mn([,-0]))[1]==1/0?function(e){return new Mn(e)}:function(){},Dr=200;function zr(e,t){return e&&e.length?function(e,t,n){var r=-1,s=xt,i=e.length,o=!0,a=[],c=a;if(i>=Dr){var l=t?null:Nr(e);if(l)return Jn(l);o=!1,s=Yn,c=new Gn}else c=t?[]:a;e:for(;++r<i;){var u=e[r],h=t?t(u):u;if(u=0!==u?u:0,o&&h==h){for(var d=c.length;d--;)if(c[d]===h)continue e;t&&c.push(h),a.push(u)}else s(c,h,n)||(c!==a&&c.push(h),a.push(u))}return a}(e,"function"==typeof(n=t)?n:null==n?st:"object"==typeof n?Ze(n)?Rr(n[0],n[1]):Ir(n):Lr(n)):[];var n}var Fr,Ur="object"==typeof Reflect?Reflect:null,Br=Ur&&"function"==typeof Ur.apply?Ur.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Fr=Ur&&"function"==typeof Ur.ownKeys?Ur.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var jr=Number.isNaN||function(e){return e!=e};function Hr(){Hr.init.call(this)}Hr.EventEmitter=Hr,Hr.prototype._events=void 0,Hr.prototype._eventsCount=0,Hr.prototype._maxListeners=void 0;var Xr=10;function Vr(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Gr(e){return void 0===e._maxListeners?Hr.defaultMaxListeners:e._maxListeners}function Wr(e,t,n,r){var s,i,o,a;if(Vr(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"==typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(s=Gr(e))>0&&o.length>s&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function Yr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function qr(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Yr.bind(r);return s.listener=n,r.wrapFn=s,s}function Kr(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):Zr(s,s.length)}function Qr(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function Zr(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(Hr,"defaultMaxListeners",{enumerable:!0,get:function(){return Xr},set:function(e){if("number"!=typeof e||e<0||jr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Xr=e}}),Hr.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Hr.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||jr(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Hr.prototype.getMaxListeners=function(){return Gr(this)},Hr.prototype.emit=function(e){var t=[];for(let e=1;e<arguments.length;e++)t.push(arguments[e]);var n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var o=r[e];if(void 0===o)return!1;if("function"==typeof o)Br(o,this,t);else{var a=o.length,c=Zr(o,a);for(let e=0;e<a;++e)Br(c[e],this,t)}return!0},Hr.prototype.addListener=function(e,t){return Wr(this,e,t,!1)},Hr.prototype.on=Hr.prototype.addListener,Hr.prototype.prependListener=function(e,t){return Wr(this,e,t,!0)},Hr.prototype.once=function(e,t){return Vr(t),this.on(e,qr(this,e,t)),this},Hr.prototype.prependOnceListener=function(e,t){return Vr(t),this.prependListener(e,qr(this,e,t)),this},Hr.prototype.removeListener=function(e,t){var n,r,s,i,o;if(Vr(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,s=i;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},Hr.prototype.off=Hr.prototype.removeListener,Hr.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var s,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(s=i[r])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},Hr.prototype.listeners=function(e){return Kr(this,e,!0)},Hr.prototype.rawListeners=function(e){return Kr(this,e,!1)},Hr.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Qr.call(e,t)},Hr.prototype.listenerCount=Qr,Hr.prototype.eventNames=function(){return this._eventsCount>0?Fr(this._events):[]};class Jr{constructor(){this.emitter=new Hr}static getInstance(){return this.instance||(this.instance=new Jr),this.instance}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}emit(e,...t){this.emitter.emit(e,...t)}addListener(e,t){this.emitter.addListener(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}listeners(e){return this.emitter.listeners(e)}listenerCount(e){return this.emitter.listenerCount(e)}}const es={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},ts={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},ns={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},rs={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ss={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class is{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=is.getVersionPrecision(e),s=is.getVersionPrecision(t);let i=Math.max(r,s),o=0;const a=is.map([e,t],(e=>{const t=i-is.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return is.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(o=i-Math.min(r,s)),i-=1;i>=o;){if(a[0][i]>a[1][i])return 1;if(a[0][i]===a[1][i]){if(i===o)return 0;i-=1}else if(a[0][i]<a[1][i])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,s;if(Object.assign)return Object.assign(e,...t);for(r=0,s=t.length;r<s;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach((t=>{n[t]=e[t]}))}}return e}static getBrowserAlias(e){return es[e]}static getBrowserTypeByAlias(e){return ts[e]||""}}const os=/version\/(\d+(\.?_?\d+)+)/i,as=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=is.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=is.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=is.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=is.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=is.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=is.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=is.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=is.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=is.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=is.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=is.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=is.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=is.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=is.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=is.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=is.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=is.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=is.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=is.getFirstMatch(os,e)||is.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=is.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=is.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=is.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=is.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=is.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=is.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=is.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=is.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=is.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=is.getFirstMatch(os,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:is.getFirstMatch(t,e),version:is.getSecondMatch(t,e)}}}];var cs=[{test:[/Roku\/DVP/],describe(e){const t=is.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:rs.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=is.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:rs.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=is.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=is.getWindowsVersionName(t);return{name:rs.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:rs.iOS},n=is.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=is.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=is.getMacOSVersionName(t),r={name:rs.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=is.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:rs.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=is.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=is.getAndroidVersionName(t),r={name:rs.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=is.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:rs.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=is.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||is.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||is.getFirstMatch(/\bbb(\d+)/i,e);return{name:rs.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=is.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:rs.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=is.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:rs.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:rs.Linux})},{test:[/CrOS/],describe:()=>({name:rs.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=is.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:rs.PlayStation4,version:t}}}],ls=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=is.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:ns.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:ns.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:ns.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:ns.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:ns.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:ns.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:ns.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=is.getFirstMatch(/(ipod|iphone)/i,e);return{type:ns.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:ns.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:ns.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:ns.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:ns.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:ns.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:ns.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:ns.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:ns.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:ns.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:ns.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:ns.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:ns.tv})}],us=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ss.Blink};const t=is.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ss.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ss.Trident},n=is.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ss.Presto},n=is.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:ss.Gecko},n=is.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ss.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ss.WebKit},n=is.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class hs{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=is.find(as,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=is.find(cs,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=is.find(ls,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=is.find(us,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return is.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let s=0;if(Object.keys(e).forEach((i=>{const o=e[i];"string"==typeof o?(r[i]=o,s+=1):"object"==typeof o&&(t[i]=o,n+=1)})),n>0){const e=Object.keys(t),n=is.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=is.find(e,(e=>this.isPlatform(e)));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(s>0){const e=Object.keys(r),t=is.find(e,(e=>this.isBrowser(e,!0)));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const s=is.getBrowserTypeByAlias(r);return t&&s&&(r=s.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(is.compareVersions(s,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some((e=>this.is(e)))}}class ds{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new hs(e,t)}static parse(e){return new hs(e).getResult()}static get BROWSER_MAP(){return ts}static get ENGINE_MAP(){return ss}static get OS_MAP(){return rs}static get PLATFORMS_MAP(){return ns}}const ps={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},fs=e=>{if("undefined"==typeof window)return{os_version:"X.X.X",os_name:"Server",browser_name:"Unknown",browser_version:"X.X.X",sdk_client:"web",sdk_version:o,language:"en"};const t=ds.getParser(window.navigator.userAgent),n=t.getPlatform(),r={os_version:t.getOSVersion(),os_name:t.getOSName(),browser_name:t.getBrowserName(),browser_version:t.getBrowserVersion(),sdk_client:"web",sdk_version:o,language:window.navigator.language};if(n.type&&(r.form_factor=ps[n.type]),n.model&&(r.device_model=n.model),e&&e.length>0){const t=(e=>{const t=e.find((e=>e.includes(j))),n={platform:"",version:""};if(t){const e=t.split(H);n.platform=e[1],n.version=e[2]}return n})(e);r.extended_platform=t.platform,r.extended_platform_version=t.version}return r},ms=()=>{if("undefined"==typeof window)return ps.desktop;const e=ds.getParser(window.navigator.userAgent).getPlatform();return e.type?ps[e.type]:ps.desktop};class gs{static{this.instance=new gs(ms())}constructor(e){this.currentFormFactor=e}async fetchCampaignRules(e){const t=he.getDevice();let n;return n=t?.id?await this.getCampaigns(t.id):await this.getAnonymousCampaigns(),n=n?.filter((e=>e.form_factors.some((e=>e.form_factor===this.currentFormFactor)))),n=n?.filter((t=>{const n=e.find((e=>e.id==t.paywall));if(n)return t})),he.setCampaignRules(A,n),this.invokeAvailableCampaignsResponseHandler(),n}invokeAvailableCampaignsResponseHandler(e){const t=Jr.getInstance().listeners(ne);if(!e){const t=he.getCampaignRules(A)??[],n=he.getCampaignRules($)??[];e=zr(Vn([...t,...n]),"rule")}t.forEach((t=>{t(e)}))}async getAnonymousCampaigns(){const e="campaign_rules/";let t;try{t=await Te.instance.fetchAPI(e)}catch(t){throw ue.error(Ee(t.status,e)),t}return t.results}async getCampaigns(e){const t=`device/${e}/campaign_rules/`;let n;try{n=await Te.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw ue.error(Ee(e.status,t)),e}return n?.results||[]}fallbackData(){const e=he.getCampaignRules(A)||he.getCampaignRules($);return e?{count:e.length,results:e}:null}}class ys{static{this.instance=new ys}async createOrUpdateDevice(e){const t=he.getDevice();return t?.id?this.isEqualDevices(t,e)?t:this.updateDevice(t.id,e):this.createDevice(e)}async createDevice(e){const t=await this.requestAPIData("device/",e);return t&&he.setDevice(t),t}async updateDevice(e,t){const n=await this.requestAPIData(`device/${e}/`,t,"PUT");return n&&he.setDevice(n),n}async updateDeviceField(e,t){const n={[e]:t},r=he.getDevice();if(!r?.id)throw new me;const s=await this.requestAPIData(`device/${r.id}/`,n,"PATCH");return s&&he.setDevice(s),s}async requestAPIData(e,t,n="POST"){let r;try{r=await Te.instance.requestBodyAPI(e,t,n,!1,Y)}catch(t){if(t instanceof fe)throw t;if(r=he.getDevice(),!r)return ue.error(Ee(t.status,e)),null}return r}isEqualDevices(e,t){const n={...e,...t},r=Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{});return Tr(r,e)}}class bs{static{this.instance=new bs}async fetchProducts(){if(Oe(Ce.THIRD_PARTY_TRANSACTIONS))return[];let e;try{e=await Te.instance.fetchAPI("products/")}catch(t){if(e=this.fallbackData(),!e)throw ue.error(Ee(t.status,"products/")),t}return e?.results&&he.setProducts(x,e.results),e?.results||[]}fallbackData(){const e=he.getProducts(x)||he.getProducts(C);return e?{count:e.length,results:e}:null}}class _s{static{this.instance=new _s}async fetchPaywalls(){const e=he.getDevice();let t;return t=e?.id?await this.getPaywalls(e.id):await this.getAnonymousPaywalls(),t&&he.setPaywalls(k,t),t||[]}async getAnonymousPaywalls(e=o){const t=`paywalls/?sdk_version=${e}`;let n;try{n=await Te.instance.fetchAPI(t)}catch(e){throw ue.error(Ee(e.status,t)),e}return n.results}async getPaywalls(e){const t=`device/${e}/paywalls/`;let n;try{n=await Te.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw ue.error(Ee(e.status,t)),e}return n?.results||[]}fallbackData(){const e=he.getPaywalls(k)||he.getPaywalls(I);return e?{count:e.length,results:e}:null}}class ws{static{this.instance=new ws}async fetchConfig(){let e;try{e=await Te.instance.fetchAPI("config/")}catch(t){if(e=he.getAppConfig(S)||he.getAppConfig(E),!e)throw ue.error(Ee(t.status,"config/")),t}return e&&he.setAppConfig(S,e),e}}class vs{static{this.instance=new vs}async startSession(){he.getAnonymousMode()?ue.debug("Skipping session start call - anonymous mode"):await Te.instance.startSession(new Date)}}class Ss{static{this.instance=new Ss}async init(e){this.setInitialValues(e),await this.initAndFetchRequiredData(e)}setInitialValues(e){he.clearSessionId(),he.setNamiConfig(e);const t=e.initialConfig;if(t.campaign_rules&&he.setCampaignRules($,t.campaign_rules),t.appConfig||t.platform_config){const e=t?.appConfig||t?.platform_config;e&&he.setAppConfig(E,e)}t?.paywalls&&he.setPaywalls(I,t.paywalls),t?.products&&he.setProducts(C,t.products)}async initAndFetchRequiredData(e){let t=null;if(!he.getAnonymousMode()){const n=fs(e.namiCommands);e.formFactor&&(n.form_factor=e.formFactor),t=await ys.instance.createOrUpdateDevice(n)}const n=e.formFactor??t?.form_factor??ms();e.formFactor&&n!==e.formFactor&&(gs.instance.currentFormFactor=n);const r=Promise.all([ws.instance.fetchConfig(),bs.instance.fetchProducts(),_s.instance.fetchPaywalls().then((e=>gs.instance.fetchCampaignRules(e)))]),s=e.initialConfig;s.campaign_rules?.length&&s.paywalls?.length||await r,vs.instance.startSession()}}class As{static{this.instance=new As}#e=!1;get isInitialized(){return this.#e}static async configure(e){if(!e.appPlatformId)throw new fe;return this.setInitialConfig(e),await As.instance.initializeSDK(e)}static setInitialConfig(e){let t={};if(e.initialConfig)if("string"==typeof e.initialConfig)try{t=JSON.parse(e.initialConfig)}catch(e){ue.error("Failed to parse NamiConfiguration.initialConfig"),t={}}else t=e.initialConfig;else t={};e.initialConfig=t}async initializeSDK(e){let t=!1,n=!1;const r=this.#e?he.getNamiConfig():null;if(ue.setLogger(e.logLevel),null!==r){if(Tr(e,r))return ue.warn("Nami SDK is already configured, ignoring this configure call."),{sdkInitialized:!0,configureState:te};n=!0;const s=Pe(e.namiCommands),i=Pe(r.namiCommands);e.appPlatformId==r.appPlatformId&&s==i||(t=!0),e.languageCode===r.languageCode&&e.logLevel==r.logLevel||(n=!0)}t&&(ue.info("SDK full reconfigure called"),he.resetDevice()),this.#e=!0,Te.configure(e),await Ss.instance.init(e),ue.info("SDK successfully initialized!");return{sdkInitialized:!0,configureState:n||t?ee:J}}}var ks,xs,Es;!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(ks||(ks={})),function(e){e.REGISTER_BUY_SKU="RegisterBuySKU",e.PAYWALL_CLOSE_REQUESTED="PaywallCloseRequested",e.PAYWALL_SIGNIN_REQUESTED="PaywallSignInRequested",e.PAYWALL_RESTORE_REQUESTED="PaywallRestoreRequested",e.PAYWALL_DEEPLINK_ACTION="PaywallDeeplinkAction"}(xs||(xs={})),e.NamiPaywallAction=void 0,(Es=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Es.SELECT_SKU="SELECT_SKU",Es.RESTORE_PURCHASES="RESTORE_PURCHASES",Es.SIGN_IN="SIGN_IN",Es.CLOSE_PAYWALL="CLOSE_PAYWALL",Es.SHOW_PAYWALL="SHOW_PAYWALL",Es.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Es.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Es.PURCHASE_FAILED="PURCHASE_FAILED",Es.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Es.PURCHASE_PENDING="PURCHASE_PENDING",Es.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Es.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Es.EMPTY="";function $s(e){if("subscription"===e?.product_type){const t=function(e){if(!e||!e.subscription_period)return[];const t=e.offers.filter((e=>"promo"===e.offer_type));return Cs(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return t?.billingPeriod}}function Is(e){if(!e||!e.subscription_period)return[];return Cs(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period)}function Cs(e,t){return e.map((e=>Ps(e,t)))}function Ps(e,t){if(!e)return{};const n=e.promo_period?.count??t?.count,r=e.promo_period?.type??t?.type,s=e.promo_price?.price??e.price,i=e.promo_price?.currency??e.currency;return{priceAmountMicros:1e6*s,priceCurrencyCode:i,billingPeriod:r?`P${n}${r[0].toUpperCase()}`:"",formattedPrice:Ms(i).format(s)}}function Os(e,t=!1,n=!1,r=!1){if(!e)return null;const s=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?/);if(!s)return null;const[i,o,a]=s.slice(1).map((e=>parseInt(e))),c=(e,t,n,r,s,i)=>r?e.toString():n?1===e||t?s:i:1===e||t?`${e} ${s}`:`${e} ${i}`;switch(e.at(-1)){case"D":return c(a,t,n,r,"day","days");case"W":return c(a/7,t,n,r,"week","weeks");case"M":return c(o,t,n,r,"month","months");case"Y":return c(i,t,n,r,"year","years")}return null}function Ms(e){const t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:e})}catch(e){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:"USD"})}}const Rs=(e,t,n)=>e&&t&&n?n.format(e-t):null,Ls=(e,t,n,r)=>{if(e&&t&&n&&r){const s=100*(1-e/(n/r*t));return`${Math.round(s)}%`}return null},Ts=(e,t)=>{if(""==t)return;const n=parseInt(t);return n>=0&&n<e?.length?e[n]:e?.find((e=>e.sku_ref_id===t))},Ns=e=>zs(e.priceAmountMicros)/Ds(e.billingPeriod),Ds=e=>{let t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},zs=e=>e/1e6;function Fs(e){return parseFloat((Math.round(e)/100).toFixed(2))}const Us={price:"$XX.XX",name:"",title:"",description:"",duration:"XXXXX",durationSingular:"XXXXX",period:"XXXXX",periodNumber:"X",freeTrialDuration:"XXXXX",freeTrialDurationSingular:"XXXXX",freeTrialPeriod:"XXXXX",freeTrialPeriodNumber:"X",pricePerMonth:"$XX.XX",pricePerMonthRounded:"$XX",periodInMonths:"XXXXX",durationInMonths:"XXXXX",durationInMonthsSingular:"XXXXX",periodNumberInMonths:"X",percentagePriceDifferenceFromSku:"XX%",priceDifferenceFromSku:"$XX.XX",promoEligible:!1,freeTrialEligible:!1,promo:"XXXXX",promoCode:"XXXXX",promoPrice:"$XX.XX",promoPeriod:"XXXXX",promoPeriodNumber:"X",promoDuration:"XXXXX",promoDurationSingular:"XXXXX",introEligible:!1,pricePerDay:"$X.XX",pricePerWeek:"$X.XX",pricePerWeekRounded:"$XX",introductoryPrice:"$XX.XX",introductoryPeriod:"XXXXX",introductoryPeriodNumber:"X",introductoryDuration:"XXXXX",introductoryDurationSingular:"XXXXX",introductoryPricePerMonth:"$XX.XX",introductoryPricePerMonthRounded:"$XX",invalid:!1,unavailable:!1},Bs=(e,t,n,r=[])=>{const s=Us[e];if(!t)return s;return(0,{price:()=>js(t),name:()=>t?.name,title:()=>t?.name,description:()=>t?.description,duration:()=>Hs(t),durationSingular:()=>Hs(t,!0),period:()=>Hs(t,!1,!0),periodNumber:()=>Hs(t,!1,!1,!0),freeTrialDuration:()=>Xs(t),freeTrialDurationSingular:()=>Xs(t,!0),freeTrialPeriod:()=>Xs(t,!1,!0),freeTrialPeriodNumber:()=>Xs(t,!1,!1,!0),pricePerMonth:()=>Vs(t),pricePerMonthRounded:()=>Vs(t,!0),periodInMonths:()=>Gs(t),durationInMonths:()=>Ws(t),durationInMonthsSingular:()=>Ws(t,!0),periodNumberInMonths:()=>Ys(t),percentagePriceDifferenceFromSku:()=>qs(t,n,r),priceDifferenceFromSku:()=>Ks(t,n,r),promoEligible:()=>null===Qs(t)&&null!==Zs(t,n),freeTrialEligible:()=>null!==Qs(t),promo:()=>Zs(t,n)?.offer_ref_id,promoCode:()=>"XXXXX",promoPrice:()=>Js(t,n)?.formattedPrice,promoPeriod:()=>ei(t,n,!1,!0),promoPeriodNumber:()=>ei(t,n,!1,!1,!0),promoDuration:()=>ei(t,n),promoDurationSingular:()=>ei(t,n,!0),introEligible:()=>!1,pricePerDay:()=>ti(t),pricePerWeek:()=>ni(t),pricePerWeekRounded:()=>ni(t,!0),introductoryPrice:()=>ri(t,n),introductoryPeriod:()=>si(t,n,!1,!0),introductoryPeriodNumber:()=>si(t,n,!1,!1,!0),introductoryDuration:()=>si(t,n),introductoryDurationSingular:()=>si(t,n,!0),introductoryPricePerMonth:()=>ii(t,n),introductoryPricePerMonthRounded:()=>ii(t,n,!0),invalid:()=>!1,unavailable:()=>!1}[e])()??s??null},js=e=>{if("subscription"===e?.product_type){const t=Is(e);return t&&t.length?t[0].formattedPrice:null}return null},Hs=(e,t,n,r)=>Os(function(e){if("subscription"===e?.product_type){const t=Is(e);if(t.length>0)return t[0].billingPeriod}}(e),t,n,r),Xs=(e,t,n,r)=>Os($s(e),t,n,r),Vs=(e,t)=>{const n=Is(e);if(!n||0===n.length)return null;const r=Ns(n[0]);return r?Ms(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Gs=e=>{const t=Is(e);return"P1Y"===t[0].billingPeriod&&(t[0].billingPeriod="P12M"),t&&t.length?Os(t[0].billingPeriod):null},Ws=(e,t,n,r)=>{const s=Is(e);return s&&0!==s.length?("P1Y"===s[0].billingPeriod&&(s[0].billingPeriod="P12M"),Os(s[0].billingPeriod,t,n,r)):null},Ys=e=>{if(!e)return 0;const t=Is(e);return t&&t.length?Ds(t[0].billingPeriod):0},qs=(e,t,n=[])=>{const r=Is(e);if(!r||0===r.length)return null;const s=Ts(n,t??"")?.product_details;if(!t||!s)return Ls(Fs(r[0].priceAmountMicros),Ys(e));const i=Is(s);return Ls(Fs(r[0].priceAmountMicros),Ys(e),i?.length>0?Fs(i[0].priceAmountMicros):0,Ys(s))},Ks=(e,t,n=[])=>{const r=Is(e);if(!r||0===r.length)return null;const s=Ts(n,t??"")?.product_details;if(!t||!s)return Rs(Ns(r[0]));const i=Is(s);return Rs(Ns(r[0]),Ns(i[0]),Ms(i[0].priceCurrencyCode))},Qs=e=>$s(e),Zs=(e,t)=>{if(!e)return null;const n=e.offers.filter((e=>"promo"===e.offer_type));if(!t)return n[0];const r=n[parseInt(t)];return r||(n.find((e=>e.offer_ref_id===t))||null)},Js=(e,t)=>{if(!e)return null;return Ps(Zs(e,t),e.subscription_period)},ei=(e,t,n,r,s)=>{const i=Js(e,t);return Os(i?.billingPeriod,n,r,s)},ti=(e,t)=>{const n=Is(e);if(!n||0===n.length)return null;const r=zs(n[0].priceAmountMicros)/(e=>{const t=Ds(e);return t?30.437*t:1})(n[0].billingPeriod);return r?Ms(n[0].priceCurrencyCode).format(r):null},ni=(e,t)=>{const n=Is(e);if(!n||0===n.length)return null;const r=zs(n[0].priceAmountMicros)/(e=>{const t=Ds(e);return t?52*t/12:1})(n[0].billingPeriod);return r?Ms(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},ri=(e,t)=>{const n=oi(e,t);return n?.formattedPrice||null},si=(e,t,n,r,s)=>{const i=oi(e,t);return Os(i?.billingPeriod,n,r,s)},ii=(e,t,n)=>{const r=oi(e,t);if(!r)return;const s=zs(r.priceAmountMicros),i=Ds(r.billingPeriod),o=n?Math.round(s/i):s/i;return Ms(r.priceCurrencyCode).format(o)},oi=(e,t)=>{if(!e)return null;let n;return t?(n=e.offers[parseInt(t)],n||(n=e.offers.find((e=>e.offer_ref_id===t))||null)):n=e.offers[0],Ps(n,e.subscription_period)};function ai(e,t,n,r){const s=n?.flatMap((e=>e.products)).find((e=>e.id===t.selectedProducts[t.currentGroupId]));return ci(hi(e,s?.name??""),s,r)}function ci(e,t,n){if(!t)return{};const r=t.variables;return r&&Object.keys(r).forEach((t=>{var s;"string"==typeof r[t]&&r[t].includes("${")&&(r[t]=(s=r[t]).replace(se,((t,r)=>{const i=se.exec(s)?.slice(1)||[];r=i[0]??r;const o=i[1]?.replace(":","")??"";return Bs(r,e,o,n)})))})),{...t,...r}}function li(e,t,n){return di(t,n)?.some((()=>1==Bs("freeTrialEligible",hi(e,""))))??!1}function ui(e,t,n){return!li(e,t,n)&&(di(t,n)?.some((()=>1==Bs("promoEligible",hi(e,""))))??!1)}function hi(e=[],t){return e.find((e=>e.name===t))||null}function di(e,t){const n=e?.filter((e=>t?.some((t=>t===e.ref)))),r=n?.filter((t=>e.find((e=>e.products?.some((e=>e.id===t.id))))))?.map((e=>e.products))[0];return r}const pi={paywallId:"",livePaywalls:[],selectedPaywall:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},currentPage:"page1",currentGroupId:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{}},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop"};const fi=new class{constructor(){this.host=null,this.state=pi,this.subscribers=new Set}subscribe(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}unsubscribe(e){this.subscribers.delete(e)}hostConnected(){}hostDisconnected(){this.subscribers.forEach((e=>this.unsubscribe(e)))}setState(e){this.state=e,this.subscribers.forEach((e=>e())),this.host&&this.host.requestUpdate()}setProductDetails(e){this.productDetails=e}getProductDetails(){return this.productDetails}setCurrentGroupId(e){this.setState({...this.state,currentGroupId:e})}currentGroupId(){return this.state.currentGroupId}setSelectedProdcuts(e){this.setState({...this.state,selectedProducts:e})}selectedProducts(){return this.state.selectedProducts}setPaywall(e,t){const n=e.template.initialState.groups?.map((e=>e.ref))||[],r=function(e,t,n){const r=t?.find((e=>n===e.id))?.products||[];return r.map((t=>{t.product_details=hi(e,t.name||"")})),r.forEach((e=>{ci(e.product_details,e,r)})),r||[]}(this.productDetails,e.sku_menus,e.template.initialState.currentGroupId),s={...this.state,...e.template.initialState,anySkuHasTrialOffer:li(this.productDetails,e.sku_menus,n),anySkuHasPromoOffer:ui(this.productDetails,e.sku_menus,n),paywallId:e.id,selectedPaywall:e,launch:t||{...this.state.launch,productGroups:n},sku:ai(this.productDetails,e.template.initialState,e.sku_menus,r),skuItems:r};this.setState(s)}paywallId(){return this.state.paywallId}setCurrentPage(e){this.setState({...this.state,currentPage:e})}setCustomerAttribute(e){this.setState({...this.state,customer:{...this.state.customer,...e}})}removeCustomerAttribute(e){delete this.state.customer[e],this.setState(this.state)}setIsLoggedIn(e){this.setState({...this.state,isLoggedIn:e})}setMediaList(e){this.setState({...this.state,mediaList:e.reduce(((e,t)=>({...e,[t.name]:t})))})}setSafeAreaTop(e){this.setState({...this.state,safeAreaTop:e})}setFullScreenPresentation(e){this.setState({...this.state,fullScreenPresentation:e})}setFormFactor(e){this.setState({...this.state,formFactor:e})}setPurchaseInProgress(e){this.setState({...this.state,purchaseInProgress:e})}setPurchase(e,t){this.setState({...this.state,purchaseInProgress:e,productBeingPurchased:t})}setTimeSpentOnPaywall(e){this.setState({...this.state,timeSpentOnPaywall:e})}};class mi{static{this.instance=new mi}constructor(){this.load()}setExternalId(e){return this.externalId=e,this}getExternalId(){return this.externalId}isLoggedIn(){return!!this.externalId}save(){return this.externalId?he.setNamiProfile({externalId:this.externalId}):he.removeNamiProfile(),this}load(){const e=he.getNamiProfile();e&&(this.externalId=e.externalId)}async login(e){const t=await Te.instance.login(e);t.external_id&&fi.setIsLoggedIn(!0),this.setExternalId(t.external_id).save()}async logout(){await Te.instance.logout(),fi.setIsLoggedIn(!1),this.setExternalId(void 0).save()}}var gi;!function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(gi||(gi={}));class yi{constructor(){this.emitter=Jr.getInstance()}static{this.instance=new yi}static isLoggedIn(){return mi.instance.isLoggedIn()}static loggedInId(){return this.instance.isSDKInitialized||ue.debug(d),mi.instance.getExternalId()}static async login(e){if(!this.instance.isSDKInitialized){const e=new pe;throw this.invokeStateHandler(gi.LOGIN,!1,e),e}if(this.inAnonymousMode()){const e=new we;throw this.invokeStateHandler(gi.LOGIN,!1,e),e}try{await mi.instance.login(e),this.invokeStateHandler(gi.LOGIN,!0)}catch(e){throw this.invokeStateHandler(gi.LOGIN,!1,e),e}}static async logout(){if(!this.instance.isSDKInitialized){const e=new pe;throw this.invokeStateHandler(gi.LOGOUT,!1,e),e}if(this.inAnonymousMode()){const e=new we;throw this.invokeStateHandler(gi.LOGOUT,!1,e),e}try{await mi.instance.logout(),this.invokeStateHandler(gi.LOGOUT,!0)}catch(e){throw this.invokeStateHandler(gi.LOGOUT,!1,e),e}}static async setCustomerDataPlatformId(e){await this.updateCustomerDataPlatformId(e)}static async clearCustomerDataPlatformId(){await this.updateCustomerDataPlatformId(null)}static registerAccountStateHandler(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}static async setAnonymousMode(e){const t=e?gi.ANONYMOUS_MODE_ON:gi.ANONYMOUS_MODE_OFF;if(!this.instance.isSDKInitialized){const e=new pe;throw this.invokeStateHandler(t,!1,e),e}if(this.anonymousModeCapability())if(this.inAnonymousMode()!==e)if(e)he.setAnonymousMode(e),he.resetDevice(),this.refetchConfig(),this.invokeStateHandler(gi.ANONYMOUS_MODE_ON,!0);else{he.clearAnonymousMode();const e=he.getNamiConfig()?.namiCommands;await ys.instance.createOrUpdateDevice(fs(e)),this.refetchConfig(),this.invokeStateHandler(gi.ANONYMOUS_MODE_OFF,!0)}else{const n=e?new be:new _e;this.invokeStateHandler(t,!1,n)}else ue.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details.")}static inAnonymousMode(){return!!this.instance.isSDKInitialized&&he.getAnonymousMode()}static setCustomerAttribute(e,t){if(!this.instance.isSDKInitialized)throw new pe;he.setCustomerAttribute(e,t),Oe(Ce.PAYWALL_PERSONALIZATION)?(fi.setCustomerAttribute({[e]:t}),ue.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):ue.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`)}static getCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new pe;const t=he.getCustomerAttribute(e);return null!=t?Oe(Ce.PAYWALL_PERSONALIZATION)?ue.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):ue.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):ue.warn(`No ${e} customer attribute found.`),t}static clearCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new pe;he.clearCustomerAttribute(e)?(fi.removeCustomerAttribute(e),ue.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):ue.warn(`No value to clear for attribute ${e}.`)}static clearAllCustomerAttributes(){if(!this.instance.isSDKInitialized)throw new pe;he.getAllCustomerAttributes().forEach((e=>{fi.removeCustomerAttribute(e)})),he.clearAllCustomerAttributes(),ue.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}static invokeStateHandler(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}get isSDKInitialized(){return As.instance.isInitialized}static async updateCustomerDataPlatformId(e){if(!this.instance.isSDKInitialized){const e=new pe;throw this.invokeStateHandler(gi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}if(this.inAnonymousMode()){const e=new ve;throw this.invokeStateHandler(gi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}try{await ys.instance.updateDeviceField("customer_data_platform_id",e),this.invokeStateHandler(gi.CUSTOMER_DATA_PLATFORM_ID_SET,!0)}catch(e){this.invokeStateHandler(gi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e)}}static anonymousModeCapability(){if(!this.instance.isSDKInitialized)return!1;const e=Oe(Ce.ANONYMOUS_MODE_CAPABILITY),t=Oe(Ce.THIRD_PARTY_TRANSACTIONS);return e&&t}static async refetchConfig(){this.instance.isSDKInitialized&&await Promise.all([bs.instance.fetchProducts(),_s.instance.fetchPaywalls().then((e=>gs.instance.fetchCampaignRules(e)))])}}class bi{constructor(){this.emitter=Jr.getInstance()}static{this.instance=new bi}static allPaywalls(){if(!this.instance.sdkInitialized)throw new pe;return zr(Vn([...he.getPaywalls(k)??[],...he.getPaywalls(I)??[]]),"id")}static setProductDetails(e){this.instance.productDetails=e,fi.setProductDetails(e)}static registerSignInHandler(e){return this.instance.emitter.addListener(xs.PAYWALL_SIGNIN_REQUESTED,e),()=>{this.instance.emitter.removeListener(xs.PAYWALL_SIGNIN_REQUESTED,e)}}static registerCloseHandler(e){return this.instance.emitter.addListener(xs.PAYWALL_CLOSE_REQUESTED,e),()=>{this.instance.emitter.removeListener(xs.PAYWALL_CLOSE_REQUESTED,e)}}static registerDeeplinkActionHandler(e){return this.instance.emitter.addListener(xs.PAYWALL_DEEPLINK_ACTION,e),()=>{this.instance.emitter.removeListener(xs.PAYWALL_DEEPLINK_ACTION,e)}}static registerBuySkuHandler(e){return Me()&&ue.debug("This handler will not be invoked because this account's plan includes built-in purchase management. Contact support@namiml.com for details."),this.instance.emitter.addListener(xs.REGISTER_BUY_SKU,e),()=>{this.instance.emitter.removeListener(xs.REGISTER_BUY_SKU,e)}}static registerRestoreHandler(e){return this.instance.emitter.addListener(xs.PAYWALL_RESTORE_REQUESTED,e),()=>{this.instance.emitter.removeListener(xs.PAYWALL_RESTORE_REQUESTED,e)}}static async buySkuComplete(e){if(fi.setPurchaseInProgress(!1),Me())return void ue.debug("This function is not available because this account's plan includes built-in purchase management. Contact support@namiml.com for details.");const t=function(e){return{transaction_identifier:e.orderId,sku_id:e.sku.skuId,sku_UUID:e.sku.id,purchase_source:"campaign",purchase_token:e.purchaseToken,purchase_initiated_timestamp:e.purchaseTime}}(e);if(await(async e=>{if(he.getAnonymousMode())ue.info("Skipping transaction post - anonymous mode");else if(e)try{await Te.instance.postConversion(e)}catch(e){ue.error("Error posting conversion",e)}})(function(e){if(!e)return;const t=he.getSessionId();if(!t)return void ue.warn(b);const n=fi.getProductDetails()?.find((t=>t.product_ref_id===e.sku_id)),r=n?Is(n):[];return{session:t,currency:r[0]?.priceCurrencyCode,amount:r[0]?.formattedPrice,impression:he.getLastImpressionId()??"",original_transaction_id:e?.purchase_token,transaction_id:e?.transaction_identifier,source:e?.purchase_source,sku:e?.sku_id,subscription_interval:r[0]?.billingPeriod,subscription_interval_count:1,purchase_date:new Date(e?.purchase_initiated_timestamp).toUTCString(),app_env:"production",purchase_env:"production"}}(t)),t){if(yi.inAnonymousMode())return void ue.debug("Skipping purchase validation - anonymous mode");try{await Te.instance.purchaseValidation({app_env:"production",payload:t.purchase_token??"",sku:t.sku_UUID})}catch(e){ue.error("Error validating purchase",e)}}}static buySkuCancel(){Oe(Ce.THIRD_PARTY_TRANSACTIONS)?fi.setPurchase(!1):ue.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}get sdkInitialized(){return As.instance.isInitialized}}const _i=globalThis,wi=_i.ShadowRoot&&(void 0===_i.ShadyCSS||_i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vi=Symbol(),Si=new WeakMap;let Ai=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==vi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(wi&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Si.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Si.set(t,e))}return e}toString(){return this.cssText}};const ki=e=>new Ai("string"==typeof e?e:e+"",void 0,vi),xi=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new Ai(n,e,vi)},Ei=(e,t)=>{if(wi)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=_i.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},$i=wi?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return ki(t)})(e):e,{is:Ii,defineProperty:Ci,getOwnPropertyDescriptor:Pi,getOwnPropertyNames:Oi,getOwnPropertySymbols:Mi,getPrototypeOf:Ri}=Object,Li=globalThis,Ti=Li.trustedTypes,Ni=Ti?Ti.emptyScript:"",Di=Li.reactiveElementPolyfillSupport,zi=(e,t)=>e,Fi={toAttribute(e,t){switch(t){case Boolean:e=e?Ni:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Ui=(e,t)=>!Ii(e,t),Bi={attribute:!0,type:String,converter:Fi,reflect:!1,hasChanged:Ui};Symbol.metadata??=Symbol("metadata"),Li.litPropertyMetadata??=new WeakMap;let ji=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Bi){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Ci(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=Pi(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const i=r?.call(this);s.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Bi}static _$Ei(){if(this.hasOwnProperty(zi("elementProperties")))return;const e=Ri(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zi("properties"))){const e=this.properties,t=[...Oi(e),...Mi(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift($i(e))}else void 0!==e&&t.push($i(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ei(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:Fi).toAttribute(t,n.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Fi;this._$Em=r,this[r]=s.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??Ui)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}};ji.elementStyles=[],ji.shadowRootOptions={mode:"open"},ji[zi("elementProperties")]=new Map,ji[zi("finalized")]=new Map,Di?.({ReactiveElement:ji}),(Li.reactiveElementVersions??=[]).push("2.0.4");const Hi=globalThis,Xi=Hi.trustedTypes,Vi=Xi?Xi.createPolicy("lit-html",{createHTML:e=>e}):void 0,Gi="$lit$",Wi=`lit$${Math.random().toFixed(9).slice(2)}$`,Yi="?"+Wi,qi=`<${Yi}>`,Ki=document,Qi=()=>Ki.createComment(""),Zi=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Ji=Array.isArray,eo="[ \t\n\f\r]",to=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,no=/-->/g,ro=/>/g,so=RegExp(`>|${eo}(?:([^\\s"'>=/]+)(${eo}*=${eo}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),io=/'/g,oo=/"/g,ao=/^(?:script|style|textarea|title)$/i,co=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),lo=co(1),uo=co(2),ho=Symbol.for("lit-noChange"),po=Symbol.for("lit-nothing"),fo=new WeakMap,mo=Ki.createTreeWalker(Ki,129);function go(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Vi?Vi.createHTML(t):t}const yo=(e,t)=>{const n=e.length-1,r=[];let s,i=2===t?"<svg>":"",o=to;for(let t=0;t<n;t++){const n=e[t];let a,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),null!==c);)u=o.lastIndex,o===to?"!--"===c[1]?o=no:void 0!==c[1]?o=ro:void 0!==c[2]?(ao.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=so):void 0!==c[3]&&(o=so):o===so?">"===c[0]?(o=s??to,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?so:'"'===c[3]?oo:io):o===oo||o===io?o=so:o===no||o===ro?o=to:(o=so,s=void 0);const h=o===so&&e[t+1].startsWith("/>")?" ":"";i+=o===to?n+qi:l>=0?(r.push(a),n.slice(0,l)+Gi+n.slice(l)+Wi+h):n+Wi+(-2===l?t:h)}return[go(e,i+(e[n]||"<?>")+(2===t?"</svg>":"")),r]};class bo{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let s=0,i=0;const o=e.length-1,a=this.parts,[c,l]=yo(e,t);if(this.el=bo.createElement(c,n),mo.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=mo.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(Gi)){const t=l[i++],n=r.getAttribute(e).split(Wi),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:s,name:o[2],strings:n,ctor:"."===o[1]?Ao:"?"===o[1]?ko:"@"===o[1]?xo:So}),r.removeAttribute(e)}else e.startsWith(Wi)&&(a.push({type:6,index:s}),r.removeAttribute(e));if(ao.test(r.tagName)){const e=r.textContent.split(Wi),t=e.length-1;if(t>0){r.textContent=Xi?Xi.emptyScript:"";for(let n=0;n<t;n++)r.append(e[n],Qi()),mo.nextNode(),a.push({type:2,index:++s});r.append(e[t],Qi())}}}else if(8===r.nodeType)if(r.data===Yi)a.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(Wi,e+1));)a.push({type:7,index:s}),e+=Wi.length-1}s++}}static createElement(e,t){const n=Ki.createElement("template");return n.innerHTML=e,n}}function _o(e,t,n=e,r){if(t===ho)return t;let s=void 0!==r?n._$Co?.[r]:n._$Cl;const i=Zi(t)?void 0:t._$litDirective$;return s?.constructor!==i&&(s?._$AO?.(!1),void 0===i?s=void 0:(s=new i(e),s._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=s:n._$Cl=s),void 0!==s&&(t=_o(e,s._$AS(e,t.values),s,r)),t}class wo{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Ki).importNode(t,!0);mo.currentNode=r;let s=mo.nextNode(),i=0,o=0,a=n[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new vo(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new Eo(s,this,e)),this._$AV.push(t),a=n[++o]}i!==a?.index&&(s=mo.nextNode(),i++)}return mo.currentNode=Ki,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class vo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=po,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=_o(this,e,t),Zi(e)?e===po||null==e||""===e?(this._$AH!==po&&this._$AR(),this._$AH=po):e!==this._$AH&&e!==ho&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>Ji(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==po&&Zi(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ki.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=bo.createElement(go(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new wo(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=fo.get(e.strings);return void 0===t&&fo.set(e.strings,t=new bo(e)),t}k(e){Ji(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const s of e)r===t.length?t.push(n=new vo(this.S(Qi()),this.S(Qi()),this,this.options)):n=t[r],n._$AI(s),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class So{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,s){this.type=1,this._$AH=po,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=po}_$AI(e,t=this,n,r){const s=this.strings;let i=!1;if(void 0===s)e=_o(this,e,t,0),i=!Zi(e)||e!==this._$AH&&e!==ho,i&&(this._$AH=e);else{const r=e;let o,a;for(e=s[0],o=0;o<s.length-1;o++)a=_o(this,r[n+o],t,o),a===ho&&(a=this._$AH[o]),i||=!Zi(a)||a!==this._$AH[o],a===po?e=po:e!==po&&(e+=(a??"")+s[o+1]),this._$AH[o]=a}i&&!r&&this.j(e)}j(e){e===po?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ao extends So{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===po?void 0:e}}class ko extends So{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==po)}}class xo extends So{constructor(e,t,n,r,s){super(e,t,n,r,s),this.type=5}_$AI(e,t=this){if((e=_o(this,e,t,0)??po)===ho)return;const n=this._$AH,r=e===po&&n!==po||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==po&&(n===po||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Eo{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){_o(this,e)}}const $o=Hi.litHtmlPolyfillSupport;$o?.(bo,vo),(Hi.litHtmlVersions??=[]).push("3.1.4");class Io extends ji{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=n?.renderBefore??null;r._$litPart$=s=new vo(t.insertBefore(Qi(),e),e,void 0,n??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ho}}Io._$litElement$=!0,Io.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Io});const Co=globalThis.litElementPolyfillSupport;Co?.({LitElement:Io}),(globalThis.litElementVersions??=[]).push("4.0.6");const Po=xi`
2
2
  :host {
3
3
  -webkit-font-smoothing: antialiased;
4
4
  }
@@ -15,35 +15,33 @@
15
15
  :host p, :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
16
16
  overflow-wrap: break-word;
17
17
  }
18
- `;function Ii(e){if("subscription"===e?.product_type){const t=function(e){if(!e)return null;const t=e.offers.filter((e=>"promo"===e.offer_type));return Oi(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return t?.billingPeriod}return null}function Pi(e){if(!e)return null;return Oi(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period)}function Oi(e,t){return e.map((e=>Mi(e,t)))}function Mi(e,t){if(!e)return null;const n=e.promo_period?.count??t.count,r=e.promo_period?.type??t.type,s=e.promo_price?.price??e.price,i=e.promo_price?.currency??e.currency;return{priceAmountMicros:1e6*s,priceCurrencyCode:i,billingPeriod:`P${n}${r[0].toUpperCase()}`,formattedPrice:Li(i).format(s)}}function Ri(e,t=!1,n=!1,r=!1){if(!e)return null;const s=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?/);if(!s)return null;const[i,o,a]=s.slice(1).map((e=>parseInt(e))),c=(e,t,n,r,s,i)=>r?e.toString():n?1===e||t?s:i:1===e||t?`${e} ${s}`:`${e} ${i}`;switch(e.at(-1)){case"D":return c(a,t,n,r,"day","days");case"W":return c(a/7,t,n,r,"week","weeks");case"M":return c(o,t,n,r,"month","months");case"Y":return c(i,t,n,r,"year","years")}return null}function Li(e){const t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:e})}catch(e){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:"USD"})}}const Ti=(e,t)=>{const n=parseInt(t);return n>=0&&n<e?.length?e[n]:e?.find((e=>e.sku_ref_id===t))},Ni=e=>Di(e.priceAmountMicros)/zi(e.billingPeriod),zi=e=>{let t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t||null},Di=e=>e/1e6;function Ui(e){return parseFloat((Math.round(e)/100).toFixed(2))}const Fi=(e,t,n,r)=>{se.info("TODO: remove default XXX.. values once product details will be fully implemented");const s=bs.instance.getProductDetails(e),i={price:()=>ji(s)??"$XX.XX",name:()=>e,title:()=>s.name,description:()=>s.description,duration:()=>Hi(s)??"XXXXX",durationSingular:()=>Hi(s,!0)??"XXXXX",period:()=>Hi(s,!1,!0)??"XXXXX",periodNumber:()=>Hi(s,!1,!1,!0)??"X",freeTrialDuration:()=>Bi(s)??"XXXXX",freeTrialDurationSingular:()=>Bi(s,!0)??"XXXXX",freeTrialPeriod:()=>Bi(s,!1,!0)??"XXXXX",freeTrialPeriodNumber:()=>Bi(s,!1,!1,!0)??"X",pricePerMonth:()=>Xi(s)??"$XX.XX",pricePerMonthRounded:()=>Xi(s,!0)??"$XX",periodInMonths:()=>Vi(s)??"XXXXX",durationInMonths:()=>Wi(s)??"XXXXX",durationInMonthsSingular:()=>Wi(s,!0)??"XXXXX",periodNumberInMonths:()=>Gi(s)??"X",percentagePriceDifferenceFromSku:()=>qi(s,n,r)??"XX%",priceDifferenceFromSku:()=>Yi(s,n,r)??"$XX.XX",promoEligible:()=>null===Ki(s)&&null!==Qi(s,n),freeTrialEligible:()=>null!==Ki(s),promo:()=>Qi(s,n)?.offer_ref_id??"XXXXX",promoCode:()=>"XXXXX",promoPrice:()=>Zi(s,n)?.formattedPrice??"$XX.XX",promoPeriod:()=>Ji(s,n,!1,!0)??"XXXXX",promoPeriodNumber:()=>Ji(s,n,!1,!1,!0)??"X",promoDuration:()=>Ji(s,n)??"XXXXX",promoDurationSingular:()=>Ji(s,n,!0)??"XXXXX",introEligible:()=>!1,pricePerDay:()=>eo(s)??"$X.XX",pricePerWeek:()=>to(s)??"$X.XX",pricePerWeekRounded:()=>to(s,!0)??"$XX",introductoryPrice:()=>no(s,n)??"$XX.XX",introductoryPeriod:()=>ro(s,n,!1,!0)??"XXXXX",introductoryPeriodNumber:()=>ro(s,n,!1,!1,!0)??"X",introductoryDuration:()=>ro(s,n)??"XXXXX",introductoryDurationSingular:()=>ro(s,n,!0)??"XXXXX",invalid:()=>!1,unavailable:()=>!1}[t];return i?i():null},ji=e=>{if("subscription"===e?.product_type){const t=Pi(e);return t&&t.length?t[0].formattedPrice:null}return null},Hi=(e,t,n,r)=>Ri(function(e){if("subscription"===e?.product_type){const t=Pi(e);if(t.length>0)return t[0].billingPeriod}return null}(e),t,n,r),Bi=(e,t,n,r)=>Ri(Ii(e),t,n,r),Xi=(e,t)=>{const n=Pi(e);if(!n||0===n.length)return null;const r=Ni(n[0]);return r?Li(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Vi=e=>{const t=Pi(e);return"P1Y"===t[0].billingPeriod&&(t[0].billingPeriod="P12M"),t&&t.length?Ri(t[0].billingPeriod):null},Wi=(e,t,n,r)=>{const s=Pi(e);return s&&0!==s.length?("P1Y"===s[0].billingPeriod&&(s[0].billingPeriod="P12M"),Ri(s[0].billingPeriod,t,n,r)):null},Gi=e=>{const t=Pi(e);return t&&t.length?zi(t[0].billingPeriod):null},qi=(e,t,n)=>{const r=Pi(e);if(!r||0===r.length)return null;const s=Ti(n,t)?.product_details||null,i=Pi(s);return((e,t,n,r)=>{if(e&&t&&n&&r){const s=100*(1-e/(n/r*t));return`${Math.round(s)}%`}return null})(Ui(r[0].priceAmountMicros),Gi(e),i?.length>0?Ui(i[0].priceAmountMicros):0,Gi(s))},Yi=(e,t,n)=>{const r=Pi(e);if(!r||0===r.length)return null;const s=Pi(Ti(n,t)?.productDetails||null);return i=Ni(r[0]),o=s?.length>0?Ni(s[0]):null,a=s?.length>0?Li(s[0].priceCurrencyCode):null,i&&o?a.format(i-o):null;var i,o,a},Ki=e=>Ii(e),Qi=(e,t)=>{if(!e)return null;const n=e?.offers.filter((e=>"promo"===e.offer_type));if(!t)return n[0];const r=n[parseInt(t)];return r||(n.find((e=>e.offer_ref_id===t))||null)},Zi=(e,t)=>Mi(Qi(e,t),e?.subscription_period),Ji=(e,t,n,r,s)=>{const i=Zi(e,t);return Ri(i?.billingPeriod,n,r,s)},eo=(e,t)=>{const n=Pi(e);if(!n&&0===n.length)return null;const r=Di(n[0].priceAmountMicros)/(e=>{const t=zi(e);return t?30.437*t:null})(n[0].billingPeriod);return r?Li(n[0].priceCurrencyCode).format(r):null},to=(e,t)=>{const n=Pi(e);if(!n&&0===n.length)return null;const r=Di(n[0].priceAmountMicros)/(e=>{const t=zi(e);return t?52*t/12:null})(n[0].billingPeriod);return r?Li(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},no=(e,t)=>{const n=so(e,t);return n?.formattedPrice||null},ro=(e,t,n,r,s)=>{const i=so(e,t);return Ri(i?.billingPeriod,n,r,s)},so=(e,t)=>{if(!e)return null;let n=null;return t||(n=e?.offers[0]),n=e?.offers[parseInt(t)],n||(n=e?.offers.find((e=>e.offer_ref_id===t))||null),Mi(n,e.subscription_period)};function io(e,t,n){const r=t?.flatMap((e=>e.products)).find((t=>t.id===e.selectedProducts[e.currentGroupId]));return oo(r,n)}function oo(e,t){if(!e)return{};const n=e.variables;return Object.keys(n).forEach((r=>{var s;"string"==typeof n[r]&&n[r].includes("${")&&(n[r]=(s=n[r]).replace(Z,((n,r)=>{const i=Z.exec(s)?.slice(1)||[];r=i[0]??r;const o=i[1]?.replace(":","")??"";return Fi(e.name,r,o,t)})))})),e.entitlements=e.entitlements?.map((e=>e?.entitlement_ref_id)),{...e,...n}}function ao(e,t){return lo(e,t)?.some((()=>1==Fi("","freeTrialEligible")))??!1}function co(e,t){return!ao(e,t)&&(lo(e,t)?.some((()=>1==Fi("","promoEligible")))??!1)}function lo(e,t){const n=e?.filter((e=>t?.some((t=>t===e.ref)))),r=n?.filter((t=>e.find((e=>e.products?.some((e=>e.id===t.id))))))?.map((e=>e.products))[0];return r}const uo={paywallId:"",livePaywalls:[],selectedPaywall:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},currentPage:"page1",currentGroupId:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{}},sku:{},orientation:"portrait",focusedState:!1,platformId:null,mediaList:{},skuItems:[],customer:{},hasNotch:!1};const ho=new class{constructor(){this.host=null,this.state=uo,this.subscribers=new Set}subscribe(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}unsubscribe(e){this.subscribers.delete(e)}hostConnected(){}hostDisconnected(){this.subscribers.forEach((e=>this.unsubscribe(e)))}setState(e){this.state=e,this.subscribers.forEach((e=>e())),this.host&&this.host.requestUpdate()}setCurrentGroupId(e){this.setState({...this.state,currentGroupId:e})}currentGroupId(){return this.state.currentGroupId}setSelectedProdcuts(e){this.setState({...this.state,selectedProducts:e})}selectedProducts(){return this.state.selectedProducts}setPaywall(e){const t=e.template.initialState.groups?.map((e=>e.ref))||[],n=function(e,t){const n=e?.find((e=>t===e.id))?.products||[];return n.map((e=>{e.product_details=bs.instance.getProductDetails(e.name)})),n.forEach((e=>{oo(e,n)})),n||[]}(e.sku_menus,e.template.initialState.currentGroupId),r={...this.state,...e.template.initialState,anySkuHasTrialOffer:ao(e.sku_menus,t),anySkuHasPromoOffer:co(e.sku_menus,t),paywallId:e.id,selectedPaywall:e,launch:{...this.state.launch,productGroups:t},sku:io(e.template.initialState,e.sku_menus,n),skuItems:n};this.setState(r)}paywallId(){return this.state.paywallId}setCustomerAttribute(e){this.setState({...this.state,customer:{...this.state.customer,...e}})}removeCustomerAttribute(e){delete this.state.customer[e],this.setState(this.state)}setIsLoggedIn(e){this.setState({...this.state,isLoggedIn:e})}setMediaList(e){this.setState({...this.state,mediaList:e.reduce(((e,t)=>({...e,[t.name]:t})))})}setSafeAreaTop(e){this.setState({...this.state,safeAreaTop:e})}setFullScreenPresentation(e){this.setState({...this.state,fullScreenPresentation:e})}};class po{constructor(e){this.host=e,this.state=ho.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),ho.subscribe(this.handleStateChange)}handleStateChange(){this.state=ho.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){ho.unsubscribe(this.handleStateChange)}}const fo=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},go={attribute:!0,type:String,converter:Ds,reflect:!1,hasChanged:Us},mo=(e=go,t,n)=>{const{kind:r,metadata:s}=n;let i=globalThis.litPropertyMetadata.get(s);if(void 0===i&&globalThis.litPropertyMetadata.set(s,i=new Map),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const s=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,s,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const s=this[r];t.call(this,n),this.requestUpdate(r,s,e)}}throw Error("Unsupported decorator location: "+r)};function bo(e){return(t,n)=>"object"==typeof n?mo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class yo extends $i{constructor(){super(),this.contextConsumer=new po(this)}styles(){return Ss``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xs(e,[Ci,this.styles()]),e}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}ve([bo({type:Object})],yo.prototype,"contextConsumer",void 0);const _o=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};let wo=class extends yo{styles(){return Ss`
18
+ `;class Oo{constructor(e){this.host=e,this.state=fi.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),fi.subscribe(this.handleStateChange)}handleStateChange(){this.state=fi.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){fi.unsubscribe(this.handleStateChange)}}const Mo=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ro={attribute:!0,type:String,converter:Fi,reflect:!1,hasChanged:Ui},Lo=(e=Ro,t,n)=>{const{kind:r,metadata:s}=n;let i=globalThis.litPropertyMetadata.get(s);if(void 0===i&&globalThis.litPropertyMetadata.set(s,i=new Map),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const s=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,s,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const s=this[r];t.call(this,n),this.requestUpdate(r,s,e)}}throw Error("Unsupported decorator location: "+r)};function To(e){return(t,n)=>"object"==typeof n?Lo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class No extends Io{constructor(){super(),this.contextConsumer=new Oo(this)}styles(){return xi``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ei(e,[Po,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&Ei(this.shadowRoot,[Po,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}$e([To({type:Object})],No.prototype,"contextConsumer",void 0);const Do=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};let zo=class extends No{constructor(e,t,n,r,s){super(),fi.setPaywall(e,s),fi.setFormFactor(t),this.formFactor=t,this.paywall=e,this.paywallEvent=n,r&&(this.campaign=r)}firstUpdated(){fi.setTimeSpentOnPaywall(Date.now()),(async e=>{if(he.getAnonymousMode())return void ue.info("Skipping paywall impression - anonymous mode");const t=he.getSessionId();t&&(e.session=t),e.app_env="production",ue.info("Post paywall impression - segment ",e.segment);try{await Te.instance.postImpression(e)}catch(e){ue.error("Error posting impression",e)}})({segment:this.campaign.segment,call_to_action:this.paywall.id}),Jr.getInstance().emit(re,{action:e.NamiPaywallAction.SHOW_PAYWALL,...this.paywallEvent})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template.pages.find((t=>t.name===e))||{}}styles(){return xi`
19
19
  :host {
20
20
  box-sizing: border-box;
21
21
  width: 100%;
22
22
  position: relative;
23
- }
24
- `}constructor(e,t){super(),ho.setPaywall(e),this.formFactor=t}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t.template.pages.find((t=>t.name===e))}render(){const e=this.getTemplate(),{backgroundContainer:t,header:n=[],footer:r=[],contentContainer:s}=e;return function(e){const t=Object.values(e).map((({id:e,family:t,style:n,file:r})=>("production"===c&&(r=r.replace(ee,te)),{id:e,family:t,style:n,file:r})));_o(t)}(this.contextConsumer.state.selectedPaywall.fonts),ci`
25
- <nami-background-container
26
- .component=${t}
27
- .device=${this.formFactor}>
28
- </nami-background-container>
23
+ display: inline-block;
24
+ }`}render(){const{state:e}=this.contextConsumer,t=this.getTemplate(),{backgroundContainer:n,header:r=[],footer:s=[],contentContainer:i}=t;e.selectedPaywall&&"undefined"!=typeof document&&function(e){const t=Object.values(e).map((({id:e,family:t,style:n,file:r})=>("production"===c&&(r=r.replace(oe,ae)),{id:e,family:t,style:n,file:r})));Do(t)}(e.selectedPaywall.fonts);const o=e.fullScreenPresentation;return lo`
25
+ <nami-background-container
26
+ .component=${n}
27
+ ></nami-background-container>
29
28
  <nami-header
30
- .components=${n}
31
- .inFullScreen=${this.contextConsumer.state.fullScreenPresentation}
32
- .device=${this.formFactor}>
33
- </nami-header>
29
+ .components=${r}
30
+ .inFullScreen=${o}
31
+ ></nami-header>
34
32
  <nami-content-container
35
- .component=${s}
33
+ .component=${i}
36
34
  .device=${this.formFactor}>
37
35
  </nami-content-container>
38
36
  <nami-footer
39
- .components=${r}>
37
+ .components=${s}>
40
38
  </nami-footer>
41
- `}};wo=ve([fo("nami-paywall")],wo);class vo{constructor(){this.emitter=Wr.getInstance()}static{this.instance=new vo}static allCampaigns(){if(!this.instance.sdkInitialized)throw new ae;return Pr(zn([...ie.getCampaignRules(A)??[],...ie.getCampaignRules($)??[]]),"rule")}static isCampaignAvailable(e){if(!this.instance.sdkInitialized)throw new ae;let t,n;"string"==typeof e?(t="label",n=e):e instanceof URL?(t="url",n=e.href):(t=e.type??"label",n=e.value);let r=zn(this.allCampaigns().filter((e=>e.type===t&&e.value===n)));return r=r.flatMap((e=>{const t=bs.allPaywalls().find((t=>t.id===e.paywall));return t?[e]:[]})),r.length>0}static async refresh(){if(!this.instance.sdkInitialized)throw new ae;const e=await Kr.instance.fetchPaywalls();return await Gr.instance.fetchCampaignRules(e),this.allCampaigns()}static registerAvailableCampaignsHandler(e){return this.instance.emitter.addListener(K,e),()=>{this.instance.emitter.removeListener(K,e)}}static launch(e,t){let n,r;if("string"==typeof e?(r=e,n="label"):e instanceof URL?(r=e.href,n="url"):(({type:n,value:r}=e),n||="label"),!this.instance.sdkInitialized)throw new ae;const s=zn(this.allCampaigns().filter((e=>e.type==n&&e.value==r))),i=bs.allPaywalls().find((e=>s.find((t=>t.paywall===e.id))));if(!i)throw new he;const o=new wo(i,Gr.instance.currentFormFactor);if(t){const e=s.find((e=>e.paywall===i.id));this.instance.emitter.addListener(Q,(({action:n,sku:r})=>{t({action:n,campaignId:e.rule,campaignName:e.name,paywallId:i.id,paywallName:i.name,sku:r})}))}return o}get sdkInitialized(){return fs.instance.isInitialized}}class Ao{static{this.instance=new Ao}constructor(){this.load()}setExternalId(e){return this.externalId=e,this}getExternalId(){return this.externalId}isLoggedIn(){return!!this.externalId}save(){return this.externalId?ie.setNamiProfile({externalId:this.externalId}):ie.removeNamiProfile(),this}load(){const e=ie.getNamiProfile();e&&(this.externalId=e.externalId)}async login(e){const t=await Ee.instance.login(e);t.external_id&&ho.setIsLoggedIn(!0),this.setExternalId(t.external_id).save()}async logout(){await Ee.instance.logout(),ho.setIsLoggedIn(!1),this.setExternalId(void 0).save()}}var ko;!function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(ko||(ko={}));class So{constructor(){this.emitter=Wr.getInstance()}static{this.instance=new So}static isLoggedIn(){return Ao.instance.isLoggedIn()}static loggedInId(){return this.instance.isSDKInitialized||se.debug(d),Ao.instance.getExternalId()}static async login(e){if(!this.instance.isSDKInitialized){const e=new ae;throw this.invokeStateHandler(ko.LOGIN,!1,e),e}if(this.inAnonymousMode()){const e=new fe;throw this.invokeStateHandler(ko.LOGIN,!1,e),e}try{await Ao.instance.login(e),this.invokeStateHandler(ko.LOGIN,!0)}catch(e){throw this.invokeStateHandler(ko.LOGIN,!1,e),e}}static async logout(){if(!this.instance.isSDKInitialized){const e=new ae;throw this.invokeStateHandler(ko.LOGOUT,!1,e),e}if(this.inAnonymousMode()){const e=new fe;throw this.invokeStateHandler(ko.LOGOUT,!1,e),e}try{await Ao.instance.logout(),this.invokeStateHandler(ko.LOGOUT,!0)}catch(e){throw this.invokeStateHandler(ko.LOGOUT,!1,e),e}}static async setCustomerDataPlatformId(e){await this.updateCustomerDataPlatformId(e)}static async clearCustomerDataPlatformId(){await this.updateCustomerDataPlatformId(null)}static registerAccountStateHandler(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}static async setAnonymousMode(e){const t=e?ko.ANONYMOUS_MODE_ON:ko.ANONYMOUS_MODE_OFF;if(!this.instance.isSDKInitialized){const e=new ae;throw this.invokeStateHandler(t,!1,e),e}if(this.anonymousModeCapability())if(this.inAnonymousMode()!==e)if(e)ie.setAnonymousMode(e),ie.resetDevice(),this.refetchConfig(),this.invokeStateHandler(ko.ANONYMOUS_MODE_ON,!0);else{ie.clearAnonymousMode();const e=ie.getNamiConfig()?.namiCommands;await qr.instance.createOrUpdateDevice(ds(e)),this.refetchConfig(),this.invokeStateHandler(ko.ANONYMOUS_MODE_OFF,!0)}else{const n=e?new de:new pe;this.invokeStateHandler(t,!1,n)}else se.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details.")}static inAnonymousMode(){return!!this.instance.isSDKInitialized&&ie.getAnonymousMode()}static setCustomerAttribute(e,t){if(!this.instance.isSDKInitialized)throw new ae;ie.setCustomerAttribute(e,t),Se(Nr.PAYWALL_PERSONALIZATION)?(ho.setCustomerAttribute({[e]:t}),se.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):se.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`)}static getCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new ae;const t=ie.getCustomerAttribute(e);return null!=t?Se(Nr.PAYWALL_PERSONALIZATION)?se.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):se.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):se.warn(`No ${e} customer attribute found.`),t}static clearCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new ae;ie.clearCustomerAttribute(e)?(ho.removeCustomerAttribute(e),se.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):se.warn(`No value to clear for attribute ${e}.`)}static clearAllCustomerAttributes(){if(!this.instance.isSDKInitialized)throw new ae;ie.getAllCustomerAttributes().forEach((e=>{ho.removeCustomerAttribute(e)})),ie.clearAllCustomerAttributes(),se.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}static invokeStateHandler(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}get isSDKInitialized(){return fs.instance.isInitialized}static async updateCustomerDataPlatformId(e){if(!this.instance.isSDKInitialized){const e=new ae;throw this.invokeStateHandler(ko.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}if(this.inAnonymousMode()){const e=new ge;throw this.invokeStateHandler(ko.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}try{await qr.instance.updateDeviceField("customer_data_platform_id",e),this.invokeStateHandler(ko.CUSTOMER_DATA_PLATFORM_ID_SET,!0)}catch(e){this.invokeStateHandler(ko.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e)}}static anonymousModeCapability(){if(!this.instance.isSDKInitialized)return!1;const e=Se(Nr.ANONYMOUS_MODE_CAPABILITY),t=Se(Nr.THIRD_PARTY_TRANSACTIONS);return e&&t}static async refetchConfig(){this.instance.isSDKInitialized&&await Promise.all([Yr.instance.fetchProducts(),Kr.instance.fetchPaywalls().then((e=>Gr.instance.fetchCampaignRules(e)))])}}function xo(e,t){return Array.isArray(e)?e.reduce(((e,n)=>{const r=xo(n,t);return Array.isArray(r)?[...e,...r]:[...e,r]}),[]):null==e?e:"object"==typeof e?Object.entries(e).reduce(((e,[n,r])=>{const s="newRow"===n?r:xo(r,t);return{...e,[n]:s}}),{}):"string"==typeof e?Po(e,t):e}function $o(e){return e.assertions?e.assertions.every(Co):!!e.orAssertions&&(!e.orAssertions.length||e.orAssertions.some(Co))}function Eo(e,t){const n=ho.state,r={state:n,launch:n.launch,sku:n.sku,customer:n.customer};return"string"==typeof e&&e.startsWith("${")&&(e=Po(e,r)),e}function Co({value:e,expected:t,operator:n}){const r=/\${[A-Za-z.]+}/g;return e=Eo(e),t=Eo(t),"equals"===n?e===t:"notEquals"===n?e!==t:"contains"===n?(Array.isArray(e)||"string"==typeof e||e instanceof String||(e=e.toString()),e.includes(t)):"notContains"===n?(Array.isArray(e)||"string"==typeof e||e instanceof String||(e=e.toString()),!e.includes(t)):"set"===n?!!e&&!e.toString().match(r):"notSet"===n&&(!e||e.toString().match(r))}function Io(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce(((e,[n,{content:r}])=>(t&&"string"!=typeof r&&r&&(r=URL.createObjectURL(r)),{...e,[n]:r})),{})}function Po(e,t){let n=e;if("string"!=typeof e)return n;for(const[s,i]of Array.from(e.matchAll(J))){const o=Po(i,t);if(s===e)return r(s,o);o!==i&&(n=n.replace(i,o)),n=n.replace(J,r)}return n;function r(e,n){const r=function(e,...t){let n=e;for(const e of t){if(null==n)return;n=Array.isArray(n)?n[+e]:n[e]}return n}(t,...n.split("."));return void 0===r?e:"string"!=typeof r?r:Po(r,t)}}const Oo={};function Mo(e,t){Oo[e]=t}function Ro(e){if("condition"===e.component){if(!$o(e))return null;const t=e.components?.map((e=>Ro(e)));return t}return e.conditionAttributes&&(e=function({conditionAttributes:e,...t}){return e?e.reduce(((e,t)=>$o(t)?(Object.entries(t.attributes).forEach((([e,n])=>{t.attributes[e]=Eo(n)})),{...e,...t.attributes}):e),t):t}(e)),Object.keys(e).forEach((t=>{e[t]=Eo(e[t])})),e?.component in Oo?new Oo[e.component](e):(se.debug("Cannot render component:",e?.component),null)}const Lo={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},To={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},No={top:"start",left:"start",right:"end",bottom:"end",center:"center"};function zo(e){let t;return t="number"==typeof e?`${e}px`:"fitContent"==e?"fit-content":e,`${t} !important`}function Do(e,t){return(n=e.fillColor||"transparent").includes("gradient")?`background-image: ${n};`:`background-color: ${n};`;var n}function Uo({direction:e}){return`flex-direction: ${"vertical"===e?"column":"row"};`}function Fo(e){return`\n padding-right: ${e.rightPadding??0}px;\n padding-left: ${e.leftPadding??0}px;\n padding-top: ${e.topPadding??0}px;\n padding-bottom: ${e.bottomPadding??0}px;\n margin-right: ${e.rightMargin??0}px;\n margin-left: ${e.leftMargin??0}px;\n margin-top: ${e.topMargin??0}px;\n margin-bottom: ${e.bottomMargin??0}px;\n `}function jo({alignment:e}){return`\n justify-content: ${e&&No[e]||"center"};\n `}function Ho(e){return e?"\n text-decoration: line-through;\n text-decoration-thickness: auto;\n ":""}function Bo({fontName:e}){const[t]=(e||"").split("-");return`font-family: '${e}', '${t}', 'Helvetica';`}function Xo(e,t){return`\n transition: all 0.3s;\n ${function({grow:e}){return e?"flex-grow: 1;":""}(e)}\n ${Fo(e)}\n ${function({moveX:e=0,moveY:t=0}){return`\n position: relative;\n left: ${"number"==typeof e?`${e}px`:e};\n transform: translate(\n 0,\n ${"number"==typeof t?`${t}px`:t}\n );\n `}(e)}\n ${function(e,t){const n=t&&e.focusedBorderColor?e.focusedBorderColor:e.borderColor,r=t&&e.focusedBorderRadius?e.focusedBorderRadius:e.borderRadius??0,s=t&&e.focusedRoundBorders?e.focusedRoundBorders:e.roundBorders||null,i=s?s.map((e=>`${Lo[e]}: ${r}px;`)).join("\n"):`border-radius: ${r}px;`,o=t&&e.focusedBorderWidth?e.focusedBorderWidth:e.borderWidth||0,a=t&&e.focusedBorders?e.focusedBorders:e.borders||[];return`\n border-color: ${n?`${n} !important`:"transparent"};\n border-width: ${o}px !important;\n ${a.length?a.map((e=>`${To[e]}: solid;`)).join("\n"):"border-style: solid;"}\n ${i}\n `}(e,t)}\n ${function({alignment:e}){return`\n align-items: ${e&&No[e]||"center"};\n `}(e)}\n ${jo(e)}\n ${function(e){const t=e.width||e.fixedWidth,n=e.height||e.fixedHeight;return`\n max-width: 100%;\n ${void 0!==t?`width: ${zo(t)};`:""}\n ${void 0!==n?`height: ${zo(n)};`:""}\n `}(e)}\n ${function({zIndex:e}){return`z-index: ${e??"initial"};`}(e)}\n ${function(e){if(!e.dropShadow)return"";const t=new RegExp("(-?[0-9]+)\\s(-?[0-9]+)\\s([0-9]+)\\s(rgba?\\([0-9\\s\\/.]+\\))","gi").exec(e.dropShadow);return t&&5===t.length?`\n box-shadow: ${t[1]}px ${t[2]}px\n ${t[3]}px ${t[4]};\n `:""}(e)}\n `}function Vo(e){if(!e)return"";const[t,n]=e.split("-");return`\n align-self: ${t};\n ${n}: 0;\n `}let Wo=class extends yo{constructor(e){super(),this.component=e}styles(){const e=this.component,t=e.height||e.fixedHeight||e.width||e.fixedWidth;return ks(`\n :host {\n display: block;\n ${t?"":"flex-grow: 1;"}\n ${Xo(e)}\n }\n `)}render(){return ci``}};ve([bo({type:Object})],Wo.prototype,"component",void 0),Wo=ve([fo("nami-spacer")],Wo),Mo("spacer",Wo);const{NAMI_CLOSE_PAYWALL:Go="namiClosePaywall",NAMI_RESTORE_PURCHASES:qo="namiRestorePurchases",NAMI_SIGN_IN:Yo="namiSignIn",NAMI_BUY_SKU:Ko="namiBuySKU",SET_STATE:Qo="setState",NAMI_SELECT_SKU:Zo="namiSelectSKU",NAMI_PURCHASE_SELECTED_SKU:Jo="namiPurchaseSelectedSKU",NAMI_DEEP_LINK:ea="namiDeeplink",NAMI_NAVIGATE_TO_SCREEN:ta="namiNavigateToScreen",NAMI_RELOAD_PRODUCTS:na="namiReloadProducts",UNSUPPORTED:ra="",NAMI_PURCHASE_SUCCESS:sa="namiPurchaseSuccess",NAMI_PURCHASE_CANCELLED:ia="namiPurchaseCancelled",NAMI_PURCHASE_FAILED:oa="namiPurchaseFailed",NAMI_PURCHASE_PENDING:aa="namiPurchasePending",NAMI_PURCHASE_UNKNOWN:ca="namiPurchaseUnknown",NAMI_SHOW_PAYWALL:la="namiShowPaywall",NAMI_PAGE_CHANGE:ua="namiPageChange",NAMI_TOGGLE_CHANGE:ha="namiToggleChange",NAMI_SLIDE_CHANGE:da="namiSlideChange"}={},pa=(t,n)=>{let r;switch(t.function){case Go:r=e.NamiPaywallAction.CLOSE_PAYWALL,fa();break;case qo:r=e.NamiPaywallAction.RESTORE_PURCHASES,ga();break;case Yo:r=e.NamiPaywallAction.SIGN_IN,ma();break;case ea:ba(t.parameters?.url);break;case Ko:r=e.NamiPaywallAction.BUY_SKU,ya(t,n);break;case ta:_a(t);break;case Qo:wa();break;case Zo:r=e.NamiPaywallAction.SELECT_SKU,va(n);break;case Jo:r=e.NamiPaywallAction.PURCHASE_SELECTED_SKU,Aa();break;case na:ka()}r&&Wr.getInstance().emit(Q,{action:r,sku:n})},fa=()=>{Sa(gs.PAYWALL_CLOSE_REQUESTED)||!window||window.history.back()},ga=()=>{const e=Se(Nr.THIRD_PARTY_TRANSACTIONS);Sa(gs.PAYWALL_RESTORE_REQUESTED)||e||(se.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior."),se.info("TODO: restore default purchase"))},ma=()=>{Sa(gs.PAYWALL_SIGNIN_REQUESTED)},ba=e=>{null!=e?Sa(gs.PAYWALL_DEEPLINK_ACTION,e)||"undefined"!=typeof window&&window.open(e,"_blank"):se.debug("Paywall deep link action invoked, but no url present.")},ya=(e,t)=>{const n=e.parameters?.promo,r=t;if(n)se.debug(`promo id is not null ${t.id}`),r.promo_id=n.toString(),xa(r);else{se.debug(`promo id is null for ${t.id}, product details: ${t.product_details}`);const e=t.product_details;if("subscription"==e?.product_type){const t=function(e){return"subscription"===e?.product_type?e.offers.find((e=>"promo"===e.offer_type&&0===e.price)):null}(e);if(t)se.debug(`Found a free trial offer ${t.offer_ref_id}`),r.promo_id=t.offer_ref_id.toString();else{const t=e.offers[0];t&&(se.debug(`Found an offer ${t.offer_ref_id}`),r.promo_id=t.offer_ref_id?.toString())}}xa(r)}return r},_a=e=>{const t=e.parameters?.screen;window.history.state?.prevUrl==t?window.history.back():window.location.replace(t)},wa=()=>{const e=bs.allPaywalls().find((e=>e.id===ho.paywallId()));e.template.initialState={...e.template.initialState,currentGroupId:ho.currentGroupId()},ho.setPaywall(e)},va=e=>{const t=ho.currentGroupId(),n=ho.selectedProducts();t&&e.id!=n[t]&&(n[t]=e.id,ho.setSelectedProdcuts(n))},Aa=()=>{se.info("TODO: implement purchase selected SKU")},ka=()=>{se.info("TODO: implement reload products")};function Sa(e,...t){const n=Wr.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}function xa(e){if(Se(Nr.THIRD_PARTY_TRANSACTIONS)){if(Wr.getInstance().listenerCount(gs.REGISTER_BUY_SKU)<=0)return void se.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");se.info(`Handing off purchase for processing by developer skuId=${e.sku_id} promoId=${e.promo_id}`),Sa(gs.REGISTER_BUY_SKU,e)}}let $a=class extends yo{constructor(e){super(),this._handleClick=()=>{pa(this.component.onTap,this.component.sku)},this.component=e,this.addEventListener("click",this._handleClick)}styles(){const e="vertical"===this.component.direction?"margin-top":"margin-left";return ks(`\n :host {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n ${Do(this.component)}\n ${Uo(this.component)}\n ${Xo(this.component)}\n }\n\n :host > :not(:first-child) {\n ${e}: ${this.component.spacing||0}px;\n }\n }\n `)}render(){return function(e){const t={sku:ho.state.sku};return xo(e.components||[],xo(t,t))}(this.component).map((e=>Ro(e)))}};ve([bo({type:Object})],$a.prototype,"component",void 0),$a=ve([fo("nami-button")],$a),Mo("button",$a);let Ea=class extends yo{constructor(){super(...arguments),this.components=[],this.zIndex="2",this.device="desktop"}styles(){return ks(`\n :host {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n z-index: ${parseInt(this.zIndex,10)};\n margin-top: ${"phone"!==this.device||this.inFullScreen?0:40}px;\n }`)}render(){return this.components.map((e=>Ro(e)))}};ve([bo({type:Array})],Ea.prototype,"components",void 0),ve([bo({type:String})],Ea.prototype,"zIndex",void 0),ve([bo({type:String})],Ea.prototype,"device",void 0),ve([bo({type:Boolean})],Ea.prototype,"inFullScreen",void 0),Ea=ve([fo("nami-header")],Ea);let Ca=class extends yo{constructor(){super(...arguments),this.components=[],this.zIndex="3"}styles(){return ks(`\n :host {\n text-align: center !important;\n bottom: 0;\n position: absolute;\n width: 100%;\n z-index: ${this.zIndex};\n transition: all 0.3s;\n }\n `)}render(){return this.components.map((e=>Ro(e)))}};function Ia(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}ve([bo({type:Array})],Ca.prototype,"components",void 0),ve([bo({type:String})],Ca.prototype,"zIndex",void 0),Ca=ve([fo("nami-footer")],Ca);let Pa={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Oa(e){Pa=e}const Ma=/[&<>"']/,Ra=new RegExp(Ma.source,"g"),La=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ta=new RegExp(La.source,"g"),Na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},za=e=>Na[e];function Da(e,t){if(t){if(Ma.test(e))return e.replace(Ra,za)}else if(La.test(e))return e.replace(Ta,za);return e}const Ua=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Fa(e){return e.replace(Ua,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ja=/(^|[^\[])\^/g;function Ha(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(ja,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function Ba(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Xa={exec:()=>null};function Va(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Wa(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function Ga(e,t,n,r){const s=t.href,i=t.title?Da(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:Da(o)}}class qa{options;rules;lexer;constructor(e){this.options=e||Pa}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Wa(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Wa(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=Wa(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="",a="",c=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let h=!1;if(!r&&/^ *$/.test(l)&&(o+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(l))break;if(i.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(h)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(i.test(r))break;if(n.test(r))break;a+="\n"+l}h||l.trim()||(h=!0),o+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(o)&&(c=!0));let d,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(a),p&&(d="[ ] "!==p[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:o,task:!!p,checked:d,loose:!1,text:a,tokens:[]}),s.raw+=o}s.items[s.items.length-1].raw=o.trimEnd(),s.items[s.items.length-1].text=a.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=Va(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of n)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of s)i.rows.push(Va(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Da(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Wa(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Ga(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Ga(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Da(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Da(t[1]),n="mailto:"+e):(e=Da(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Da(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=Da(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Da(t[0]),{type:"text",raw:t[0],text:e}}}}const Ya=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ka=/(?:[*+-]|\d{1,9}[.)])/,Qa=Ha(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ka).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Za=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ja=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ec=Ha(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ja).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tc=Ha(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ka).getRegex(),nc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sc=Ha("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",rc).replace("tag",nc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ic=Ha(Za).replace("hr",Ya).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nc).getRegex(),oc={blockquote:Ha(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ic).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ec,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Ya,html:sc,lheading:Qa,list:tc,newline:/^(?: *(?:\n|$))+/,paragraph:ic,table:Xa,text:/^[^\n]+/},ac=Ha("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ya).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nc).getRegex(),cc={...oc,table:ac,paragraph:Ha(Za).replace("hr",Ya).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ac).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nc).getRegex()},lc={...oc,html:Ha("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",rc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ha(Za).replace("hr",Ya).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Qa).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hc=/^( {2,}|\\)\n(?!\s*$)/,dc="\\p{P}\\p{S}",pc=Ha(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,dc).getRegex(),fc=Ha(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,dc).getRegex(),gc=Ha("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,dc).getRegex(),mc=Ha("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,dc).getRegex(),bc=Ha(/\\([punct])/,"gu").replace(/punct/g,dc).getRegex(),yc=Ha(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_c=Ha(rc).replace("(?:--\x3e|$)","--\x3e").getRegex(),wc=Ha("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_c).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ac=Ha(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",vc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kc=Ha(/^!?\[(label)\]\[(ref)\]/).replace("label",vc).replace("ref",Ja).getRegex(),Sc=Ha(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ja).getRegex(),xc={_backpedal:Xa,anyPunctuation:bc,autolink:yc,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:hc,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Xa,emStrongLDelim:fc,emStrongRDelimAst:gc,emStrongRDelimUnd:mc,escape:uc,link:Ac,nolink:Sc,punctuation:pc,reflink:kc,reflinkSearch:Ha("reflink|nolink(?!\\()","g").replace("reflink",kc).replace("nolink",Sc).getRegex(),tag:wc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Xa},$c={...xc,link:Ha(/^!?\[(label)\]\((.*?)\)/).replace("label",vc).getRegex(),reflink:Ha(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vc).getRegex()},Ec={...xc,escape:Ha(uc).replace("])","~|])").getRegex(),url:Ha(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Cc={...Ec,br:Ha(hc).replace("{2,}","*").getRegex(),text:Ha(Ec.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ic={normal:oc,gfm:cc,pedantic:lc},Pc={normal:xc,gfm:Ec,breaks:Cc,pedantic:$c};class Oc{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pa,this.options.tokenizer=this.options.tokenizer||new qa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Ic.normal,inline:Pc.normal};this.options.pedantic?(t.block=Ic.pedantic,t.inline=Pc.pedantic):this.options.gfm&&(t.block=Ic.gfm,this.options.breaks?t.inline=Pc.breaks:t.inline=Pc.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ic,inline:Pc}}static lex(e,t){return new Oc(t).lex(e)}static lexInline(e,t){return new Oc(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Mc{options;constructor(e){this.options=e||Pa}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+Da(r)+'">'+(n?e:Da(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Da(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=Ba(e);if(null===r)return n;let s='<a href="'+(e=r)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){const r=Ba(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class Rc{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Lc{options;renderer;textRenderer;constructor(e){this.options=e||Pa,this.options.renderer=this.options.renderer||new Mc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Rc}static parse(e,t){return new Lc(t).parse(e)}static parseInline(e,t){return new Lc(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(s.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=s;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Fa(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=s;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=s;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let i="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(r)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=s,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=s,t=e.ordered,r=e.start,i=e.loose;let o="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,s=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);i?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,i),o+=this.renderer.listitem(a,s,!!r)}n+=this.renderer.list(o,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=s,o=i.tokens?this.parseInline(i.tokens):i.text;for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}switch(s.type){case"escape":{const e=s;n+=t.text(e.text);break}case"html":{const e=s;n+=t.html(e.text);break}case"link":{const e=s;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=s;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=s;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=s;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=s;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=s;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=s;n+=t.text(e.text);break}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Tc{options;constructor(e){this.options=e||Pa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Nc=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#t(Oc.lex,Lc.parse);parseInline=this.#t(Oc.lexInline,Lc.parseInline);Parser=Lc;Renderer=Mc;TextRenderer=Rc;Lexer=Oc;Tokenizer=qa;Hooks=Tc;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Mc(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new qa(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Tc;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],i=t[r];Tc.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Oc.lex(e,t??this.defaults)}parser(e,t){return Lc.parse(e,t??this.defaults)}#t(e,t){return(n,r)=>{const s={...r},i={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const o=this.#n(!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let r=e(n,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let s=t(r,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return o(e)}}}#n(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Da(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function zc(e,t){return Nc.parse(e,t)}zc.options=zc.setOptions=function(e){return Nc.setOptions(e),zc.defaults=Nc.defaults,Oa(zc.defaults),zc},zc.getDefaults=Ia,zc.defaults=Pa,zc.use=function(...e){return Nc.use(...e),zc.defaults=Nc.defaults,Oa(zc.defaults),zc},zc.walkTokens=function(e,t){return Nc.walkTokens(e,t)},zc.parseInline=Nc.parseInline,zc.Parser=Lc,zc.parser=Lc.parse,zc.Renderer=Mc,zc.TextRenderer=Rc,zc.Lexer=Oc,zc.lexer=Oc.lex,zc.Tokenizer=qa,zc.Hooks=Tc,zc.parse=zc,zc.options,zc.setOptions,zc.use,zc.walkTokens,zc.parseInline,Lc.parse,Oc.lex;const Dc={CheckCircleFilled:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" />`,CheckCircleOutlined:li`<path d="M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" /><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" />`,CheckOutlined:li`<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />`,InfoCircleFilled:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" />`,InfoCircleOutlined:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" /><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" />`,PlusOutlined:li`<path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" /><path d="M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" />`,PlusCircleFilled:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm192 472c0 4.4-3.6 8-8 8H544v152c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V544H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h152V328c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v152h152c4.4 0 8 3.6 8 8v48z" />`,PlusCircleOutlined:li`<path d="M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" /><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" />`,CloseCircleFilled:li`<path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" />`,CloseCircleOutlined:li`<path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" />`,CloseOutlined:li`<path d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" />`,QuestionCircleFilled:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 00-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z" />`,QuestionCircleOutlined:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" /><path d="M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" />`,QuestionOutlined:li`<path d="M764 280.9c-14-30.6-33.9-58.1-59.3-81.6C653.1 151.4 584.6 125 512 125s-141.1 26.4-192.7 74.2c-25.4 23.6-45.3 51-59.3 81.7-14.6 32-22 65.9-22 100.9v27c0 6.2 5 11.2 11.2 11.2h54c6.2 0 11.2-5 11.2-11.2v-27c0-99.5 88.6-180.4 197.6-180.4s197.6 80.9 197.6 180.4c0 40.8-14.5 79.2-42 111.2-27.2 31.7-65.6 54.4-108.1 64-24.3 5.5-46.2 19.2-61.7 38.8a110.85 110.85 0 00-23.9 68.6v31.4c0 6.2 5 11.2 11.2 11.2h54c6.2 0 11.2-5 11.2-11.2v-31.4c0-15.7 10.9-29.5 26-32.9 58.4-13.2 111.4-44.7 149.3-88.7 19.1-22.3 34-47.1 44.3-74 10.7-27.9 16.1-57.2 16.1-87 0-35-7.4-69-22-100.9zM512 787c-30.9 0-56 25.1-56 56s25.1 56 56 56 56-25.1 56-56-25.1-56-56-56z" />`,BellFilled:li`<path d="M816 768h-24V428c0-141.1-104.3-257.8-240-277.2V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.8C336.3 170.2 232 286.9 232 428v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48z" />`,BellOutlined:li`<path d="M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z" />`,ThunderboltFilled:li`<path d="M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7z" />`,CalendarOutlined:li`<path d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" />`,CloudFilled:li`<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3z" />`,CloudOutlined:li`<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3zm36.3 281a123.07 123.07 0 01-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3A123.3 123.3 0 01140 612c0-28 9.1-54.3 26.2-76.3a125.7 125.7 0 0166.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z" />`,FireFilled:li`<path d="M834.1 469.2A347.49 347.49 0 00751.2 354l-29.1-26.7a8.09 8.09 0 00-13 3.3l-13 37.3c-8.1 23.4-23 47.3-44.1 70.8-1.4 1.5-3 1.9-4.1 2-1.1.1-2.8-.1-4.3-1.5-1.4-1.2-2.1-3-2-4.8 3.7-60.2-14.3-128.1-53.7-202C555.3 171 510 123.1 453.4 89.7l-41.3-24.3c-5.4-3.2-12.3 1-12 7.3l2.2 48c1.5 32.8-2.3 61.8-11.3 85.9-11 29.5-26.8 56.9-47 81.5a295.64 295.64 0 01-47.5 46.1 352.6 352.6 0 00-100.3 121.5A347.75 347.75 0 00160 610c0 47.2 9.3 92.9 27.7 136a349.4 349.4 0 0075.5 110.9c32.4 32 70 57.2 111.9 74.7C418.5 949.8 464.5 959 512 959s93.5-9.2 136.9-27.3A348.6 348.6 0 00760.8 857c32.4-32 57.8-69.4 75.5-110.9a344.2 344.2 0 0027.7-136c0-48.8-10-96.2-29.9-140.9z" />`,FireOutlined:li`<path d="M834.1 469.2A347.49 347.49 0 00751.2 354l-29.1-26.7a8.09 8.09 0 00-13 3.3l-13 37.3c-8.1 23.4-23 47.3-44.1 70.8-1.4 1.5-3 1.9-4.1 2-1.1.1-2.8-.1-4.3-1.5-1.4-1.2-2.1-3-2-4.8 3.7-60.2-14.3-128.1-53.7-202C555.3 171 510 123.1 453.4 89.7l-41.3-24.3c-5.4-3.2-12.3 1-12 7.3l2.2 48c1.5 32.8-2.3 61.8-11.3 85.9-11 29.5-26.8 56.9-47 81.5a295.64 295.64 0 01-47.5 46.1 352.6 352.6 0 00-100.3 121.5A347.75 347.75 0 00160 610c0 47.2 9.3 92.9 27.7 136a349.4 349.4 0 0075.5 110.9c32.4 32 70 57.2 111.9 74.7C418.5 949.8 464.5 959 512 959s93.5-9.2 136.9-27.3A348.6 348.6 0 00760.8 857c32.4-32 57.8-69.4 75.5-110.9a344.2 344.2 0 0027.7-136c0-48.8-10-96.2-29.9-140.9zM713 808.5c-53.7 53.2-125 82.4-201 82.4s-147.3-29.2-201-82.4c-53.5-53.1-83-123.5-83-198.4 0-43.5 9.8-85.2 29.1-124 18.8-37.9 46.8-71.8 80.8-97.9a349.6 349.6 0 0058.6-56.8c25-30.5 44.6-64.5 58.2-101a240 240 0 0012.1-46.5c24.1 22.2 44.3 49 61.2 80.4 33.4 62.6 48.8 118.3 45.8 165.7a74.01 74.01 0 0024.4 59.8 73.36 73.36 0 0053.4 18.8c19.7-1 37.8-9.7 51-24.4 13.3-14.9 24.8-30.1 34.4-45.6 14 17.9 25.7 37.4 35 58.4 15.9 35.8 24 73.9 24 113.1 0 74.9-29.5 145.4-83 198.4z" />`,HeartFilled:li`<path d="M923 283.6a260.04 260.04 0 00-56.9-82.8 264.4 264.4 0 00-84-55.5A265.34 265.34 0 00679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 00-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9z" />`,HeartOutlined:li`<path d="M923 283.6a260.04 260.04 0 00-56.9-82.8 264.4 264.4 0 00-84-55.5A265.34 265.34 0 00679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 00-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9zM512 814.8S156 586.7 156 385.5C156 283.6 240.3 201 344.3 201c73.1 0 136.5 40.8 167.7 100.4C543.2 241.8 606.6 201 679.7 201c104 0 188.3 82.6 188.3 184.5 0 201.2-356 429.3-356 429.3z" />`,BulbFilled:li`<path d="M348 676.1C250 619.4 184 513.4 184 392c0-181.1 146.9-328 328-328s328 146.9 328 328c0 121.4-66 227.4-164 284.1V792c0 17.7-14.3 32-32 32H380c-17.7 0-32-14.3-32-32V676.1zM392 888h240c4.4 0 8 3.6 8 8v32c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32v-32c0-4.4 3.6-8 8-8z" />`,BulbOutlined:li`<path d="M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z" />`,MessageFilled:li`<path d="M924.3 338.4a447.57 447.57 0 00-96.1-143.3 443.09 443.09 0 00-143-96.3A443.91 443.91 0 00512 64h-2c-60.5.3-119 12.3-174.1 35.9a444.08 444.08 0 00-141.7 96.5 445 445 0 00-95 142.8A449.89 449.89 0 0065 514.1c.3 69.4 16.9 138.3 47.9 199.9v152c0 25.4 20.6 46 45.9 46h151.8a447.72 447.72 0 00199.5 48h2.1c59.8 0 117.7-11.6 172.3-34.3A443.2 443.2 0 00827 830.5c41.2-40.9 73.6-88.7 96.3-142 23.5-55.2 35.5-113.9 35.8-174.5.2-60.9-11.6-120-34.8-175.6zM312.4 560c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.4 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48z" />`,MessageOutlined:li`<path d="M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z" />`,SmileFilled:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zM288 421a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm224 272c-85.5 0-155.6-67.3-160-151.6a8 8 0 018-8.4h48.1c4.2 0 7.8 3.2 8.1 7.4C420 589.9 461.5 629 512 629s92.1-39.1 95.8-88.6c.3-4.2 3.9-7.4 8.1-7.4H664a8 8 0 018 8.4C667.6 625.7 597.5 693 512 693zm176-224a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" />`,SmileOutlined:li`<path d="M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z" />`,StarFilled:li`<path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" />`,StarOutlined:li`<path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" />`,StopOutlined:li`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z" />`,LikeFilled:li`<path d="M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 00-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 00471 99.9c-52 0-98 35-111.8 85.1l-85.9 311h-.3v428h472.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM112 528v364c0 17.7 14.3 32 32 32h65V496h-65c-17.7 0-32 14.3-32 32z" />`,LikeOutlined:li`<path d="M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 00-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 00471 99.9c-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81zm636.4-353l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5a44.1 44.1 0 0142.2-32.3c7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z" />`,UnlockOutlined:li`<path d="M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zm-40 376H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z" />`,UnlockFilled:li`<path d="M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0z" />`,CaretDownOutlined:li`<path d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" />`,CaretLeftOutlined:li`<path d="M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z" />`,CaretRightOutlined:li`<path d="M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z" />`,CaretUpOutlined:li`<path d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" />`,DownOutlined:li`<path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" />`,LeftOutlined:li`<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" />`,RightOutlined:li`<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" />`,UpOutlined:li`<path d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" />`};function Uc(e,t=""){const n=e.linkColor||"blue";return ks(`\n ${t} a:link {\n color: ${n};\n text-decoration-line: underline;\n }\n ${t} a:visited {\n color: ${n};\n text-decoration-line: underline;\n }\n ${t} a:hover {\n color: ${n};\n }\n ${t} a:active {\n color: ${n};\n text-decoration-line: underline;\n }\n `)}let Fc=class extends yo{constructor(e){super(),this.component=e}styles(){const{component:e}=this;return"legal"===e.textType?ks(`\n :host {\n display: block;\n overflow-wrap: break-word;\n width: fit-content;\n ${Do(e)}\n color: ${e.fontColor};\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${Bo(e)}\n ${Xo(e)}\n }\n :host p {\n margin: 0;\n }\n ${Uc(e,":host")}\n `):ks(`\n :host {\n display: flex;\n width: fit-content;\n ${function(e){return"fitContent"===e.width?"white-space: nowrap;":"overflow-wrap: anywhere;"}(e)}\n ${Do(e)}\n ${e.fontColor?`color: ${e.fontColor};`:""}\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${Ho("string"!=typeof e.strikethrough&&e.strikethrough)}\n ${Bo(e)}\n ${Xo(e)}\n }\n :host p {\n margin: 0;\n }\n ${ks(Uc(e,":host"))}\n `)}render(){return this.component.text?ci`<div class="content" .innerHTML="${zc.parse(this.component.text)}"></div>`:(this.style.display="none",null)}};ve([bo({type:Object})],Fc.prototype,"component",void 0),Fc=ve([fo("nami-text")],Fc);let jc=class extends yo{constructor(e){super(),this.component=e}styles(){return ks(`\n :host { \n display: flex;\n transition: all 0.3s;\n &:not(:first-child) {\n margin-top: ${this.component.spacing||0}px;\n }\n }\n `)}render(){return ci`<slot></slot>`}};ve([bo({type:Object})],jc.prototype,"component",void 0),jc=ve([fo("nami-text-list-item-wrapper")],jc);let Hc=class extends yo{constructor(e){super(),this.component=e}styles(){return ks(`\n :host { \n display: flex;\n overflow-wrap: anywhere;\n transition: all 0.3s;\n margin-right: ${this.component.rightMargin||this.component.spacing||0}px;\n ${Do(this.component)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n }\n `)}render(){return ci`
42
- <span role="img" aria-label="${this.component.name}" class="anticon anticon-${this.component.name}">
43
- <svg viewBox="64 64 896 896" focusable="false" data-icon="${this.component.name}" width="1em" height="1em" fill="currentColor" aria-hidden="true">
44
- ${e=this.component.name,Dc[e]||Dc.CheckCircleOutlined}
45
- </svg>
46
- </span>`;var e}};ve([bo({type:Object})],Hc.prototype,"component",void 0),Hc=ve([fo("nami-symbol")],Hc);let Bc=class extends yo{constructor(e){super(),this.component=e}styles(){return ks(`\n :host {\n line-height: 1.5715;\n display: grid;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Do(this.component)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n text-align: ${this.component.alignment||"center"};\n ${Ho("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Bo(this.component)}\n ${Xo(this.component)}\n ${Uc(this.component)}\n ${Uo(this.component)}\n ${jo(this.component)}\n }\n :host > :not(:first-child) {\n margin-top: ${this.component.spacing||0}px;\n }\n .anticon {\n text-rendering: optimizelegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: inherit;\n display: inline-block;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -.125em;\n }\n .anticon svg {\n display: inline-block;\n line-height: 1;\n }\n\n :host .bullet-text-wrapper {\n line-height: 1.5715;\n display: inline;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Do(this.component)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n text-align: ${this.component.alignment||"center"};\n ${Ho("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Bo(this.component)}\n }\n :host .bullet-text-wrapper p {\n margin: 0;\n line-height: 1.2em;\n }\n ${Uc(this.component,":host .bullet-text-wrapper")}\n `)}render(){const{fontColor:e,fontSize:t,bulletComponent:n,texts:r,spacing:s}=this.component,i=n?{fontColor:e,fontSize:t,spacing:s,...n}:null;if(!Array.isArray(r))return null;const o=r.map((e=>e?ci`<nami-text-list-item-wrapper .component=${this.component}>
47
- ${i&&ci`<nami-symbol .component=${i}></nami-symbol>`}
48
- <div class="bullet-text-wrapper" .innerHTML="${zc(e)}"></div>
49
- </nami-text-list-item-wrapper>`:null));return ci`${o}`}};ve([bo({type:Object})],Bc.prototype,"component",void 0),Bc=ve([fo("nami-text-list")],Bc),Mo("text",Fc),Mo("text-list",Bc),Mo("symbol",Hc);let Xc=class extends yo{constructor(e){super(),this.component=e}styles(){const e=this.component,t="vertical"===e.direction,n=t?"width":"height",r=t?"margin-top":"margin-left",s=e.fillImage?ks(`\n line-height: 1.5715;\n background-image: url(${e.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):ks(Do(e));return ks(`\n :host {\n display: flex;\n ${s};\n ${Vo(e.position)}\n ${Uo(e)}\n ${Xo(e)}\n }\n :host > * {\n ${n}: 100%;\n }\n :host > :not(:first-child) {\n ${r}: ${e.spacing||0}px;\n }\n `)}render(){return this.component.components.map((e=>Ro(e)))}};ve([bo({type:Object})],Xc.prototype,"component",void 0),Xc=ve([fo("nami-container")],Xc),Mo("container",Xc);let Vc=class extends yo{constructor(e){super(),this.component=e}styles(){const e="vertical"===this.component.direction,t=e?"width":"height",n=e?"margin-top":"margin-left",r=this.component.fillImage?ks(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):ks(Do(this.component));return ks(`\n :host {\n display: flex;\n ${r};\n ${Vo(this.component.position)}\n ${Uo(this.component)}\n ${Xo(this.component)}\n justify-content: center;\n }\n :host > * {\n ${t}: 100%;\n }\n :host > :not(:first-child) {\n ${n}: ${this.component.spacing||0}px;\n }\n `)}_offerState(){const{anySkuHasTrialOffer:e,anySkuHasIntroOffer:t,anySkuHasPromoOffer:n}=ho.state;return{freeTrialEligible:e,introEligible:t,promoEligible:n}}render(){const{skuItems:e,mediaList:t}=ho.state,n=function(e,t,n={},r){const s=t.productBaseComponents||t.components||[],i=t.productFeaturedComponents||s;return e.map((e=>{const t=e.featured?i:s,o={...e,...e.variables,...r,id:e.sku_ref_id};!function(e,t){const n=e=>{for(const r of e)r.sku=t,r.components&&n(r.components)};n(e)}(t,e);const a={sku:o,media:Io(n,{convertToUrl:!0})};return[e.featured,xo(t,xo(a,a))]}),[])}(e,this.component,t,this._offerState());return n.map((([,e])=>e.map((e=>Ro(e)))))}};ve([bo({type:Object})],Vc.prototype,"component",void 0),Vc=ve([fo("nami-product-container")],Vc),Mo("productContainer",Vc);let Wc=class extends yo{constructor(e){super(),this.component=e}styles(){const{url:e,imageCropping:t,alignment:n,height:r,width:s,rightMargin:i,spacing:o}=this.component;return ks(`\n :host {\n box-sizing: border-box;\n position: relative;\n transition: all 0.3s;\n background-image: url(${e});\n background-size: ${"fit"===t?"contain":"cover"};\n background-position: ${n||""} center;\n background-repeat: no-repeat;\n height: ${zo(r??"100%")};\n width: ${zo(s??"100%")};\n margin-right: ${i||o||0}px;\n ${Fo(this.component)}\n }\n `)}render(){return ci``}};ve([bo({type:Object})],Wc.prototype,"component",void 0),Wc=ve([fo("nami-image")],Wc),Mo("image",Wc);let Gc=class extends yo{constructor(){super(...arguments),this.device="desktop",this.zIndex=1,this.fullscreen=!1}styles(){return ks(`\n :host {\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n align-items: center;\n position: absolute;\n width: 100%;\n bottom: -1px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${this.component.zIndex};\n border-radius: ${"phone"===this.device?this.fullscreen?0:30:0}px;\n top: ${"phone"===this.device?this.fullscreen?0:40:0}px;\n ${Do(this.component)}\n transition: all 0.3s;\n ${Fo(this.component)}\n }\n `)}render(){return this.component.components.map((e=>Ro(e)))}};ve([bo({type:Object})],Gc.prototype,"component",void 0),ve([bo({type:String})],Gc.prototype,"device",void 0),ve([bo({type:Number})],Gc.prototype,"zIndex",void 0),ve([bo({type:Boolean})],Gc.prototype,"fullscreen",void 0),Gc=ve([fo("nami-background-container")],Gc);let qc=class extends yo{constructor(){super(...arguments),this.zIndex=2,this.device="desktop",this.inFocusedState=!1}styles(){return ks(`\n :host {\n display: flex;\n ${Uo(this.component)}\n height: 100%;\n ${"phone"!==this.device?"width: 100%":""};\n align-items: center;\n justify-content: start;\n z-index: ${this.zIndex};\n transition: all 0.3s;\n overflow-y: scroll;\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${Fo(this.component)}\n }\n :host > * {\n width: 100%;\n }\n \n :host > *:not(:first-child) {\n ${"vertical"===this.component.direction?`margin-top: ${this.component.spacing||0}px;`:`margin-left: ${this.component.spacing||0}px;`}\n `)}render(){return this.component.components.map((e=>Ro(e)))}};ve([bo({type:Object})],qc.prototype,"component",void 0),ve([bo({type:Number})],qc.prototype,"zIndex",void 0),ve([bo({type:String})],qc.prototype,"device",void 0),ve([bo({type:Boolean})],qc.prototype,"inFocusedState",void 0),qc=ve([fo("nami-content-container")],qc);let Yc=class extends yo{constructor(e){super(),this._handleClick=()=>{pa(this.component.onTap)},this.component=e,this.addEventListener("click",this._handleClick)}styles(){return ks(`\n :host {\n cursor: pointer;\n ${Do(this.component)}\n ${Xo(this.component)}\n }\n `)}render(){return this.component.components.map((e=>Ro(e)))}};ve([bo({type:Object})],Yc.prototype,"component",void 0),Yc=ve([fo("nami-segment-picker")],Yc),Mo("segmentPicker",Yc);let Kc=class extends yo{constructor(e){super(),this.inFocusedState=!1,this._handleClick=()=>{ho.setCurrentGroupId(this.component.id)},this._handleHover=()=>{this.inFocusedState=!0},this.component=e,this.classList.toggle("active",e.id===ho.state.currentGroupId),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover)}getComponentStyles(e){return Object.keys(this.component).filter((t=>t.startsWith(e))).reduce(((t,n)=>(t[this.formatKey(n,e)]=this.component[n],t)),{})}formatKey(e,t){const n=e.replace(t,"");return n.charAt(0).toLowerCase()+n.slice(1)}applyStyles(e){return`\n ${Do(e)}\n ${e.fontColor?`color: ${e.fontColor};`:""}\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n font-family: '${e.fontName}', '${(e.fontName||"").split("-")}', 'Helvetica';\n ${Xo(e,this.inFocusedState)}\n width: 50% !important;\n height: 100% !important;\n `}styles(){const e=this.getComponentStyles("active"),t=this.getComponentStyles("inactive");return ks(`\n :host {\n display: inline-flex;\n cursor: pointer;\n ${this.applyStyles({...t,...this.component})}\n }\n\n :host(.active), :host(:hover) {\n ${this.applyStyles({...e,...this.component})}\n }\n `)}render(){return ci`<span>${this.component.text}</span>`}};ve([bo({type:Object})],Kc.prototype,"component",void 0),ve([bo({type:Boolean})],Kc.prototype,"inFocusedState",void 0),Kc=ve([fo("nami-segment-picker-item")],Kc),Mo("segmentPickerItem",Kc),e.Nami=fs,e.NamiCampaignManager=vo,e.NamiCustomerManager=So,e.NamiPaywallManager=bs}));
39
+ `}};var Fo;zo=$e([Mo("nami-paywall")],zo),function(e){e[e.DEFAULT_CAMPAIGN_NOT_FOUND=0]="DEFAULT_CAMPAIGN_NOT_FOUND",e[e.LABELED_CAMPAIGN_NOT_FOUND=1]="LABELED_CAMPAIGN_NOT_FOUND",e[e.CAMPAIGN_DATA_NOT_FOUND=2]="CAMPAIGN_DATA_NOT_FOUND",e[e.PAYWALL_ALREADY_DISPLAYED=3]="PAYWALL_ALREADY_DISPLAYED",e[e.SDK_NOT_INITIALIZED=4]="SDK_NOT_INITIALIZED",e[e.PAYWALL_COULD_NOT_DISPLAY=5]="PAYWALL_COULD_NOT_DISPLAY",e[e.URL_CAMPAIGN_NOT_FOUND=6]="URL_CAMPAIGN_NOT_FOUND",e[e.PRODUCT_DATA_NOT_FOUND=7]="PRODUCT_DATA_NOT_FOUND",e[e.PRODUCT_GROUPS_NOT_FOUND=8]="PRODUCT_GROUPS_NOT_FOUND"}(Fo||(Fo={}));class Uo{constructor(){this.emitter=Jr.getInstance()}static{this.instance=new Uo}static allCampaigns(){if(!this.instance.sdkInitialized)throw new pe;return zr(Vn([...he.getCampaignRules(A)??[],...he.getCampaignRules($)??[]]),"rule")}static isCampaignAvailable(e){if(!this.instance.sdkInitialized)throw new pe;let t,n;"string"==typeof e?(t="label",n=e):e instanceof URL?(t="url",n=e.href):(t=e.type??"label",n=e.value);let r=Vn(this.allCampaigns().filter((e=>e.type===t&&e.value===n)));return r=r.flatMap((e=>{const t=bi.allPaywalls().find((t=>t.id===e.paywall));return t?[e]:[]})),r.length>0}static async refresh(){if(!this.instance.sdkInitialized)throw new pe;const e=await _s.instance.fetchPaywalls();return await gs.instance.fetchCampaignRules(e),this.allCampaigns()}static registerAvailableCampaignsHandler(e){return this.instance.emitter.addListener(ne,e),()=>{this.instance.emitter.removeListener(ne,e)}}static launch(e,t,n,r,s){let i;r=r??(()=>{});let o="";if(e?(o=e,i=ks.LABEL):t&&(o=t,i=ks.URL),!this.instance.sdkInitialized)throw r(!1,Fo.SDK_NOT_INITIALIZED),new pe;const a=Vn(this.allCampaigns().filter((e=>i?e.type==i&&e.value==o:e.type==ks.DEFAULT))),c=bi.allPaywalls().find((e=>a.find((t=>t.paywall===e.id))));if(!c){let n;throw n=e?Fo.LABELED_CAMPAIGN_NOT_FOUND:t?Fo.URL_CAMPAIGN_NOT_FOUND:Fo.DEFAULT_CAMPAIGN_NOT_FOUND,r(!1,n),new ye}const l=a.find((e=>e.paywall===c.id)),u={campaignId:l?.rule??"",campaignName:l?.name??"",campaignType:l?.type??"",campaignLabel:e?o:"",campaignUrl:t?o:"",paywallId:c.id,paywallName:c.name,segmentId:l?.segment,externalSegmentId:l?.external_segment_id},h=new zo(c,gs.instance.currentFormFactor,u,l,n);return s&&this.instance.emitter.addListener(re,(({action:e,sku:t,timeSpentOnPaywall:n,componentChange:r,purchaseError:i,purchases:o})=>{s({action:e,sku:t,...u,componentChange:r,purchaseError:i,purchases:o,timeSpentOnPaywall:n})})),setTimeout((()=>r(!0)),0),h}get sdkInitialized(){return As.instance.isInitialized}}const Bo={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},jo={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},Ho={top:"start",left:"start",right:"end",bottom:"end",center:"center"};function Xo(e){let t;return t="number"==typeof e?`${e}px`:"fitContent"==e?"fit-content":e,`${t} !important`}function Vo(e){return e.includes("gradient")?`background-image: ${e};`:`background-color: ${e};`}function Go(e,t){return t&&e.focusedFillColor?Vo(e.focusedFillColor):Vo(e.fillColor||"transparent")}function Wo({direction:e}){return`flex-direction: ${"vertical"===e?"column":"row"};`}function Yo(e){return`\n padding-right: ${e.rightPadding??0}px;\n padding-left: ${e.leftPadding??0}px;\n padding-top: ${e.topPadding??0}px;\n padding-bottom: ${e.bottomPadding??0}px;\n margin-right: ${e.rightMargin??0}px;\n margin-left: ${e.leftMargin??0}px;\n margin-top: ${e.topMargin??0}px;\n margin-bottom: ${e.bottomMargin??0}px;\n `}function qo({alignment:e}){return`\n justify-content: ${e&&Ho[e]||"center"};\n `}function Ko(e){return e?"\n text-decoration: line-through;\n text-decoration-thickness: auto;\n ":""}function Qo({fontName:e}){const[t]=(e||"").split("-");return`font-family: '${e}', '${t}', 'Helvetica';`}function Zo(e,t){return`\n transition: all 0.3s;\n ${function({grow:e}){return e?"flex-grow: 1;":""}(e)}\n ${Yo(e)}\n ${function({moveX:e=0,moveY:t=0}){return`\n position: relative;\n left: ${"number"==typeof e?`${e}px`:e};\n transform: translate(\n 0,\n ${"number"==typeof t?`${t}px`:t}\n );\n `}(e)}\n ${function(e,t){const n=t&&e.focusedBorderColor?e.focusedBorderColor:e.borderColor,r=t&&e.focusedBorderRadius?e.focusedBorderRadius:e.borderRadius??0,s=t&&e.focusedRoundBorders?e.focusedRoundBorders:e.roundBorders||null,i=s?s.map((e=>`${Bo[e]}: ${r}px;`)).join("\n"):`border-radius: ${r}px;`,o=t&&e.focusedBorderWidth?e.focusedBorderWidth:e.borderWidth||0,a=t&&e.focusedBorders?e.focusedBorders:e.borders||[];return`\n border-color: ${n?`${n} !important`:"transparent"};\n border-width: ${o}px !important;\n ${a.length?a.map((e=>`${jo[e]}: solid;`)).join("\n"):"border-style: solid;"}\n ${i}\n `}(e,t)}\n ${function({alignment:e}){return`\n align-items: ${e&&Ho[e]||"center"};\n `}(e)}\n ${qo(e)}\n ${function(e){const t=e.width||e.fixedWidth,n=e.height||e.fixedHeight;return`\n max-width: 100%;\n ${void 0!==t?`width: ${Xo(t)};`:""}\n ${void 0!==n?`height: ${Xo(n)};`:""}\n `}(e)}\n ${function({zIndex:e}){return`z-index: ${e??"initial"};`}(e)}\n ${function(e){if(!e.dropShadow)return"";const t=new RegExp("(-?[0-9]+)\\s(-?[0-9]+)\\s([0-9]+)\\s(rgba?\\([0-9\\s\\/.]+\\))","gi").exec(e.dropShadow);return t&&5===t.length?`\n box-shadow: ${t[1]}px ${t[2]}px\n ${t[3]}px ${t[4]};\n `:""}(e)}\n `}function Jo(e){if(!e)return"";const[t,n]=e.split("-");return`\n align-self: ${t};\n ${n}: 0;\n `}let ea=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const e=this.component,t=e.height||e.fixedHeight||e.width||e.fixedWidth;return ki(`\n :host {\n display: block;\n ${t?"":"flex-grow: 1;"}\n ${Zo(e,this.inFocusedState)}\n }\n `)}render(){return lo``}};function ta(e,t){return Array.isArray(e)?e.reduce(((e,n)=>{const r=ta(n,t);return Array.isArray(r)?[...e,...r]:[...e,r]}),[]):null==e?e:"object"==typeof e?Object.entries(e).reduce(((e,[n,r])=>{const s="newRow"===n?r:ta(r,t);return{...e,[n]:s}}),{}):"string"==typeof e?aa(e,t):e}function na(e,t,n={},r){const s=t.productBaseComponents||t.components||[],i=t.productFeaturedComponents||s;return e.map((e=>{const t=e.featured?i:s,o={...e,...e.variables,...r,id:e.sku_ref_id};!function(e,t){const n=e=>{for(const r of e)r.sku=ca(t),r.components&&n(r.components)};n(e)}(t,e);const a={sku:o,media:oa(n,{convertToUrl:!0})};return[e.featured??!1,ta(t,ta(a,a))]}),[])}function ra(e){return e.assertions?e.assertions.every(ia):!!e.orAssertions&&(!e.orAssertions.length||e.orAssertions.some(ia))}function sa(e,t){const n=fi.state,r={state:n,launch:n.launch,sku:n.sku,customer:n.customer};return"string"==typeof e&&e.startsWith("${")&&(e=aa(e,r)),e}function ia({value:e,expected:t,operator:n}){const r=/\${[A-Za-z.]+}/g;return e=sa(e),t=sa(t),"equals"===n?e===t:"notEquals"===n?e!==t:"contains"===n?(Array.isArray(e)||"string"==typeof e||e instanceof String||(e=e.toString()),e.includes(t)):"notContains"===n?(Array.isArray(e)||"string"==typeof e||e instanceof String||(e=e.toString()),!e.includes(t)):"set"===n?!!e&&!e.toString().match(r):"notSet"===n&&(!e||e.toString().match(r))}function oa(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce(((e,[n,{content:r}])=>(t&&"string"!=typeof r&&r&&(r=URL.createObjectURL(r)),{...e,[n]:r})),{})}function aa(e,t){let n=e;if("string"!=typeof e)return n;for(const[s,i]of Array.from(e.matchAll(ie))){const o=aa(i,t);if(s===e)return r(s,o);o!==i&&(n=n.replace(i,o)),n=n.replace(ie,r)}return n;function r(e,n){const r=function(e,...t){let n=e;for(const e of t){if(null==n)return;n=Array.isArray(n)?n[+e]:n[e]}return n}(t,...n.split("."));return void 0===r?e:"string"!=typeof r?r:aa(r,t)}}function ca(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type,entitlements:e.entitlements,productDetails:e.product_details}}$e([To({type:Object})],ea.prototype,"component",void 0),$e([To({type:Boolean})],ea.prototype,"inFocusedState",void 0),ea=$e([Mo("nami-spacer")],ea);function la(e,t){if("condition"===e.component){if(!ra(e))return null;const n=e.components?.map((e=>la(e,t)));return n}return e.conditionAttributes&&(e=function({conditionAttributes:e,...t}){return e?e.reduce(((e,t)=>ra(t)?(Object.entries(t.attributes).forEach((([e,n])=>{t.attributes[e]=sa(n)})),{...e,...t.attributes}):e),t):t}(e)),Object.keys(e).forEach((t=>{e[t]=sa(e[t])})),((e,t)=>{const n=e.component;switch(n){case"spacer":return lo`<nami-spacer .component=${e} .inFocusedState=${t}></nami-spacer>`;case"button":return lo`<nami-button .component=${e} .inFocusedState=${t}></nami-button>`;case"text":return lo`<nami-text .component=${e} .inFocusedState=${t}></nami-text>`;case"text-list":return lo`<nami-text-list .component=${e} .inFocusedState=${t}></nami-text-list>`;case"segmentPicker":return lo`<nami-segment-picker .component=${e} .inFocusedState=${t}></nami-segment-picker>`;case"segmentPickerItem":return lo`<nami-segment-picker-item .component=${e} .inFocusedState=${t}></nami-segment-picker-item>`;case"container":return lo`<nami-container .component=${e} .inFocusedState=${t}></nami-container>`;case"productContainer":return lo`<nami-product-container .component=${e} .inFocusedState=${t}></nami-product-container>`;case"image":return lo`<nami-image .component=${e} .inFocusedState=${t}></nami-image>`;case"symbol":return lo`<nami-symbol .component=${e} .inFocusedState=${t}></nami-symbol>`;default:return ue.debug("Cannot render component:",n),lo``}})(e,t??!1)}const{NAMI_CLOSE_PAYWALL:ua="namiClosePaywall",NAMI_RESTORE_PURCHASES:ha="namiRestorePurchases",NAMI_SIGN_IN:da="namiSignIn",NAMI_BUY_SKU:pa="namiBuySKU",SET_STATE:fa="setState",NAMI_SELECT_SKU:ma="namiSelectSKU",NAMI_PURCHASE_SELECTED_SKU:ga="namiPurchaseSelectedSKU",NAMI_DEEP_LINK:ya="namiDeeplink",NAMI_NAVIGATE_TO_SCREEN:ba="namiNavigateToScreen",NAMI_RELOAD_PRODUCTS:_a="namiReloadProducts",UNSUPPORTED:wa="",NAMI_PURCHASE_SUCCESS:va="namiPurchaseSuccess",NAMI_PURCHASE_CANCELLED:Sa="namiPurchaseCancelled",NAMI_PURCHASE_FAILED:Aa="namiPurchaseFailed",NAMI_PURCHASE_PENDING:ka="namiPurchasePending",NAMI_PURCHASE_UNKNOWN:xa="namiPurchaseUnknown",NAMI_SHOW_PAYWALL:Ea="namiShowPaywall",NAMI_PAGE_CHANGE:$a="namiPageChange",NAMI_TOGGLE_CHANGE:Ia="namiToggleChange",NAMI_SLIDE_CHANGE:Ca="namiSlideChange"}={},Pa=(t,n)=>{let r,s,i=e.NamiPaywallAction.EMPTY;switch(t?.function){case ua:i=e.NamiPaywallAction.CLOSE_PAYWALL,r=Oa(),Ma();break;case ha:i=e.NamiPaywallAction.RESTORE_PURCHASES,Ra();break;case da:i=e.NamiPaywallAction.SIGN_IN,La();break;case ya:Ta(t.parameters?.url);break;case pa:n&&(i=e.NamiPaywallAction.BUY_SKU,n=Na(t,n));break;case ba:s={name:t?.parameters?.screen},Da(t?.parameters?.screen);break;case fa:za();break;case ma:n&&(i=e.NamiPaywallAction.SELECT_SKU,Fa(n));break;case ga:n&&(i=e.NamiPaywallAction.PURCHASE_SELECTED_SKU,Ua(n))}i!==e.NamiPaywallAction.EMPTY&&Jr.getInstance().emit(re,{action:i,sku:n,timeSpentOnPaywall:r,componentChange:s,purchaseError:undefined,purchases:undefined})},Oa=()=>{const e=fi.state.timeSpentOnPaywall;if(e)return Date.now()-e},Ma=()=>{Ba(xs.PAYWALL_CLOSE_REQUESTED)||"undefined"==typeof window||window.history.back()},Ra=()=>{const e=Oe(Ce.THIRD_PARTY_TRANSACTIONS);Ba(xs.PAYWALL_RESTORE_REQUESTED)||e||ue.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},La=()=>{Ba(xs.PAYWALL_SIGNIN_REQUESTED)},Ta=e=>{e?Ba(xs.PAYWALL_DEEPLINK_ACTION,e)||"undefined"!=typeof window&&window.open(e,"_blank"):ue.debug("Paywall deep link action invoked, but no url present.")},Na=(e,t)=>{const n=e.parameters?.promo,r=t;if(n)ue.debug(`promo id is not null ${t?.id}`),r.promoId=n.toString(),ja(r);else{ue.debug(`promo id is null for ${t.id}, product details: ${t.productDetails}`);const e=t.productDetails;if("subscription"==e?.product_type){const t=function(e){if("subscription"===e?.product_type)return e.offers.find((e=>"promo"===e.offer_type&&0===e.price))}(e);if(t&&t.offer_ref_id)ue.debug(`Found a free trial offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id.toString();else{const t=e.offers[0];t&&(ue.debug(`Found an offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id?.toString())}}ja(r)}return r},Da=e=>{e&&(window.history.state?.prevUrl==e?window.history.back():fi.setCurrentPage(e))},za=()=>{const e=bi.allPaywalls().find((e=>e.id===fi.paywallId()));e&&(e.template.initialState={...e.template.initialState,currentGroupId:fi.currentGroupId()},fi.setPaywall(e))},Fa=e=>{const t=fi.currentGroupId(),n=fi.selectedProducts();t&&e.id!=n[t]&&(n[t]=e.id,fi.setSelectedProdcuts(n))},Ua=e=>{fi.setPurchase(!0,e)};function Ba(e,...t){const n=Jr.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}function ja(e){if(Oe(Ce.THIRD_PARTY_TRANSACTIONS)){if(Jr.getInstance().listenerCount(xs.REGISTER_BUY_SKU)<=0)return void ue.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");ue.info(`Handing off purchase for processing by developer skuId=${e.skuId} promoId=${e.promoId}`),Ba(xs.REGISTER_BUY_SKU,e)}}let Ha=class extends No{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{Pa(this.component.onTap,this.component.sku)},this.addEventListener("click",this._handleClick,!1)}styles(){const{component:e,inFocusedState:t}=this,n="vertical"===e.direction?"margin-top":"margin-left",r=e.spacing??0;return ki(`\n :host {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n ${Go(e,t)}\n ${Wo(e)}\n ${Zo(e,t)}\n }\n\n :host > :not(:first-child) {\n ${n}: ${r}px;\n }\n }\n\n .loader {\n display: inline-block;\n width: 20px;\n height: 20px;\n border: 2px solid #fff;\n border-radius: 50%;\n border-top: 2px solid #000;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n `)}render(){if(this.tabIndex=0,this.contextConsumer.state.purchaseInProgress)return lo`<span class="loader"></span>`;return function(e){const t={sku:fi.state.sku};return ta(e.components||[],ta(t,t))}(this.component).map((e=>la(e,this.inFocusedState)))}};$e([To({type:Object})],Ha.prototype,"component",void 0),$e([To({type:Boolean})],Ha.prototype,"inFocusedState",void 0),Ha=$e([Mo("nami-button")],Ha);let Xa=class extends No{constructor(){super(...arguments),this.components=[],this.zIndex="2",this.inFocusedState=!1}styles(){const{formFactor:e}=this.contextConsumer.state,t="phone"!==e||this.inFullScreen?0:40;return ki(`\n :host {\n display: flex;\n position: relative;\n width: 100%;\n align-items: center;\n justify-content: center;\n z-index: ${parseInt(this.zIndex,10)};\n margin-top: ${t}px;\n }`)}render(){return this.components.map((e=>la(e,this.inFocusedState)))}};$e([To({type:Array})],Xa.prototype,"components",void 0),$e([To({type:String})],Xa.prototype,"zIndex",void 0),$e([To({type:Boolean})],Xa.prototype,"inFullScreen",void 0),$e([To({type:Boolean})],Xa.prototype,"inFocusedState",void 0),Xa=$e([Mo("nami-header")],Xa);let Va=class extends No{constructor(){super(...arguments),this.components=[],this.zIndex="3",this.inFocusedState=!1}styles(){return ki(`\n :host {\n text-align: center !important;\n bottom: 0;\n position: absolute;\n width: 100%;\n z-index: ${this.zIndex};\n transition: all 0.3s;\n }\n `)}render(){return(this.components??[]).map((e=>la(e,this.inFocusedState)))}};function Ga(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}$e([To({type:Array})],Va.prototype,"components",void 0),$e([To({type:String})],Va.prototype,"zIndex",void 0),$e([To({type:Boolean})],Va.prototype,"inFocusedState",void 0),Va=$e([Mo("nami-footer")],Va);let Wa={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Ya(e){Wa=e}const qa=/[&<>"']/,Ka=new RegExp(qa.source,"g"),Qa=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Za=new RegExp(Qa.source,"g"),Ja={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ec=e=>Ja[e];function tc(e,t){if(t){if(qa.test(e))return e.replace(Ka,ec)}else if(Qa.test(e))return e.replace(Za,ec);return e}const nc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function rc(e){return e.replace(nc,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const sc=/(^|[^\[])\^/g;function ic(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(sc,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function oc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ac={exec:()=>null};function cc(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function lc(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function uc(e,t,n,r){const s=t.href,i=t.title?tc(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:tc(o)}}class hc{options;rules;lexer;constructor(e){this.options=e||Wa}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:lc(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=lc(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=lc(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="",a="",c=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let h=!1;if(!r&&/^ *$/.test(l)&&(o+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(l))break;if(i.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(h)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(i.test(r))break;if(n.test(r))break;a+="\n"+l}h||l.trim()||(h=!0),o+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(o)&&(c=!0));let d,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(a),p&&(d="[ ] "!==p[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:o,task:!!p,checked:d,loose:!1,text:a,tokens:[]}),s.raw+=o}s.items[s.items.length-1].raw=o.trimEnd(),s.items[s.items.length-1].text=a.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=cc(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of n)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of s)i.rows.push(cc(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tc(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=lc(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),uc(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return uc(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=tc(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=tc(t[1]),n="mailto:"+e):(e=tc(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=tc(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=tc(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:tc(t[0]),{type:"text",raw:t[0],text:e}}}}const dc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pc=/(?:[*+-]|\d{1,9}[.)])/,fc=ic(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,pc).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),mc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,gc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,yc=ic(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",gc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bc=ic(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pc).getRegex(),_c="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",wc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vc=ic("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",wc).replace("tag",_c).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sc=ic(mc).replace("hr",dc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_c).getRegex(),Ac={blockquote:ic(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sc).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:yc,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:dc,html:vc,lheading:fc,list:bc,newline:/^(?: *(?:\n|$))+/,paragraph:Sc,table:ac,text:/^[^\n]+/},kc=ic("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_c).getRegex(),xc={...Ac,table:kc,paragraph:ic(mc).replace("hr",dc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_c).getRegex()},Ec={...Ac,html:ic("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",wc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ac,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ic(mc).replace("hr",dc).replace("heading"," *#{1,6} *[^\n]").replace("lheading",fc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$c=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ic=/^( {2,}|\\)\n(?!\s*$)/,Cc="\\p{P}\\p{S}",Pc=ic(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Cc).getRegex(),Oc=ic(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Cc).getRegex(),Mc=ic("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Cc).getRegex(),Rc=ic("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Cc).getRegex(),Lc=ic(/\\([punct])/,"gu").replace(/punct/g,Cc).getRegex(),Tc=ic(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Nc=ic(wc).replace("(?:--\x3e|$)","--\x3e").getRegex(),Dc=ic("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Nc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fc=ic(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",zc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Uc=ic(/^!?\[(label)\]\[(ref)\]/).replace("label",zc).replace("ref",gc).getRegex(),Bc=ic(/^!?\[(ref)\](?:\[\])?/).replace("ref",gc).getRegex(),jc={_backpedal:ac,anyPunctuation:Lc,autolink:Tc,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Ic,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ac,emStrongLDelim:Oc,emStrongRDelimAst:Mc,emStrongRDelimUnd:Rc,escape:$c,link:Fc,nolink:Bc,punctuation:Pc,reflink:Uc,reflinkSearch:ic("reflink|nolink(?!\\()","g").replace("reflink",Uc).replace("nolink",Bc).getRegex(),tag:Dc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ac},Hc={...jc,link:ic(/^!?\[(label)\]\((.*?)\)/).replace("label",zc).getRegex(),reflink:ic(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zc).getRegex()},Xc={...jc,escape:ic($c).replace("])","~|])").getRegex(),url:ic(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Vc={...Xc,br:ic(Ic).replace("{2,}","*").getRegex(),text:ic(Xc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gc={normal:Ac,gfm:xc,pedantic:Ec},Wc={normal:jc,gfm:Xc,breaks:Vc,pedantic:Hc};class Yc{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Wa,this.options.tokenizer=this.options.tokenizer||new hc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Gc.normal,inline:Wc.normal};this.options.pedantic?(t.block=Gc.pedantic,t.inline=Wc.pedantic):this.options.gfm&&(t.block=Gc.gfm,this.options.breaks?t.inline=Wc.breaks:t.inline=Wc.gfm),this.tokenizer.rules=t}static get rules(){return{block:Gc,inline:Wc}}static lex(e,t){return new Yc(t).lex(e)}static lexInline(e,t){return new Yc(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class qc{options;constructor(e){this.options=e||Wa}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+tc(r)+'">'+(n?e:tc(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:tc(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=oc(e);if(null===r)return n;let s='<a href="'+(e=r)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){const r=oc(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class Kc{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Qc{options;renderer;textRenderer;constructor(e){this.options=e||Wa,this.options.renderer=this.options.renderer||new qc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Kc}static parse(e,t){return new Qc(t).parse(e)}static parseInline(e,t){return new Qc(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(s.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=s;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,rc(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=s;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=s;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let i="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(r)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=s,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=s,t=e.ordered,r=e.start,i=e.loose;let o="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,s=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);i?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,i),o+=this.renderer.listitem(a,s,!!r)}n+=this.renderer.list(o,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=s,o=i.tokens?this.parseInline(i.tokens):i.text;for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}switch(s.type){case"escape":{const e=s;n+=t.text(e.text);break}case"html":{const e=s;n+=t.html(e.text);break}case"link":{const e=s;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=s;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=s;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=s;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=s;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=s;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=s;n+=t.text(e.text);break}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Zc{options;constructor(e){this.options=e||Wa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Jc=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#t(Yc.lex,Qc.parse);parseInline=this.#t(Yc.lexInline,Qc.parseInline);Parser=Qc;Renderer=qc;TextRenderer=Kc;Lexer=Yc;Tokenizer=hc;Hooks=Zc;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new qc(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new hc(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Zc;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],i=t[r];Zc.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Yc.lex(e,t??this.defaults)}parser(e,t){return Qc.parse(e,t??this.defaults)}#t(e,t){return(n,r)=>{const s={...r},i={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const o=this.#n(!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let r=e(n,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let s=t(r,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return o(e)}}}#n(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+tc(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function el(e,t){return Jc.parse(e,t)}el.options=el.setOptions=function(e){return Jc.setOptions(e),el.defaults=Jc.defaults,Ya(el.defaults),el},el.getDefaults=Ga,el.defaults=Wa,el.use=function(...e){return Jc.use(...e),el.defaults=Jc.defaults,Ya(el.defaults),el},el.walkTokens=function(e,t){return Jc.walkTokens(e,t)},el.parseInline=Jc.parseInline,el.Parser=Qc,el.parser=Qc.parse,el.Renderer=qc,el.TextRenderer=Kc,el.Lexer=Yc,el.lexer=Yc.lex,el.Tokenizer=hc,el.Hooks=Zc,el.parse=el,el.options,el.setOptions,el.use,el.walkTokens,el.parseInline,Qc.parse,Yc.lex;const tl={CheckCircleFilled:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" />`,CheckCircleOutlined:uo`<path d="M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" /><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" />`,CheckOutlined:uo`<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />`,InfoCircleFilled:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" />`,InfoCircleOutlined:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" /><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" />`,PlusOutlined:uo`<path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" /><path d="M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" />`,PlusCircleFilled:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm192 472c0 4.4-3.6 8-8 8H544v152c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V544H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h152V328c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v152h152c4.4 0 8 3.6 8 8v48z" />`,PlusCircleOutlined:uo`<path d="M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" /><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" />`,CloseCircleFilled:uo`<path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" />`,CloseCircleOutlined:uo`<path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" />`,CloseOutlined:uo`<path d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" />`,QuestionCircleFilled:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 00-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z" />`,QuestionCircleOutlined:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" /><path d="M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" />`,QuestionOutlined:uo`<path d="M764 280.9c-14-30.6-33.9-58.1-59.3-81.6C653.1 151.4 584.6 125 512 125s-141.1 26.4-192.7 74.2c-25.4 23.6-45.3 51-59.3 81.7-14.6 32-22 65.9-22 100.9v27c0 6.2 5 11.2 11.2 11.2h54c6.2 0 11.2-5 11.2-11.2v-27c0-99.5 88.6-180.4 197.6-180.4s197.6 80.9 197.6 180.4c0 40.8-14.5 79.2-42 111.2-27.2 31.7-65.6 54.4-108.1 64-24.3 5.5-46.2 19.2-61.7 38.8a110.85 110.85 0 00-23.9 68.6v31.4c0 6.2 5 11.2 11.2 11.2h54c6.2 0 11.2-5 11.2-11.2v-31.4c0-15.7 10.9-29.5 26-32.9 58.4-13.2 111.4-44.7 149.3-88.7 19.1-22.3 34-47.1 44.3-74 10.7-27.9 16.1-57.2 16.1-87 0-35-7.4-69-22-100.9zM512 787c-30.9 0-56 25.1-56 56s25.1 56 56 56 56-25.1 56-56-25.1-56-56-56z" />`,BellFilled:uo`<path d="M816 768h-24V428c0-141.1-104.3-257.8-240-277.2V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.8C336.3 170.2 232 286.9 232 428v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48z" />`,BellOutlined:uo`<path d="M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z" />`,ThunderboltFilled:uo`<path d="M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7z" />`,CalendarOutlined:uo`<path d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" />`,CloudFilled:uo`<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3z" />`,CloudOutlined:uo`<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3zm36.3 281a123.07 123.07 0 01-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3A123.3 123.3 0 01140 612c0-28 9.1-54.3 26.2-76.3a125.7 125.7 0 0166.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z" />`,FireFilled:uo`<path d="M834.1 469.2A347.49 347.49 0 00751.2 354l-29.1-26.7a8.09 8.09 0 00-13 3.3l-13 37.3c-8.1 23.4-23 47.3-44.1 70.8-1.4 1.5-3 1.9-4.1 2-1.1.1-2.8-.1-4.3-1.5-1.4-1.2-2.1-3-2-4.8 3.7-60.2-14.3-128.1-53.7-202C555.3 171 510 123.1 453.4 89.7l-41.3-24.3c-5.4-3.2-12.3 1-12 7.3l2.2 48c1.5 32.8-2.3 61.8-11.3 85.9-11 29.5-26.8 56.9-47 81.5a295.64 295.64 0 01-47.5 46.1 352.6 352.6 0 00-100.3 121.5A347.75 347.75 0 00160 610c0 47.2 9.3 92.9 27.7 136a349.4 349.4 0 0075.5 110.9c32.4 32 70 57.2 111.9 74.7C418.5 949.8 464.5 959 512 959s93.5-9.2 136.9-27.3A348.6 348.6 0 00760.8 857c32.4-32 57.8-69.4 75.5-110.9a344.2 344.2 0 0027.7-136c0-48.8-10-96.2-29.9-140.9z" />`,FireOutlined:uo`<path d="M834.1 469.2A347.49 347.49 0 00751.2 354l-29.1-26.7a8.09 8.09 0 00-13 3.3l-13 37.3c-8.1 23.4-23 47.3-44.1 70.8-1.4 1.5-3 1.9-4.1 2-1.1.1-2.8-.1-4.3-1.5-1.4-1.2-2.1-3-2-4.8 3.7-60.2-14.3-128.1-53.7-202C555.3 171 510 123.1 453.4 89.7l-41.3-24.3c-5.4-3.2-12.3 1-12 7.3l2.2 48c1.5 32.8-2.3 61.8-11.3 85.9-11 29.5-26.8 56.9-47 81.5a295.64 295.64 0 01-47.5 46.1 352.6 352.6 0 00-100.3 121.5A347.75 347.75 0 00160 610c0 47.2 9.3 92.9 27.7 136a349.4 349.4 0 0075.5 110.9c32.4 32 70 57.2 111.9 74.7C418.5 949.8 464.5 959 512 959s93.5-9.2 136.9-27.3A348.6 348.6 0 00760.8 857c32.4-32 57.8-69.4 75.5-110.9a344.2 344.2 0 0027.7-136c0-48.8-10-96.2-29.9-140.9zM713 808.5c-53.7 53.2-125 82.4-201 82.4s-147.3-29.2-201-82.4c-53.5-53.1-83-123.5-83-198.4 0-43.5 9.8-85.2 29.1-124 18.8-37.9 46.8-71.8 80.8-97.9a349.6 349.6 0 0058.6-56.8c25-30.5 44.6-64.5 58.2-101a240 240 0 0012.1-46.5c24.1 22.2 44.3 49 61.2 80.4 33.4 62.6 48.8 118.3 45.8 165.7a74.01 74.01 0 0024.4 59.8 73.36 73.36 0 0053.4 18.8c19.7-1 37.8-9.7 51-24.4 13.3-14.9 24.8-30.1 34.4-45.6 14 17.9 25.7 37.4 35 58.4 15.9 35.8 24 73.9 24 113.1 0 74.9-29.5 145.4-83 198.4z" />`,HeartFilled:uo`<path d="M923 283.6a260.04 260.04 0 00-56.9-82.8 264.4 264.4 0 00-84-55.5A265.34 265.34 0 00679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 00-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9z" />`,HeartOutlined:uo`<path d="M923 283.6a260.04 260.04 0 00-56.9-82.8 264.4 264.4 0 00-84-55.5A265.34 265.34 0 00679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 00-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9zM512 814.8S156 586.7 156 385.5C156 283.6 240.3 201 344.3 201c73.1 0 136.5 40.8 167.7 100.4C543.2 241.8 606.6 201 679.7 201c104 0 188.3 82.6 188.3 184.5 0 201.2-356 429.3-356 429.3z" />`,BulbFilled:uo`<path d="M348 676.1C250 619.4 184 513.4 184 392c0-181.1 146.9-328 328-328s328 146.9 328 328c0 121.4-66 227.4-164 284.1V792c0 17.7-14.3 32-32 32H380c-17.7 0-32-14.3-32-32V676.1zM392 888h240c4.4 0 8 3.6 8 8v32c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32v-32c0-4.4 3.6-8 8-8z" />`,BulbOutlined:uo`<path d="M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z" />`,MessageFilled:uo`<path d="M924.3 338.4a447.57 447.57 0 00-96.1-143.3 443.09 443.09 0 00-143-96.3A443.91 443.91 0 00512 64h-2c-60.5.3-119 12.3-174.1 35.9a444.08 444.08 0 00-141.7 96.5 445 445 0 00-95 142.8A449.89 449.89 0 0065 514.1c.3 69.4 16.9 138.3 47.9 199.9v152c0 25.4 20.6 46 45.9 46h151.8a447.72 447.72 0 00199.5 48h2.1c59.8 0 117.7-11.6 172.3-34.3A443.2 443.2 0 00827 830.5c41.2-40.9 73.6-88.7 96.3-142 23.5-55.2 35.5-113.9 35.8-174.5.2-60.9-11.6-120-34.8-175.6zM312.4 560c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.4 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48z" />`,MessageOutlined:uo`<path d="M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z" />`,SmileFilled:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zM288 421a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm224 272c-85.5 0-155.6-67.3-160-151.6a8 8 0 018-8.4h48.1c4.2 0 7.8 3.2 8.1 7.4C420 589.9 461.5 629 512 629s92.1-39.1 95.8-88.6c.3-4.2 3.9-7.4 8.1-7.4H664a8 8 0 018 8.4C667.6 625.7 597.5 693 512 693zm176-224a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" />`,SmileOutlined:uo`<path d="M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z" />`,StarFilled:uo`<path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" />`,StarOutlined:uo`<path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" />`,StopOutlined:uo`<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z" />`,LikeFilled:uo`<path d="M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 00-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 00471 99.9c-52 0-98 35-111.8 85.1l-85.9 311h-.3v428h472.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM112 528v364c0 17.7 14.3 32 32 32h65V496h-65c-17.7 0-32 14.3-32 32z" />`,LikeOutlined:uo`<path d="M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 00-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 00471 99.9c-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81zm636.4-353l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5a44.1 44.1 0 0142.2-32.3c7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z" />`,UnlockOutlined:uo`<path d="M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zm-40 376H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z" />`,UnlockFilled:uo`<path d="M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0z" />`,CaretDownOutlined:uo`<path d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" />`,CaretLeftOutlined:uo`<path d="M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z" />`,CaretRightOutlined:uo`<path d="M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z" />`,CaretUpOutlined:uo`<path d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" />`,DownOutlined:uo`<path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" />`,LeftOutlined:uo`<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" />`,RightOutlined:uo`<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" />`,UpOutlined:uo`<path d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" />`};function nl(e,t=""){const n=e.linkColor||"blue";return ki(`\n ${t} a:link {\n color: ${n};\n text-decoration-line: underline;\n }\n ${t} a:visited {\n color: ${n};\n text-decoration-line: underline;\n }\n ${t} a:hover {\n color: ${n};\n }\n ${t} a:active {\n color: ${n};\n text-decoration-line: underline;\n }\n `)}let rl=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{component:e}=this;return"legal"===e.textType?ki(`\n :host {\n display: block;\n overflow-wrap: break-word;\n width: fit-content;\n ${Go(e,this.inFocusedState)}\n color: ${e.fontColor};\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${Qo(e)}\n ${Zo(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${nl(e,":host")}\n `):ki(`\n :host {\n display: flex;\n width: fit-content;\n ${function(e){return"fitContent"===e.width?"white-space: nowrap;":"overflow-wrap: anywhere;"}(e)}\n ${Go(e,this.inFocusedState)}\n color: ${this.inFocusedState&&e.focusedFontColor?e.focusedFontColor:e.fontColor??""};\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${Ko("string"!=typeof e.strikethrough&&e.strikethrough)}\n ${Qo(e)}\n ${Zo(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${ki(nl(e,":host"))}\n `)}render(){return this.component.text?lo`<div class="content" .innerHTML="${el.parse(this.component.text)}"></div>`:(this.style.display="none",lo``)}};$e([To({type:Object})],rl.prototype,"component",void 0),$e([To({type:Boolean})],rl.prototype,"inFocusedState",void 0),rl=$e([Mo("nami-text")],rl);let sl=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return ki(`\n :host { \n display: flex;\n transition: all 0.3s;\n &:not(:first-child) {\n margin-top: ${this.component.spacing||0}px;\n }\n }\n `)}render(){return lo`<slot></slot>`}};$e([To({type:Object})],sl.prototype,"component",void 0),$e([To({type:Boolean})],sl.prototype,"inFocusedState",void 0),sl=$e([Mo("nami-text-list-item-wrapper")],sl);let il=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return ki(`\n :host { \n display: flex;\n overflow-wrap: anywhere;\n transition: all 0.3s;\n margin-right: ${this.component.rightMargin||this.component.spacing||0}px;\n ${Go(this.component,this.inFocusedState)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n }\n `)}render(){return lo`
40
+ <span role="img" aria-label="${this.component.name}" class="anticon anticon-${this.component.name}">
41
+ <svg viewBox="64 64 896 896" focusable="false" data-icon="${this.component.name}" width="1em" height="1em" fill="currentColor" aria-hidden="true">
42
+ ${e=this.component.name,tl[e]||tl.CheckCircleOutlined}
43
+ </svg>
44
+ </span>`;var e}};$e([To({type:Object})],il.prototype,"component",void 0),$e([To({type:Boolean})],il.prototype,"inFocusedState",void 0),il=$e([Mo("nami-symbol")],il);let ol=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return ki(`\n :host {\n line-height: 1.5715;\n display: grid;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Go(this.component,this.inFocusedState)}\n color: ${this.inFocusedState&&this.component.focusedFontColor?this.component.focusedFontColor:this.component.fontColor??""};\n font-size: ${this.component.fontSize??12}px;\n text-align: ${this.component.alignment||"center"};\n ${Ko("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Qo(this.component)}\n ${Zo(this.component,this.inFocusedState)}\n ${nl(this.component)}\n ${Wo(this.component)}\n ${qo(this.component)}\n }\n :host > :not(:first-child) {\n margin-top: ${this.component.spacing||0}px;\n }\n .anticon {\n text-rendering: optimizelegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: inherit;\n display: inline-block;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -.125em;\n }\n .anticon svg {\n display: inline-block;\n line-height: 1;\n }\n\n :host .bullet-text-wrapper {\n line-height: 1.5715;\n display: inline;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Go(this.component,this.inFocusedState)}\n color: ${this.inFocusedState&&this.component.focusedFontColor?this.component.focusedFontColor:this.component.fontColor??""};\n font-size: ${this.component.fontSize??12}px;\n text-align: ${this.component.alignment||"center"};\n ${Ko("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Qo(this.component)}\n }\n :host .bullet-text-wrapper p {\n margin: 0;\n line-height: 1.2em;\n }\n ${nl(this.component,":host .bullet-text-wrapper")}\n `)}render(){const{fontColor:e,fontSize:t,bulletComponent:n,texts:r,spacing:s}=this.component,i=n?{fontColor:e,fontSize:t,spacing:s,...n}:null;if(!Array.isArray(r))return lo``;const o=r.map((e=>e?lo`<nami-text-list-item-wrapper .component=${this.component}>
45
+ ${i&&lo`<nami-symbol .component=${i}></nami-symbol>`}
46
+ <div class="bullet-text-wrapper" .innerHTML="${el(e)}"></div>
47
+ </nami-text-list-item-wrapper>`:null));return lo`${o}`}};$e([To({type:Object})],ol.prototype,"component",void 0),$e([To({type:Boolean})],ol.prototype,"inFocusedState",void 0),ol=$e([Mo("nami-text-list")],ol);let al=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{component:e,inFocusedState:t}=this,n="vertical"===e.direction,r=n?"width":"height",s=n?"margin-top":"margin-left",i=e.fillImage?ki(`\n line-height: 1.5715;\n background-image: url(${e.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):ki(Go(e,t));return ki(`\n :host {\n display: flex;\n ${i};\n ${Jo(e.position)}\n ${Wo(e)}\n ${Zo(e,t)}\n }\n :host > * {\n ${r}: 100%;\n }\n :host > :not(:first-child) {\n ${s}: ${e.spacing||0}px;\n }\n `)}render(){return(this.component.components??[]).map((e=>la(e)))}};$e([To({type:Object})],al.prototype,"component",void 0),$e([To({type:Boolean})],al.prototype,"inFocusedState",void 0),al=$e([Mo("nami-container")],al);let cl=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const e="vertical"===this.component.direction,t=e?"width":"height",n=e?"margin-top":"margin-left",r=this.component.fillImage?ki(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):ki(Go(this.component,this.inFocusedState));return ki(`\n :host {\n display: flex;\n ${r};\n ${Jo(this.component.position)}\n ${Wo(this.component)}\n ${Zo(this.component,this.inFocusedState)}\n justify-content: center;\n }\n :host > * {\n ${t}: 100%;\n }\n :host > :not(:first-child) {\n ${n}: ${this.component.spacing||0}px;\n }\n `)}_offerState(){const{anySkuHasTrialOffer:e,anySkuHasIntroOffer:t,anySkuHasPromoOffer:n}=fi.state;return{freeTrialEligible:e,introEligible:t,promoEligible:n}}render(){const{skuItems:e,mediaList:t}=fi.state;return na(e,this.component,t,this._offerState()).map((([,e])=>e.map((e=>la(e,this.inFocusedState)))))}};$e([To({type:Object})],cl.prototype,"component",void 0),$e([To({type:Boolean})],cl.prototype,"inFocusedState",void 0),cl=$e([Mo("nami-product-container")],cl);let ll=class extends No{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{url:e,imageCropping:t,alignment:n,height:r,width:s,rightMargin:i,spacing:o}=this.component;return ki(`\n :host {\n box-sizing: border-box;\n position: relative;\n transition: all 0.3s;\n background-image: url(${e});\n background-size: ${"fit"===t?"contain":"cover"};\n background-position: ${n||""} center;\n background-repeat: no-repeat;\n height: ${Xo(r??"100%")};\n width: ${Xo(s??"100%")};\n margin-right: ${i||o||0}px;\n ${Yo(this.component)}\n }\n `)}render(){return lo``}};$e([To({type:Object})],ll.prototype,"component",void 0),$e([To({type:Boolean})],ll.prototype,"inFocusedState",void 0),ll=$e([Mo("nami-image")],ll);let ul=class extends No{constructor(){super(...arguments),this.fullscreen=!1,this.inFocusedState=!1}styles(){const{fullscreen:e,inFocusedState:t,component:n}=this,{formFactor:r}=this.contextConsumer.state,s="phone"===r?e?0:40:0,i="phone"===r?e?0:30:0;return ki(`\n :host {\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n align-items: center;\n position: absolute;\n width: 100%;\n bottom: -1px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${n.zIndex??1};\n border-radius: ${i}px;\n top: ${s}px;\n ${Go(n,t)}\n transition: all 0.3s;\n ${Yo(n)}\n }\n `)}render(){return(this.component.components??[]).map((e=>la(e)))}};$e([To({type:Object})],ul.prototype,"component",void 0),$e([To({type:Boolean})],ul.prototype,"fullscreen",void 0),$e([To({type:Boolean})],ul.prototype,"inFocusedState",void 0),ul=$e([Mo("nami-background-container")],ul);let hl=class extends No{constructor(){super(...arguments),this.zIndex=2,this.inFocusedState=!1}styles(){const{contextConsumer:e,component:t,zIndex:n}=this,{formFactor:r}=e.state,s="phone"!==r?"width: 100%;":"",i=t.spacing??0;return ki(`\n :host {\n display: flex;\n position: relative;\n ${Wo(t)}\n height: 100%;\n ${s}\n align-items: center;\n justify-content: start;\n z-index: ${n};\n transition: all 0.3s;\n overflow-y: scroll;\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${Yo(t)}\n }\n :host > * {\n width: 100%;\n }\n \n :host > *:not(:first-child) {\n ${"vertical"===t.direction?`margin-top: ${i}px;`:`margin-left: ${i}px;`}\n `)}render(){return this.component.components.map((e=>la(e,this.inFocusedState)))}};$e([To({type:Object})],hl.prototype,"component",void 0),$e([To({type:Number})],hl.prototype,"zIndex",void 0),$e([To({type:Boolean})],hl.prototype,"inFocusedState",void 0),hl=$e([Mo("nami-content-container")],hl);let dl=class extends No{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{Pa(this.component.onTap)},this.addEventListener("click",this._handleClick)}styles(){return ki(`\n :host {\n cursor: pointer;\n ${Go(this.component,this.inFocusedState)}\n ${Zo(this.component,this.inFocusedState)}\n }\n `)}render(){return this.component.components.map((e=>la(e,this.inFocusedState)))}};$e([To({type:Object})],dl.prototype,"component",void 0),$e([To({type:Boolean})],dl.prototype,"inFocusedState",void 0),dl=$e([Mo("nami-segment-picker")],dl);let pl=class extends No{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{this.component.id&&fi.setCurrentGroupId(this.component.id)},this._handleHover=()=>{this.inFocusedState=!0},this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover)}getComponentStyles(e){return Object.keys(this.component).filter((t=>t.startsWith(e))).reduce(((t,n)=>(t[this.formatKey(n,e)]=this.component[n],t)),{})}formatKey(e,t){const n=e.replace(t,"");return n.charAt(0).toLowerCase()+n.slice(1)}applyStyles(e){return`\n ${Go(e,this.inFocusedState)}\n ${e.fontColor?`color: ${e.fontColor};`:""}\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n font-family: '${e.fontName}', '${(e.fontName||"").split("-")}', 'Helvetica';\n ${Zo(e,this.inFocusedState)}\n width: 50% !important;\n height: 100% !important;\n `}styles(){const e=this.getComponentStyles("active"),t=this.getComponentStyles("inactive");return ki(`\n :host {\n display: inline-flex;\n cursor: pointer;\n ${this.applyStyles({...t,...this.component})}\n }\n\n :host(.active), :host(:hover) {\n ${this.applyStyles({...e,...this.component})}\n }\n `)}render(){const e=this.component.id===fi.state.currentGroupId;return this.classList.toggle("active",e),lo`<span>${this.component.text}</span>`}};$e([To({type:Object})],pl.prototype,"component",void 0),$e([To({type:Boolean})],pl.prototype,"inFocusedState",void 0),pl=$e([Mo("nami-segment-picker-item")],pl),e.Nami=As,e.NamiCampaignManager=Uo,e.NamiCustomerManager=yi,e.NamiPaywallManager=bi}));