@namiml/web-sdk 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/components/ContextProvider.d.ts +13 -5
- package/dist/components/Paywall.d.ts +10 -7
- package/dist/components/containers/CollapseContainer.d.ts +12 -0
- package/dist/components/containers/ProductContainer.d.ts +2 -0
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +0 -3
- package/dist/components/elements/Video.d.ts +10 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/components/productDetails.d.ts +1 -1
- package/dist/components/utils/actionTap.d.ts +1 -1
- package/dist/components/utils/impression.d.ts +1 -1
- package/dist/components/utils/products.d.ts +2 -1
- package/dist/components/utils/state.d.ts +1 -1
- package/dist/components/utils/styles.d.ts +5 -1
- package/dist/core/withRetry.d.ts +2 -1
- package/dist/nami/api.d.ts +0 -1
- package/dist/nami/campaign.d.ts +11 -20
- package/dist/nami/entitlement.d.ts +29 -0
- package/dist/nami/namiRefs.d.ts +1 -0
- package/dist/nami/paywalls.d.ts +9 -3
- package/dist/nami/purchase.d.ts +5 -0
- package/dist/nami/utils/campaign.d.ts +8 -0
- package/dist/nami/utils/entitlement.d.ts +55 -0
- package/dist/nami/utils/paywall.d.ts +2 -0
- package/dist/nami/utils/purchase.d.ts +4 -3
- package/dist/nami-web.cjs +10 -8
- package/dist/nami-web.d.ts +222 -124
- package/dist/nami-web.js +12 -10
- package/dist/nami-web.mjs +12 -10
- package/dist/nami-web.umd.js +13 -11
- package/dist/repositories/campaignRule.repository.d.ts +3 -3
- package/dist/repositories/entitlement.repository.d.ts +11 -0
- package/dist/services/storage.service.d.ts +12 -5
- package/dist/types/campaign.d.ts +6 -11
- package/dist/types/components/containers.d.ts +8 -4
- package/dist/types/components/elements.d.ts +5 -2
- package/dist/types/components/index.d.ts +7 -3
- package/dist/types/config.d.ts +7 -6
- package/dist/types/entitlements.d.ts +19 -0
- package/dist/types/externals/campaign.d.ts +19 -0
- package/dist/types/externals/config.d.ts +22 -0
- package/dist/types/externals/entitlement.d.ts +11 -0
- package/dist/types/externals/index.d.ts +8 -0
- package/dist/types/externals/languages.d.ts +1 -0
- package/dist/types/externals/paywall.d.ts +73 -0
- package/dist/types/externals/product.d.ts +28 -0
- package/dist/types/externals/purchase.d.ts +18 -0
- package/dist/types/externals/sku.d.ts +17 -0
- package/dist/types/paywall.d.ts +16 -54
- package/dist/types/products.d.ts +0 -28
- package/dist/types/purchase.d.ts +15 -28
- package/dist/types/sku.d.ts +6 -19
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/feature-flags.d.ts +1 -0
- package/dist/utils/helpers.d.ts +1 -0
- package/package.json +6 -3
- package/dist/types/languages.d.ts +0 -1
package/dist/nami-web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as s,svg as i}from"lit";const o=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(){}},a=new WeakMap,c=e=>{let t=a.get(e);return void 0===t&&a.set(e,t=new Map),t},l=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(c(this)).map((([e,t])=>({name:e,value:t})))}get shadowRoot(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}setAttribute(e,t){c(this).set(e,String(t))}removeAttribute(e){c(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 c(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 o(this);return this.__internals=e,e}getAttribute(e){return c(this).get(e)??null}},u=class extends l{};"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=u);const{NAMI_SDK_VERSION:h="3.2.0",PRODUCTION:d="production",DEVELOPMENT:p="development",PLATFORM_ID_REQUIRED:f="Platform ID is required",DEVICE_ID_REQUIRED:m="Device ID is required",EXTERNAL_ID_REQUIRED:g="External ID is required",SDK_NOT_INITIALIZED:y="SDK has not been initialized. Make sure to call Nami.configure() first!",CAMPAIGN_NOT_AVAILABLE:b="Campaign is not available",UNABLE_TO_UPDATE_CDP_ID:_="Unable to update CDP id in anonymous mode",ANONYMOUS_MODE_ALREADY_ON:w="Anonymous mode is already turned on.",ANONYMOUS_MODE_ALREADY_OFF:v="Anonymous mode is already turned off.",ANONYMOUS_MODE_LOGIN_NOT_ALLOWED:S="Login/logout are not available in anonymous mode",SESSION_REQUIRED:k="Session is required",AUTH_DEVICE:A="nami_auth_device",NAMI_CONFIGURATION:x="nami_configuration",NAMI_PROFILE:E="nami_profile",API_CONFIG:I="api_config",API_CAMPAIGN_RULES:C="api_campaign_rules",API_PAYWALLS:P="api_paywalls",API_PRODUCTS:O="api_products",INITIAL_APP_CONFIG:$="initial_app_config",INITIAL_CAMPAIGN_RULES:M="initial_campaign_rules",INITIAL_PAYWALLS:L="initial_paywalls",INITIAL_PRODUCTS:R="initial_products",CUSTOMER_ATTRIBUTES_KEY_PREFIX:T="nami_cmr_attributes_",ANONYMOUS_MODE:N="nami_anonymous_mode",KEY_SESSION_COUNTER:D="nami_session_counter",INITIAL_SESSION_COUNTER_VALUE:z=1,NAMI_LAST_IMPRESSION_ID:F="nami_last_impression_id",NAMI_SESSION_ID:U="nami_session_id",API_VERSION:B="v3",BASE_URL_PATH:j=`sdk/${B}/platform`,BASE_URL:X="https://app.namiml.com",BASE_STAGING_URL:H="https://app-staging.namiml.com",CUSTOM_HOST_PREFIX:V="namiAPIHost=",USE_STAGING_API:G="useStagingAPI",EXTENDED_CLIENT_INFO_PREFIX:Y="extendedClientInfo",EXTENDED_CLIENT_INFO_DELIMITER:W=":",EXTENDED_PLATFORM:q="extended-platform",EXTENDED_PLATFORM_VERSION:K="extended-platform-version",API_MAX_CALLS_LIMIT:Q=2,API_RETRY_DELAY_SEC:Z=2,DEVICE_API_TIMEOUT_LIMIT:J=3e3,STATUS_SUCCESS:ee=200,STATUS_BAD_REQUEST:te=400,STATUS_NOT_FOUND:ne=404,STATUS_INTERNAL_SERVER_ERROR:re=500,INITIAL_SUCCESS:se="Initial success",RECONFIG_SUCCESS:ie="Reconfig success",ALREADY_CONFIGURED:oe="Already configured",AVAILABLE_CAMPAIGNS_CHANGED:ae="AvailableCampaignsChanged",PAYWALL_ACTION_EVENT:ce="PaywallActionEvent",SKU_TEXT_REGEX:le=/\$\{sku\.(\w+)(:\d+)?\}/g,VAR_REGEX:ue=/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g,CORS_PROXY_URL:he="https://hosted-content-staging.namiml.com",CORS_PROXY_URL_LOCAL:de="http://localhost:8001"}={};var pe;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(pe||(pe={}));const fe={debug:pe.DEBUG,info:pe.INFO,warn:pe.WARN,error:pe.ERROR};const me=new class{constructor(){this.setLogger=e=>{this.currentLogLevel=e?fe[e]:pe.WARN}}debug(e,...t){this.shouldLog(pe.DEBUG)&&console.debug(this.formatMessage(pe.DEBUG,e,...t))}info(e,...t){this.shouldLog(pe.INFO)&&console.info(this.formatMessage(pe.INFO,e,...t))}warn(e,...t){this.shouldLog(pe.WARN)&&console.warn(this.formatMessage(pe.WARN,e,...t))}error(e,...t){this.shouldLog(pe.ERROR)&&console.error(this.formatMessage(pe.ERROR,e,...t))}shouldLog(e){return e>=this.currentLogLevel}formatMessage(e,t,...n){const r=pe[e];return`[${(new Date).toISOString()}] [${r}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}};const ge=new class{setDevice(e){this.setItem(A,e)}getDevice(){return this.getItem(A)}resetDevice(){this.resetItem(A)}getAnonymousMode(){return this.getItem(N)||!1}setAnonymousMode(e){this.setItem(N,e)}clearAnonymousMode(){this.resetItem(N)}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(x,e)}getNamiConfig(){return this.getItem(x)}setCustomerAttribute(e,t){this.setItem(T+e,t)}getCustomerAttribute(e){return this.getItem(T+e)}getAllCustomerAttributes(){return Object.keys(localStorage).filter((e=>e.includes(T))).map((e=>e.replace(T,"")))}clearCustomerAttribute(e){const t=T+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}clearAllCustomerAttributes(){Object.keys(localStorage).filter((e=>e.includes(T))).map((e=>this.resetItem(e)))}setNamiProfile(e){this.setItem(E,e)}getNamiProfile(){return this.getItem(E)}removeNamiProfile(){this.resetItem(E)}setSessionCounter(){const e=this.getItem(D),t=e?parseInt(e):z||z;this.setItem(D,t+1)}setLastImpressionId(e){e&&this.setItem(F,e)}getLastImpressionId(){return this.getItem(F)??""}setSessionId(e){e&&this.setItem(U,e)}getSessionId(){return this.getItem(U)}clearSessionId(){this.resetItem(U)}setItem(e,t){try{const n=JSON.stringify(t);localStorage.setItem(e,n)}catch(e){me.error("Error setting item in localStorage:",e)}}getItem(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return me.error("Error getting item from localStorage:",e,": ",t),null}}resetItem(e){try{localStorage.removeItem(e)}catch(e){me.error("Error removing item from localStorage:",e)}}clear(){try{localStorage.clear()}catch(e){me.error("Error clearing localStorage:",e)}}};class ye extends Error{constructor(e,t){super(t),this.statusCode=e,this.status=e,this.message=`RetryLimitExceededError: ${this.message}`}}class be extends Error{constructor(){super(y)}}class _e extends Error{constructor(){super(f)}}class we extends Error{constructor(){super(m)}}class ve extends Error{constructor(){super(g)}}class Se extends Error{constructor(){super(b)}}class ke extends Error{constructor(){super(w)}}class Ae extends Error{constructor(){super(v)}}class xe extends Error{constructor(){super(v)}}class Ee extends Error{constructor(){super(_)}}class Ie extends Error{constructor(e){super(e),this.message=`BadRequestError: ${this.message}`}}class Ce extends Error{constructor(e){super(e),this.message=`NotFoundError: ${this.message}`}}class Pe extends Error{constructor(e,t){super(t),this.statusCode=e,this.message=`ClientError: ${this.message}`}}class Oe extends Error{constructor(e){super(e),this.message=`ServerError: ${this.message}`}}const $e=(e,t)=>{if(e==te)throw new Ie(t);if(e==ne)throw new Ce(t);if(e>te&&e<re)throw new Pe(e,t);if(e>=re)throw new Oe(t)};function Me(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 Le(e,t,n=Q){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+Z);return await new Promise((t=>setTimeout(t,e))),s()}throw new ye(i.status,`Request failed after ${n} retries`)}return i};return(await s()).json()}var Re;"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"}(Re||(Re={}));const Te=e=>{let t;if(e?.includes(G))t=H;else{const n=e?.find((e=>e.includes(V)));t=n?n.split("=")[1]:X}return t=t.replace(/\/$/,""),t+"/"+j},Ne=e=>{const t=ge.getAppConfig(I)||ge.getAppConfig($);return t?.capabilities?.includes(e)||!1},De=e=>!Ne(Re.THIRD_PARTY_TRANSACTIONS);function ze(e,t,n){const r=n.value;return n.value=function(...e){if(!this.platformID)throw new _e;return r.apply(this,e)},n}function Fe(e,t,n){const r=n.value;return n.value=function(...e){const t=ge.getDevice();if(!t?.id)throw new we;return r.apply(this,e)},n}class Ue{static{this.instance=new Ue}get deviceID(){return ge.getDevice()?.id}static configure(e){this.instance.configure(e)}configure(e){this.baseURL=Te(e.namiCommands),this.platformID=e.appPlatformId}async login(e){if(!e)throw new ve;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"});ge.setSessionCounter(),n.id&&ge.setSessionId(n.id)}async postImpression(e){const t=`device/${this.deviceID}/impression/`,n=await this.requestBodyAPI(t,e,"POST",!0);n.id&&ge.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 Le(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 Le(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()}}Me([Fe],Ue.prototype,"login",null),Me([Fe],Ue.prototype,"logout",null),Me([Fe],Ue.prototype,"startSession",null),Me([Fe],Ue.prototype,"postImpression",null),Me([Fe],Ue.prototype,"postConversion",null),Me([Fe],Ue.prototype,"purchaseValidation",null),Me([ze],Ue.prototype,"fetchAPI",null),Me([ze],Ue.prototype,"requestBodyAPI",null);var Be="object"==typeof global&&global&&global.Object===Object&&global,je="object"==typeof self&&self&&self.Object===Object&&self,Xe=Be||je||Function("return this")(),He=Xe.Symbol,Ve=Object.prototype,Ge=Ve.hasOwnProperty,Ye=Ve.toString,We=He?He.toStringTag:void 0;var qe=Object.prototype.toString;var Ke="[object Null]",Qe="[object Undefined]",Ze=He?He.toStringTag:void 0;function Je(e){return null==e?void 0===e?Qe:Ke:Ze&&Ze in Object(e)?function(e){var t=Ge.call(e,We),n=e[We];try{e[We]=void 0;var r=!0}catch(e){}var s=Ye.call(e);return r&&(t?e[We]=n:delete e[We]),s}(e):function(e){return qe.call(e)}(e)}function et(e){return null!=e&&"object"==typeof e}var tt="[object Symbol]";function nt(e){return"symbol"==typeof e||et(e)&&Je(e)==tt}var rt=Array.isArray,st=1/0,it=He?He.prototype:void 0,ot=it?it.toString:void 0;function at(e){if("string"==typeof e)return e;if(rt(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,at)+"";if(nt(e))return ot?ot.call(e):"";var t=e+"";return"0"==t&&1/e==-st?"-0":t}function ct(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function lt(e){return e}var ut="[object AsyncFunction]",ht="[object Function]",dt="[object GeneratorFunction]",pt="[object Proxy]";function ft(e){if(!ct(e))return!1;var t=Je(e);return t==ht||t==dt||t==ut||t==pt}var mt,gt=Xe["__core-js_shared__"],yt=(mt=/[^.]+$/.exec(gt&>.keys&>.keys.IE_PROTO||""))?"Symbol(src)_1."+mt:"";var bt=Function.prototype.toString;function _t(e){if(null!=e){try{return bt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var wt=/^\[object .+?Constructor\]$/,vt=Function.prototype,St=Object.prototype,kt=vt.toString,At=St.hasOwnProperty,xt=RegExp("^"+kt.call(At).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Et(e){return!(!ct(e)||(t=e,yt&&yt in t))&&(ft(e)?xt:wt).test(_t(e));var t}function It(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Et(n)?n:void 0}var Ct=It(Xe,"WeakMap");function Pt(e){return e!=e}function Ot(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,Pt,n)}(e,t,0)>-1}var $t=9007199254740991,Mt=/^(?:0|[1-9]\d*)$/;function Lt(e,t){var n=typeof e;return!!(t=null==t?$t:t)&&("number"==n||"symbol"!=n&&Mt.test(e))&&e>-1&&e%1==0&&e<t}function Rt(e,t){return e===t||e!=e&&t!=t}var Tt=9007199254740991;function Nt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Tt}var Dt=Object.prototype;function zt(e){return et(e)&&"[object Arguments]"==Je(e)}var Ft=Object.prototype,Ut=Ft.hasOwnProperty,Bt=Ft.propertyIsEnumerable,jt=zt(function(){return arguments}())?zt:function(e){return et(e)&&Ut.call(e,"callee")&&!Bt.call(e,"callee")};var Xt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ht=Xt&&"object"==typeof module&&module&&!module.nodeType&&module,Vt=Ht&&Ht.exports===Xt?Xe.Buffer:void 0,Gt=(Vt?Vt.isBuffer:void 0)||function(){return!1},Yt={};Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;var Wt,qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Qt=Kt&&Kt.exports===qt&&Be.process,Zt=function(){try{var e=Kt&&Kt.require&&Kt.require("util").types;return e||Qt&&Qt.binding&&Qt.binding("util")}catch(e){}}(),Jt=Zt&&Zt.isTypedArray,en=Jt?(Wt=Jt,function(e){return Wt(e)}):function(e){return et(e)&&Nt(e.length)&&!!Yt[Je(e)]},tn=Object.prototype.hasOwnProperty;function nn(e,t){var n=rt(e),r=!n&&jt(e),s=!n&&!r&&Gt(e),i=!n&&!r&&!s&&en(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)!tn.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Lt(l,c))||a.push(l);return a}var rn=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),sn=Object.prototype.hasOwnProperty;function on(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Dt))return rn(e);var t,n,r=[];for(var s in Object(e))sn.call(e,s)&&"constructor"!=s&&r.push(s);return r}function an(e){return null!=(t=e)&&Nt(t.length)&&!ft(t)?nn(e):on(e);var t}var cn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ln=/^\w*$/;function un(e,t){if(rt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!nt(e))||(ln.test(e)||!cn.test(e)||null!=t&&e in Object(t))}var hn=It(Object,"create");var dn=Object.prototype.hasOwnProperty;var pn=Object.prototype.hasOwnProperty;function fn(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 mn(e,t){for(var n=e.length;n--;)if(Rt(e[n][0],t))return n;return-1}fn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},fn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},fn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return dn.call(t,e)?t[e]:void 0},fn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:pn.call(t,e)},fn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this};var gn=Array.prototype.splice;function yn(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])}}yn.prototype.clear=function(){this.__data__=[],this.size=0},yn.prototype.delete=function(e){var t=this.__data__,n=mn(t,e);return!(n<0)&&(n==t.length-1?t.pop():gn.call(t,n,1),--this.size,!0)},yn.prototype.get=function(e){var t=this.__data__,n=mn(t,e);return n<0?void 0:t[n][1]},yn.prototype.has=function(e){return mn(this.__data__,e)>-1},yn.prototype.set=function(e,t){var n=this.__data__,r=mn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var bn=It(Xe,"Map");function _n(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 wn(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])}}wn.prototype.clear=function(){this.size=0,this.__data__={hash:new fn,map:new(bn||yn),string:new fn}},wn.prototype.delete=function(e){var t=_n(this,e).delete(e);return this.size-=t?1:0,t},wn.prototype.get=function(e){return _n(this,e).get(e)},wn.prototype.has=function(e){return _n(this,e).has(e)},wn.prototype.set=function(e,t){var n=_n(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var vn="Expected a function";function Sn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(vn);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(Sn.Cache||wn),n}Sn.Cache=wn;var kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,An=/\\(\\)?/g,xn=function(e){var t=Sn(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(kn,(function(e,n,r,s){t.push(r?s.replace(An,"$1"):n||e)})),t}));function En(e,t){return rt(e)?e:un(e,t)?[e]:xn(function(e){return null==e?"":at(e)}(e))}var In=1/0;function Cn(e){if("string"==typeof e||nt(e))return e;var t=e+"";return"0"==t&&1/e==-In?"-0":t}function Pn(e,t){for(var n=0,r=(t=En(t,e)).length;null!=e&&n<r;)e=e[Cn(t[n++])];return n&&n==r?e:void 0}function On(e){var t=this.__data__=new yn(e);this.size=t.size}On.prototype.clear=function(){this.__data__=new yn,this.size=0},On.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},On.prototype.get=function(e){return this.__data__.get(e)},On.prototype.has=function(e){return this.__data__.has(e)},On.prototype.set=function(e,t){var n=this.__data__;if(n instanceof yn){var r=n.__data__;if(!bn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wn(r)}return n.set(e,t),this.size=n.size,this};var $n=Object.prototype.propertyIsEnumerable,Mn=Object.getOwnPropertySymbols,Ln=Mn?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}(Mn(e),(function(t){return $n.call(e,t)})))}:function(){return[]};function Rn(e){return function(e,t,n){var r=t(e);return rt(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,an,Ln)}var Tn=It(Xe,"DataView"),Nn=It(Xe,"Promise"),Dn=It(Xe,"Set"),zn="[object Map]",Fn="[object Promise]",Un="[object Set]",Bn="[object WeakMap]",jn="[object DataView]",Xn=_t(Tn),Hn=_t(bn),Vn=_t(Nn),Gn=_t(Dn),Yn=_t(Ct),Wn=Je;(Tn&&Wn(new Tn(new ArrayBuffer(1)))!=jn||bn&&Wn(new bn)!=zn||Nn&&Wn(Nn.resolve())!=Fn||Dn&&Wn(new Dn)!=Un||Ct&&Wn(new Ct)!=Bn)&&(Wn=function(e){var t=Je(e),n="[object Object]"==t?e.constructor:void 0,r=n?_t(n):"";if(r)switch(r){case Xn:return jn;case Hn:return zn;case Vn:return Fn;case Gn:return Un;case Yn:return Bn}return t});var qn=Xe.Uint8Array;function Kn(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 Qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wn;++t<n;)this.add(e[t])}function Zn(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 Jn(e,t){return e.has(t)}Qn.prototype.add=Qn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Qn.prototype.has=function(e){return this.__data__.has(e)};var er=1,tr=2;function nr(e,t,n,r,s,i){var o=n&er,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&tr?new Qn: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(!Zn(t,(function(e,t){if(!Jn(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 rr(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sr(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var ir=1,or=2,ar="[object Boolean]",cr="[object Date]",lr="[object Error]",ur="[object Map]",hr="[object Number]",dr="[object RegExp]",pr="[object Set]",fr="[object String]",mr="[object Symbol]",gr="[object ArrayBuffer]",yr="[object DataView]",br=He?He.prototype:void 0,_r=br?br.valueOf:void 0;var wr=1,vr=Object.prototype.hasOwnProperty;var Sr=1,kr="[object Arguments]",Ar="[object Array]",xr="[object Object]",Er=Object.prototype.hasOwnProperty;function Ir(e,t,n,r,s,i){var o=rt(e),a=rt(t),c=o?Ar:Wn(e),l=a?Ar:Wn(t),u=(c=c==kr?xr:c)==xr,h=(l=l==kr?xr:l)==xr,d=c==l;if(d&&Gt(e)){if(!Gt(t))return!1;o=!0,u=!1}if(d&&!u)return i||(i=new On),o||en(e)?nr(e,t,n,r,s,i):function(e,t,n,r,s,i,o){switch(n){case yr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gr:return!(e.byteLength!=t.byteLength||!i(new qn(e),new qn(t)));case ar:case cr:case hr:return Rt(+e,+t);case lr:return e.name==t.name&&e.message==t.message;case dr:case fr:return e==t+"";case ur:var a=rr;case pr:var c=r&ir;if(a||(a=sr),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=or,o.set(e,t);var u=nr(a(e),a(t),r,s,i,o);return o.delete(e),u;case mr:if(_r)return _r.call(e)==_r.call(t)}return!1}(e,t,c,n,r,s,i);if(!(n&Sr)){var p=u&&Er.call(e,"__wrapped__"),f=h&&Er.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return i||(i=new On),s(m,g,n,r,i)}}return!!d&&(i||(i=new On),function(e,t,n,r,s,i){var o=n&wr,a=Rn(e),c=a.length;if(c!=Rn(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:vr.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 Cr(e,t,n,r,s){return e===t||(null==e||null==t||!et(e)&&!et(t)?e!=e&&t!=t:Ir(e,t,n,r,Cr,s))}var Pr=1,Or=2;function $r(e){return e==e&&!ct(e)}function Mr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Lr(e){var t=function(e){for(var t=an(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,$r(s)]}return t}(e);return 1==t.length&&t[0][2]?Mr(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 On;if(!Cr(l,c,Pr|Or,r,u))return!1}}return!0}(n,0,t)}}function Rr(e,t){return null!=e&&t in Object(e)}function Tr(e,t){return null!=e&&function(e,t,n){for(var r=-1,s=(t=En(t,e)).length,i=!1;++r<s;){var o=Cn(t[r]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}return i||++r!=s?i:!!(s=null==e?0:e.length)&&Nt(s)&&Lt(o,s)&&(rt(e)||jt(e))}(e,t,Rr)}var Nr=1,Dr=2;function zr(e,t){return un(e)&&$r(t)?Mr(Cn(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:Pn(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?Tr(n,e):Cr(t,r,Nr|Dr)}}function Fr(e){return un(e)?(t=Cn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pn(t,e)}}(e);var t}function Ur(e,t){return Cr(e,t)}var Br=Dn&&1/sr(new Dn([,-0]))[1]==1/0?function(e){return new Dn(e)}:function(){},jr=200;function Xr(e,t){return e&&e.length?function(e,t,n){var r=-1,s=Ot,i=e.length,o=!0,a=[],c=a;if(i>=jr){var l=t?null:Br(e);if(l)return sr(l);o=!1,s=Jn,c=new Qn}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?lt:"object"==typeof n?rt(n)?zr(n[0],n[1]):Lr(n):Fr(n)):[];var n}var Hr,Vr="object"==typeof Reflect?Reflect:null,Gr=Vr&&"function"==typeof Vr.apply?Vr.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Hr=Vr&&"function"==typeof Vr.ownKeys?Vr.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Yr=Number.isNaN||function(e){return e!=e};function Wr(){Wr.init.call(this)}Wr.EventEmitter=Wr,Wr.prototype._events=void 0,Wr.prototype._eventsCount=0,Wr.prototype._maxListeners=void 0;var qr=10;function Kr(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Qr(e){return void 0===e._maxListeners?Wr.defaultMaxListeners:e._maxListeners}function Zr(e,t,n,r){var s,i,o,a;if(Kr(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=Qr(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 es(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 ts(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):rs(s,s.length)}function ns(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 rs(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(Wr,"defaultMaxListeners",{enumerable:!0,get:function(){return qr},set:function(e){if("number"!=typeof e||e<0||Yr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");qr=e}}),Wr.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},Wr.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Yr(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},Wr.prototype.getMaxListeners=function(){return Qr(this)},Wr.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)Gr(o,this,t);else{var a=o.length,c=rs(o,a);for(let e=0;e<a;++e)Gr(c[e],this,t)}return!0},Wr.prototype.addListener=function(e,t){return Zr(this,e,t,!1)},Wr.prototype.on=Wr.prototype.addListener,Wr.prototype.prependListener=function(e,t){return Zr(this,e,t,!0)},Wr.prototype.once=function(e,t){return Kr(t),this.on(e,es(this,e,t)),this},Wr.prototype.prependOnceListener=function(e,t){return Kr(t),this.prependListener(e,es(this,e,t)),this},Wr.prototype.removeListener=function(e,t){var n,r,s,i,o;if(Kr(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},Wr.prototype.off=Wr.prototype.removeListener,Wr.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},Wr.prototype.listeners=function(e){return ts(this,e,!0)},Wr.prototype.rawListeners=function(e){return ts(this,e,!1)},Wr.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):ns.call(e,t)},Wr.prototype.listenerCount=ns,Wr.prototype.eventNames=function(){return this._eventsCount>0?Hr(this._events):[]};class ss{constructor(){this.emitter=new Wr}static getInstance(){return this.instance||(this.instance=new ss),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 is={"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"},os={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"},as={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},cs={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"},ls={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class us{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=us.getVersionPrecision(e),s=us.getVersionPrecision(t);let i=Math.max(r,s),o=0;const a=us.map([e,t],(e=>{const t=i-us.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return us.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 is[e]}static getBrowserTypeByAlias(e){return os[e]||""}}const hs=/version\/(\d+(\.?_?\d+)+)/i,ds=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=us.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=us.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=us.getFirstMatch(hs,e)||us.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=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=us.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=us.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=us.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=us.getFirstMatch(hs,e)||us.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=us.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=us.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=us.getFirstMatch(hs,e)||us.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=us.getFirstMatch(hs,e)||us.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=us.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,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=us.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=us.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=us.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=us.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=us.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=us.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=us.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=us.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=us.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=us.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=us.getFirstMatch(hs,e)||us.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=us.getFirstMatch(hs,e)||us.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=us.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=us.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=us.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=us.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=us.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=us.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=us.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=us.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=us.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=us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=us.getFirstMatch(hs,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:us.getFirstMatch(t,e),version:us.getSecondMatch(t,e)}}}];var ps=[{test:[/Roku\/DVP/],describe(e){const t=us.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:cs.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=us.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:cs.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=us.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=us.getWindowsVersionName(t);return{name:cs.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:cs.iOS},n=us.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=us.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=us.getMacOSVersionName(t),r={name:cs.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=us.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:cs.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=us.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=us.getAndroidVersionName(t),r={name:cs.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=us.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:cs.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=us.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||us.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||us.getFirstMatch(/\bbb(\d+)/i,e);return{name:cs.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=us.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:cs.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=us.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:cs.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:cs.Linux})},{test:[/CrOS/],describe:()=>({name:cs.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=us.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:cs.PlayStation4,version:t}}}],fs=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=us.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:as.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:as.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:as.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:as.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:as.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:as.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:as.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=us.getFirstMatch(/(ipod|iphone)/i,e);return{type:as.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:as.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:as.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:as.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:as.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:as.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:as.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:as.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:as.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:as.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:as.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:as.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:as.tv})}],ms=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ls.Blink};const t=us.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ls.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ls.Trident},n=us.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ls.Presto},n=us.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:ls.Gecko},n=us.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ls.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ls.WebKit},n=us.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class gs{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=us.find(ds,(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=us.find(ps,(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=us.find(fs,(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=us.find(ms,(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 us.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=us.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=us.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=us.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=us.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(us.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 ys{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new gs(e,t)}static parse(e){return new gs(e).getResult()}static get BROWSER_MAP(){return os}static get ENGINE_MAP(){return ls}static get OS_MAP(){return cs}static get PLATFORMS_MAP(){return as}}const bs={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},_s=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:h,language:"en"};const t=ys.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:h,language:window.navigator.language};if(n.type&&(r.form_factor=bs[n.type]),n.model&&(r.device_model=n.model),e&&e.length>0){const t=(e=>{const t=e.find((e=>e.includes(Y))),n={platform:"",version:""};if(t){const e=t.split(W);n.platform=e[1],n.version=e[2]}return n})(e);r.extended_platform=t.platform,r.extended_platform_version=t.version}return r},ws=()=>{if("undefined"==typeof window)return bs.desktop;const e=ys.getParser(window.navigator.userAgent).getPlatform();return e.type?bs[e.type]:bs.desktop};class vs{static{this.instance=new vs(ws())}constructor(e){this.currentFormFactor=e}async fetchCampaignRules(e){const t=ge.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})),ge.setCampaignRules(C,n),this.invokeAvailableCampaignsResponseHandler(),n}invokeAvailableCampaignsResponseHandler(e){const t=ss.getInstance().listeners(ae);if(!e){const t=ge.getCampaignRules(C)??[],n=ge.getCampaignRules(M)??[];e=Xr(Kn([...t,...n]),"rule")}t.forEach((t=>{t(e)}))}async getAnonymousCampaigns(){const e="campaign_rules/";let t;try{t=await Ue.instance.fetchAPI(e)}catch(t){throw me.error($e(t.status,e)),t}return t.results}async getCampaigns(e){const t=`device/${e}/campaign_rules/`;let n;try{n=await Ue.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw me.error($e(e.status,t)),e}return n?.results||[]}fallbackData(){const e=ge.getCampaignRules(C)||ge.getCampaignRules(M);return e?{count:e.length,results:e}:null}}class Ss{static{this.instance=new Ss}async createOrUpdateDevice(e){const t=ge.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&&ge.setDevice(t),t}async updateDevice(e,t){const n=await this.requestAPIData(`device/${e}/`,t,"PUT");return n&&ge.setDevice(n),n}async updateDeviceField(e,t){const n={[e]:t},r=ge.getDevice();if(!r?.id)throw new we;const s=await this.requestAPIData(`device/${r.id}/`,n,"PATCH");return s&&ge.setDevice(s),s}async requestAPIData(e,t,n="POST"){let r;try{r=await Ue.instance.requestBodyAPI(e,t,n,!1,J)}catch(t){if(t instanceof _e)throw t;if(r=ge.getDevice(),!r)return me.error($e(t.status,e)),null}return r}isEqualDevices(e,t){const n={...e,...t};return Ur(Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{}),e)}}class ks{static{this.instance=new ks}async fetchProducts(){if(Ne(Re.THIRD_PARTY_TRANSACTIONS))return[];let e;try{e=await Ue.instance.fetchAPI("products/")}catch(t){if(e=this.fallbackData(),!e)throw me.error($e(t.status,"products/")),t}return e?.results&&ge.setProducts(O,e.results),e?.results||[]}fallbackData(){const e=ge.getProducts(O)||ge.getProducts(R);return e?{count:e.length,results:e}:null}}class As{static{this.instance=new As}async fetchPaywalls(){const e=ge.getDevice();let t;return t=e?.id?await this.getPaywalls(e.id):await this.getAnonymousPaywalls(),t&&ge.setPaywalls(P,t),t||[]}async getAnonymousPaywalls(e=h){const t=`paywalls/?sdk_version=${e}`;let n;try{n=await Ue.instance.fetchAPI(t)}catch(e){throw me.error($e(e.status,t)),e}return n.results}async getPaywalls(e){const t=`device/${e}/paywalls/`;let n;try{n=await Ue.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw me.error($e(e.status,t)),e}return n?.results||[]}fallbackData(){const e=ge.getPaywalls(P)||ge.getPaywalls(L);return e?{count:e.length,results:e}:null}}class xs{static{this.instance=new xs}async fetchConfig(){let e;try{e=await Ue.instance.fetchAPI("config/")}catch(t){if(e=ge.getAppConfig(I)||ge.getAppConfig($),!e)throw me.error($e(t.status,"config/")),t}return e&&ge.setAppConfig(I,e),e}}class Es{static{this.instance=new Es}async startSession(){ge.getAnonymousMode()?me.debug("Skipping session start call - anonymous mode"):await Ue.instance.startSession(new Date)}}class Is{static{this.instance=new Is}async init(e){this.setInitialValues(e),await this.initAndFetchRequiredData(e)}setInitialValues(e){ge.clearSessionId(),ge.setNamiConfig(e);const t=e.initialConfig;if(t.campaign_rules&&ge.setCampaignRules(M,t.campaign_rules),t.appConfig||t.platform_config){const e=t?.appConfig||t?.platform_config;e&&ge.setAppConfig($,e)}t?.paywalls&&ge.setPaywalls(L,t.paywalls),t?.products&&ge.setProducts(R,t.products)}async initAndFetchRequiredData(e){let t=null;if(!ge.getAnonymousMode()){const n=_s(e.namiCommands);e.formFactor&&(n.form_factor=e.formFactor),t=await Ss.instance.createOrUpdateDevice(n)}const n=e.formFactor??t?.form_factor??ws();e.formFactor&&n!==e.formFactor&&(vs.instance.currentFormFactor=n);const r=Promise.all([xs.instance.fetchConfig(),ks.instance.fetchProducts(),As.instance.fetchPaywalls().then((e=>vs.instance.fetchCampaignRules(e)))]),s=e.initialConfig;s.campaign_rules?.length&&s.paywalls?.length||await r,Es.instance.startSession()}}class Cs{static{this.instance=new Cs}#e=!1;get isInitialized(){return this.#e}static async configure(e){if(!e.appPlatformId)throw new _e;return this.setInitialConfig(e),await Cs.instance.initializeSDK(e)}static setInitialConfig(e){let t={};if(e.initialConfig)if("string"==typeof e.initialConfig)try{t=JSON.parse(e.initialConfig)}catch(e){me.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?ge.getNamiConfig():null;if(me.setLogger(e.logLevel),null!==r){if(Ur(e,r))return me.warn("Nami SDK is already configured, ignoring this configure call."),{sdkInitialized:!0,configureState:oe};n=!0;const s=Te(e.namiCommands),i=Te(r.namiCommands);e.appPlatformId==r.appPlatformId&&s==i||(t=!0),e.languageCode===r.languageCode&&e.logLevel==r.logLevel||(n=!0)}t&&(me.info("SDK full reconfigure called"),ge.resetDevice()),this.#e=!0,Ue.configure(e),await Is.instance.init(e),me.info("SDK successfully initialized!");return{sdkInitialized:!0,configureState:n||t?ie:se}}}var Ps,Os,$s;!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(Ps||(Ps={})),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"}(Os||(Os={})),function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.EMPTY=""}($s||($s={}));function Ms(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 Rs(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return t?.billingPeriod}}function Ls(e){if(!e||!e.subscription_period)return[];return Rs(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period)}function Rs(e,t){return e.map((e=>Ts(e,t)))}function Ts(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:Ds(i).format(s)}}function Ns(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 Ds(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 zs=(e,t,n)=>e&&t&&n?n.format(e-t):null,Fs=(e,t,n,r)=>{if(e&&t&&n&&r){const s=100*(1-e/(n/r*t));return`${Math.round(s)}%`}return null},Us=(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))},Bs=e=>Xs(e.priceAmountMicros)/js(e.billingPeriod),js=e=>{let t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Xs=e=>e/1e6;function Hs(e){return parseFloat((Math.round(e)/100).toFixed(2))}const Vs={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},Gs=(e,t,n,r=[])=>{const s=Vs[e];if(!t)return s;return(0,{price:()=>Ys(t),name:()=>t?.name,title:()=>t?.name,description:()=>t?.description,duration:()=>Ws(t),durationSingular:()=>Ws(t,!0),period:()=>Ws(t,!1,!0),periodNumber:()=>Ws(t,!1,!1,!0),freeTrialDuration:()=>qs(t),freeTrialDurationSingular:()=>qs(t,!0),freeTrialPeriod:()=>qs(t,!1,!0),freeTrialPeriodNumber:()=>qs(t,!1,!1,!0),pricePerMonth:()=>Ks(t),pricePerMonthRounded:()=>Ks(t,!0),periodInMonths:()=>Qs(t),durationInMonths:()=>Zs(t),durationInMonthsSingular:()=>Zs(t,!0),periodNumberInMonths:()=>Js(t),percentagePriceDifferenceFromSku:()=>ei(t,n,r),priceDifferenceFromSku:()=>ti(t,n,r),promoEligible:()=>null===ni(t)&&null!==ri(t,n),freeTrialEligible:()=>null!==ni(t),promo:()=>ri(t,n)?.offer_ref_id,promoCode:()=>"XXXXX",promoPrice:()=>si(t,n)?.formattedPrice,promoPeriod:()=>ii(t,n,!1,!0),promoPeriodNumber:()=>ii(t,n,!1,!1,!0),promoDuration:()=>ii(t,n),promoDurationSingular:()=>ii(t,n,!0),introEligible:()=>!1,pricePerDay:()=>oi(t),pricePerWeek:()=>ai(t),pricePerWeekRounded:()=>ai(t,!0),introductoryPrice:()=>ci(t,n),introductoryPeriod:()=>li(t,n,!1,!0),introductoryPeriodNumber:()=>li(t,n,!1,!1,!0),introductoryDuration:()=>li(t,n),introductoryDurationSingular:()=>li(t,n,!0),introductoryPricePerMonth:()=>ui(t,n),introductoryPricePerMonthRounded:()=>ui(t,n,!0),invalid:()=>!1,unavailable:()=>!1}[e])()??s??null},Ys=e=>{if("subscription"===e?.product_type){const t=Ls(e);return t&&t.length?t[0].formattedPrice:null}return null},Ws=(e,t,n,r)=>Ns(function(e){if("subscription"===e?.product_type){const t=Ls(e);if(t.length>0)return t[0].billingPeriod}}(e),t,n,r),qs=(e,t,n,r)=>Ns(Ms(e),t,n,r),Ks=(e,t)=>{const n=Ls(e);if(!n||0===n.length)return null;const r=Bs(n[0]);return r?Ds(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Qs=e=>{const t=Ls(e);return"P1Y"===t[0].billingPeriod&&(t[0].billingPeriod="P12M"),t&&t.length?Ns(t[0].billingPeriod):null},Zs=(e,t,n,r)=>{const s=Ls(e);return s&&0!==s.length?("P1Y"===s[0].billingPeriod&&(s[0].billingPeriod="P12M"),Ns(s[0].billingPeriod,t,n,r)):null},Js=e=>{if(!e)return 0;const t=Ls(e);return t&&t.length?js(t[0].billingPeriod):0},ei=(e,t,n=[])=>{const r=Ls(e);if(!r||0===r.length)return null;const s=Us(n,t??"")?.product_details;if(!t||!s)return Fs(Hs(r[0].priceAmountMicros),Js(e));const i=Ls(s);return Fs(Hs(r[0].priceAmountMicros),Js(e),i?.length>0?Hs(i[0].priceAmountMicros):0,Js(s))},ti=(e,t,n=[])=>{const r=Ls(e);if(!r||0===r.length)return null;const s=Us(n,t??"")?.product_details;if(!t||!s)return zs(Bs(r[0]));const i=Ls(s);return zs(Bs(r[0]),Bs(i[0]),Ds(i[0].priceCurrencyCode))},ni=e=>Ms(e),ri=(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)},si=(e,t)=>{if(!e)return null;return Ts(ri(e,t),e.subscription_period)},ii=(e,t,n,r,s)=>{const i=si(e,t);return Ns(i?.billingPeriod,n,r,s)},oi=(e,t)=>{const n=Ls(e);if(!n||0===n.length)return null;const r=Xs(n[0].priceAmountMicros)/(e=>{const t=js(e);return t?30.437*t:1})(n[0].billingPeriod);return r?Ds(n[0].priceCurrencyCode).format(r):null},ai=(e,t)=>{const n=Ls(e);if(!n||0===n.length)return null;const r=Xs(n[0].priceAmountMicros)/(e=>{const t=js(e);return t?52*t/12:1})(n[0].billingPeriod);return r?Ds(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},ci=(e,t)=>{const n=hi(e,t);return n?.formattedPrice||null},li=(e,t,n,r,s)=>{const i=hi(e,t);return Ns(i?.billingPeriod,n,r,s)},ui=(e,t,n)=>{const r=hi(e,t);if(!r)return;const s=Xs(r.priceAmountMicros),i=js(r.billingPeriod),o=n?Math.round(s/i):s/i;return Ds(r.priceCurrencyCode).format(o)},hi=(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],Ts(n,e.subscription_period)};function di(e,t,n,r){const s=n?.flatMap((e=>e.products)).find((e=>e.id===t.selectedProducts[t.currentGroupId]));return pi(gi(e,s?.name??""),s,r)}function pi(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(le,((t,r)=>{const i=le.exec(s)?.slice(1)||[];r=i[0]??r;const o=i[1]?.replace(":","")??"";return Gs(r,e,o,n)})))})),{...t,...r}}function fi(e,t,n){return yi(t,n)?.some((()=>1==Gs("freeTrialEligible",gi(e,""))))??!1}function mi(e,t,n){return!fi(e,t,n)&&(yi(t,n)?.some((()=>1==Gs("promoEligible",gi(e,""))))??!1)}function gi(e=[],t){return e.find((e=>e.name===t))||null}function yi(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 bi={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 _i=new class{constructor(){this.host=null,this.state=bi,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=gi(e,t.name||"")})),r.forEach((e=>{pi(e.product_details,e,r)})),r||[]}(this.productDetails,e.sku_menus,e.template.initialState.currentGroupId),s={...this.state,...e.template.initialState,anySkuHasTrialOffer:fi(this.productDetails,e.sku_menus,n),anySkuHasPromoOffer:mi(this.productDetails,e.sku_menus,n),paywallId:e.id,selectedPaywall:e,launch:t||{...this.state.launch,productGroups:n},sku:di(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 wi{static{this.instance=new wi}constructor(){this.load()}setExternalId(e){return this.externalId=e,this}getExternalId(){return this.externalId}isLoggedIn(){return!!this.externalId}save(){return this.externalId?ge.setNamiProfile({externalId:this.externalId}):ge.removeNamiProfile(),this}load(){const e=ge.getNamiProfile();e&&(this.externalId=e.externalId)}async login(e){const t=await Ue.instance.login(e);t.external_id&&_i.setIsLoggedIn(!0),this.setExternalId(t.external_id).save()}async logout(){await Ue.instance.logout(),_i.setIsLoggedIn(!1),this.setExternalId(void 0).save()}}var vi;!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"}(vi||(vi={}));class Si{constructor(){this.emitter=ss.getInstance()}static{this.instance=new Si}static isLoggedIn(){return wi.instance.isLoggedIn()}static loggedInId(){return this.instance.isSDKInitialized||me.debug(y),wi.instance.getExternalId()}static async login(e){if(!this.instance.isSDKInitialized){const e=new be;throw this.invokeStateHandler(vi.LOGIN,!1,e),e}if(this.inAnonymousMode()){const e=new xe;throw this.invokeStateHandler(vi.LOGIN,!1,e),e}try{await wi.instance.login(e),this.invokeStateHandler(vi.LOGIN,!0)}catch(e){throw this.invokeStateHandler(vi.LOGIN,!1,e),e}}static async logout(){if(!this.instance.isSDKInitialized){const e=new be;throw this.invokeStateHandler(vi.LOGOUT,!1,e),e}if(this.inAnonymousMode()){const e=new xe;throw this.invokeStateHandler(vi.LOGOUT,!1,e),e}try{await wi.instance.logout(),this.invokeStateHandler(vi.LOGOUT,!0)}catch(e){throw this.invokeStateHandler(vi.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?vi.ANONYMOUS_MODE_ON:vi.ANONYMOUS_MODE_OFF;if(!this.instance.isSDKInitialized){const e=new be;throw this.invokeStateHandler(t,!1,e),e}if(this.anonymousModeCapability())if(this.inAnonymousMode()!==e)if(e)ge.setAnonymousMode(e),ge.resetDevice(),this.refetchConfig(),this.invokeStateHandler(vi.ANONYMOUS_MODE_ON,!0);else{ge.clearAnonymousMode();const e=ge.getNamiConfig()?.namiCommands;await Ss.instance.createOrUpdateDevice(_s(e)),this.refetchConfig(),this.invokeStateHandler(vi.ANONYMOUS_MODE_OFF,!0)}else{const n=e?new ke:new Ae;this.invokeStateHandler(t,!1,n)}else me.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details.")}static inAnonymousMode(){return!!this.instance.isSDKInitialized&&ge.getAnonymousMode()}static setCustomerAttribute(e,t){if(!this.instance.isSDKInitialized)throw new be;ge.setCustomerAttribute(e,t),Ne(Re.PAYWALL_PERSONALIZATION)?(_i.setCustomerAttribute({[e]:t}),me.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):me.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 be;const t=ge.getCustomerAttribute(e);return null!=t?Ne(Re.PAYWALL_PERSONALIZATION)?me.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):me.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.`):me.warn(`No ${e} customer attribute found.`),t}static clearCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new be;ge.clearCustomerAttribute(e)?(_i.removeCustomerAttribute(e),me.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.`)):me.warn(`No value to clear for attribute ${e}.`)}static clearAllCustomerAttributes(){if(!this.instance.isSDKInitialized)throw new be;ge.getAllCustomerAttributes().forEach((e=>{_i.removeCustomerAttribute(e)})),ge.clearAllCustomerAttributes(),me.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 Cs.instance.isInitialized}static async updateCustomerDataPlatformId(e){if(!this.instance.isSDKInitialized){const e=new be;throw this.invokeStateHandler(vi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}if(this.inAnonymousMode()){const e=new Ee;throw this.invokeStateHandler(vi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}try{await Ss.instance.updateDeviceField("customer_data_platform_id",e),this.invokeStateHandler(vi.CUSTOMER_DATA_PLATFORM_ID_SET,!0)}catch(e){this.invokeStateHandler(vi.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e)}}static anonymousModeCapability(){if(!this.instance.isSDKInitialized)return!1;const e=Ne(Re.ANONYMOUS_MODE_CAPABILITY),t=Ne(Re.THIRD_PARTY_TRANSACTIONS);return e&&t}static async refetchConfig(){this.instance.isSDKInitialized&&await Promise.all([ks.instance.fetchProducts(),As.instance.fetchPaywalls().then((e=>vs.instance.fetchCampaignRules(e)))])}}class ki{constructor(){this.emitter=ss.getInstance()}static{this.instance=new ki}static allPaywalls(){if(!this.instance.sdkInitialized)throw new be;return Xr(Kn([...ge.getPaywalls(P)??[],...ge.getPaywalls(L)??[]]),"id")}static setProductDetails(e){this.instance.productDetails=e,_i.setProductDetails(e)}static registerSignInHandler(e){return this.instance.emitter.addListener(Os.PAYWALL_SIGNIN_REQUESTED,e),()=>{this.instance.emitter.removeListener(Os.PAYWALL_SIGNIN_REQUESTED,e)}}static registerCloseHandler(e){return this.instance.emitter.addListener(Os.PAYWALL_CLOSE_REQUESTED,e),()=>{this.instance.emitter.removeListener(Os.PAYWALL_CLOSE_REQUESTED,e)}}static registerDeeplinkActionHandler(e){return this.instance.emitter.addListener(Os.PAYWALL_DEEPLINK_ACTION,e),()=>{this.instance.emitter.removeListener(Os.PAYWALL_DEEPLINK_ACTION,e)}}static registerBuySkuHandler(e){return De()&&me.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(Os.REGISTER_BUY_SKU,e),()=>{this.instance.emitter.removeListener(Os.REGISTER_BUY_SKU,e)}}static registerRestoreHandler(e){return this.instance.emitter.addListener(Os.PAYWALL_RESTORE_REQUESTED,e),()=>{this.instance.emitter.removeListener(Os.PAYWALL_RESTORE_REQUESTED,e)}}static async buySkuComplete(e){if(_i.setPurchaseInProgress(!1),De())return void me.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(ge.getAnonymousMode())me.info("Skipping transaction post - anonymous mode");else if(e)try{await Ue.instance.postConversion(e)}catch(e){me.error("Error posting conversion",e)}})(function(e){if(!e)return;const t=ge.getSessionId();if(!t)return void me.warn(k);const n=_i.getProductDetails()?.find((t=>t.product_ref_id===e.sku_id)),r=n?Ls(n):[];return{session:t,currency:r[0]?.priceCurrencyCode,amount:r[0]?.formattedPrice,impression:ge.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(Si.inAnonymousMode())return void me.debug("Skipping purchase validation - anonymous mode");try{await Ue.instance.purchaseValidation({app_env:"production",payload:t.purchase_token??"",sku:t.sku_UUID})}catch(e){me.error("Error validating purchase",e)}}}static buySkuCancel(){Ne(Re.THIRD_PARTY_TRANSACTIONS)?_i.setPurchase(!1):me.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 Cs.instance.isInitialized}}const Ai=e`
|
|
1
|
+
import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as i,svg as s}from"lit";const o=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",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(){}},a=new WeakMap,c=e=>{let t=a.get(e);return void 0===t&&a.set(e,t=new Map),t},l=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(c(this)).map((([e,t])=>({name:e,value:t})))}get shadowRoot(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){c(this).set(e,String(t))}removeAttribute(e){c(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 c(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 o(this);return this.__internals=e,e}getAttribute(e){return c(this).get(e)??null}},u=class extends l{};function h(e,t,n,r){var i,s=arguments.length,o=s<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--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function d(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=u),"function"==typeof SuppressedError&&SuppressedError;const{NAMI_SDK_VERSION:p="3.2.1",PRODUCTION:f="production",DEVELOPMENT:m="development",PLATFORM_ID_REQUIRED:g="Platform ID is required",DEVICE_ID_REQUIRED:y="Device ID is required",EXTERNAL_ID_REQUIRED:b="External ID is required",SDK_NOT_INITIALIZED:_="SDK has not been initialized. Make sure to call Nami.configure() first!",CAMPAIGN_NOT_AVAILABLE:w="Campaign is not available",UNABLE_TO_UPDATE_CDP_ID:v="Unable to update CDP id in anonymous mode",ANONYMOUS_MODE_ALREADY_ON:S="Anonymous mode is already turned on.",ANONYMOUS_MODE_ALREADY_OFF:A="Anonymous mode is already turned off.",ANONYMOUS_MODE_LOGIN_NOT_ALLOWED:k="Login/logout are not available in anonymous mode",SESSION_REQUIRED:E="Session is required",AUTH_DEVICE:I="nami_auth_device",NAMI_CONFIGURATION:x="nami_configuration",NAMI_PROFILE:C="nami_profile",API_CONFIG:P="api_config",API_CAMPAIGN_RULES:O="api_campaign_rules",API_PAYWALLS:$="api_paywalls",API_PRODUCTS:L="api_products",API_ACTIVE_ENTITLEMENTS:M="api_active_entitlements",SERVER_NAMI_ENTITLEMENTS:N="server_active_entitlements",INITIAL_APP_CONFIG:T="initial_app_config",INITIAL_CAMPAIGN_RULES:R="initial_campaign_rules",INITIAL_PAYWALLS:D="initial_paywalls",INITIAL_PRODUCTS:F="initial_products",LOCAL_NAMI_ENTITLEMENTS:z="local_active_entitlements",CUSTOMER_ATTRIBUTES_KEY_PREFIX:U="nami_cmr_attributes_",ANONYMOUS_MODE:B="nami_anonymous_mode",KEY_SESSION_COUNTER:j="nami_session_counter",INITIAL_SESSION_COUNTER_VALUE:H=1,NAMI_LAST_IMPRESSION_ID:X="nami_last_impression_id",NAMI_PURCHASE_IMPRESSION_ID:V="nami_purchase_impression_id",NAMI_SESSION_ID:G="nami_session_id",API_VERSION:W="v3",BASE_URL_PATH:Y=`sdk/${W}/platform`,BASE_URL:q="https://app.namiml.com",BASE_STAGING_URL:K="https://app-staging.namiml.com",CUSTOM_HOST_PREFIX:Q="namiAPIHost=",USE_STAGING_API:Z="useStagingAPI",EXTENDED_CLIENT_INFO_PREFIX:J="extendedClientInfo",EXTENDED_CLIENT_INFO_DELIMITER:ee=":",EXTENDED_PLATFORM:te="extended-platform",EXTENDED_PLATFORM_VERSION:ne="extended-platform-version",API_MAX_CALLS_LIMIT:re=2,API_RETRY_DELAY_SEC:ie=2,API_TIMEOUT_LIMIT:se=2e4,DEVICE_API_TIMEOUT_LIMIT:oe=3e3,STATUS_SUCCESS:ae=200,STATUS_BAD_REQUEST:ce=400,STATUS_NOT_FOUND:le=404,STATUS_INTERNAL_SERVER_ERROR:ue=500,INITIAL_SUCCESS:he="Initial success",RECONFIG_SUCCESS:de="Reconfig success",ALREADY_CONFIGURED:pe="Already configured",AVAILABLE_CAMPAIGNS_CHANGED:fe="AvailableCampaignsChanged",PAYWALL_ACTION_EVENT:me="PaywallActionEvent",AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED:ge="AvailableActiveEntitlementsChanged",SKU_TEXT_REGEX:ye=/\$\{sku\.(\w+)(:\d+)?\}/g,VAR_REGEX:be=/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g,CORS_PROXY_URL:_e="https://hosted-content-staging.namiml.com",CORS_PROXY_URL_LOCAL:we="http://localhost:8001"}={};var ve;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(ve||(ve={}));const Se={debug:ve.DEBUG,info:ve.INFO,warn:ve.WARN,error:ve.ERROR};const Ae=new class{constructor(){this.setLogger=e=>{this.currentLogLevel=e?Se[e]:ve.WARN}}debug(e,...t){this.shouldLog(ve.DEBUG)&&console.debug(this.formatMessage(ve.DEBUG,e,...t))}info(e,...t){this.shouldLog(ve.INFO)&&console.info(this.formatMessage(ve.INFO,e,...t))}warn(e,...t){this.shouldLog(ve.WARN)&&console.warn(this.formatMessage(ve.WARN,e,...t))}error(e,...t){this.shouldLog(ve.ERROR)&&console.error(this.formatMessage(ve.ERROR,e,...t))}shouldLog(e){return e>=this.currentLogLevel}formatMessage(e,t,...n){const r=ve[e];return`[${(new Date).toISOString()}] [${r}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}};var ke="object"==typeof global&&global&&global.Object===Object&&global,Ee="object"==typeof self&&self&&self.Object===Object&&self,Ie=ke||Ee||Function("return this")(),xe=Ie.Symbol,Ce=Object.prototype,Pe=Ce.hasOwnProperty,Oe=Ce.toString,$e=xe?xe.toStringTag:void 0;var Le=Object.prototype.toString;var Me="[object Null]",Ne="[object Undefined]",Te=xe?xe.toStringTag:void 0;function Re(e){return null==e?void 0===e?Ne:Me:Te&&Te in Object(e)?function(e){var t=Pe.call(e,$e),n=e[$e];try{e[$e]=void 0;var r=!0}catch(e){}var i=Oe.call(e);return r&&(t?e[$e]=n:delete e[$e]),i}(e):function(e){return Le.call(e)}(e)}function De(e){return null!=e&&"object"==typeof e}var Fe="[object Symbol]";function ze(e){return"symbol"==typeof e||De(e)&&Re(e)==Fe}var Ue=Array.isArray,Be=1/0,je=xe?xe.prototype:void 0,He=je?je.toString:void 0;function Xe(e){if("string"==typeof e)return e;if(Ue(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(e,Xe)+"";if(ze(e))return He?He.call(e):"";var t=e+"";return"0"==t&&1/e==-Be?"-0":t}function Ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return e}var We="[object AsyncFunction]",Ye="[object Function]",qe="[object GeneratorFunction]",Ke="[object Proxy]";function Qe(e){if(!Ve(e))return!1;var t=Re(e);return t==Ye||t==qe||t==We||t==Ke}var Ze,Je=Ie["__core-js_shared__"],et=(Ze=/[^.]+$/.exec(Je&&Je.keys&&Je.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"";var tt=Function.prototype.toString;function nt(e){if(null!=e){try{return tt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var rt=/^\[object .+?Constructor\]$/,it=Function.prototype,st=Object.prototype,ot=it.toString,at=st.hasOwnProperty,ct=RegExp("^"+ot.call(at).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lt(e){return!(!Ve(e)||(t=e,et&&et in t))&&(Qe(e)?ct:rt).test(nt(e));var t}function ut(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return lt(n)?n:void 0}var ht=ut(Ie,"WeakMap");function dt(e){return e!=e}function pt(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n){for(var r=e.length,i=n+-1;++i<r;)if(t(e[i],i,e))return i;return-1}(e,dt,n)}(e,t,0)>-1}var ft=9007199254740991,mt=/^(?:0|[1-9]\d*)$/;function gt(e,t){var n=typeof e;return!!(t=null==t?ft:t)&&("number"==n||"symbol"!=n&&mt.test(e))&&e>-1&&e%1==0&&e<t}function yt(e,t){return e===t||e!=e&&t!=t}var bt=9007199254740991;function _t(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=bt}var wt=Object.prototype;function vt(e){return De(e)&&"[object Arguments]"==Re(e)}var St=Object.prototype,At=St.hasOwnProperty,kt=St.propertyIsEnumerable,Et=vt(function(){return arguments}())?vt:function(e){return De(e)&&At.call(e,"callee")&&!kt.call(e,"callee")};var It="object"==typeof exports&&exports&&!exports.nodeType&&exports,xt=It&&"object"==typeof module&&module&&!module.nodeType&&module,Ct=xt&&xt.exports===It?Ie.Buffer:void 0,Pt=(Ct?Ct.isBuffer:void 0)||function(){return!1},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var $t,Lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Mt=Lt&&"object"==typeof module&&module&&!module.nodeType&&module,Nt=Mt&&Mt.exports===Lt&&ke.process,Tt=function(){try{var e=Mt&&Mt.require&&Mt.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch(e){}}(),Rt=Tt&&Tt.isTypedArray,Dt=Rt?($t=Rt,function(e){return $t(e)}):function(e){return De(e)&&_t(e.length)&&!!Ot[Re(e)]},Ft=Object.prototype.hasOwnProperty;function zt(e,t){var n=Ue(e),r=!n&&Et(e),i=!n&&!r&&Pt(e),s=!n&&!r&&!i&&Dt(e),o=n||r||i||s,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)!Ft.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||gt(l,c))||a.push(l);return a}var Ut=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Bt=Object.prototype.hasOwnProperty;function jt(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||wt))return Ut(e);var t,n,r=[];for(var i in Object(e))Bt.call(e,i)&&"constructor"!=i&&r.push(i);return r}function Ht(e){return null!=(t=e)&&_t(t.length)&&!Qe(t)?zt(e):jt(e);var t}var Xt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/;function Gt(e,t){if(Ue(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ze(e))||(Vt.test(e)||!Xt.test(e)||null!=t&&e in Object(t))}var Wt=ut(Object,"create");var Yt=Object.prototype.hasOwnProperty;var qt=Object.prototype.hasOwnProperty;function Kt(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 Qt(e,t){for(var n=e.length;n--;)if(yt(e[n][0],t))return n;return-1}Kt.prototype.clear=function(){this.__data__=Wt?Wt(null):{},this.size=0},Kt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kt.prototype.get=function(e){var t=this.__data__;if(Wt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Yt.call(t,e)?t[e]:void 0},Kt.prototype.has=function(e){var t=this.__data__;return Wt?void 0!==t[e]:qt.call(t,e)},Kt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wt&&void 0===t?"__lodash_hash_undefined__":t,this};var Zt=Array.prototype.splice;function Jt(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])}}Jt.prototype.clear=function(){this.__data__=[],this.size=0},Jt.prototype.delete=function(e){var t=this.__data__,n=Qt(t,e);return!(n<0)&&(n==t.length-1?t.pop():Zt.call(t,n,1),--this.size,!0)},Jt.prototype.get=function(e){var t=this.__data__,n=Qt(t,e);return n<0?void 0:t[n][1]},Jt.prototype.has=function(e){return Qt(this.__data__,e)>-1},Jt.prototype.set=function(e,t){var n=this.__data__,r=Qt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var en=ut(Ie,"Map");function tn(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function nn(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])}}nn.prototype.clear=function(){this.size=0,this.__data__={hash:new Kt,map:new(en||Jt),string:new Kt}},nn.prototype.delete=function(e){var t=tn(this,e).delete(e);return this.size-=t?1:0,t},nn.prototype.get=function(e){return tn(this,e).get(e)},nn.prototype.has=function(e){return tn(this,e).has(e)},nn.prototype.set=function(e,t){var n=tn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var rn="Expected a function";function sn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(rn);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(sn.Cache||nn),n}sn.Cache=nn;var on=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,an=/\\(\\)?/g,cn=function(e){var t=sn(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(on,(function(e,n,r,i){t.push(r?i.replace(an,"$1"):n||e)})),t}));function ln(e,t){return Ue(e)?e:Gt(e,t)?[e]:cn(function(e){return null==e?"":Xe(e)}(e))}var un=1/0;function hn(e){if("string"==typeof e||ze(e))return e;var t=e+"";return"0"==t&&1/e==-un?"-0":t}function dn(e,t){for(var n=0,r=(t=ln(t,e)).length;null!=e&&n<r;)e=e[hn(t[n++])];return n&&n==r?e:void 0}function pn(e){var t=this.__data__=new Jt(e);this.size=t.size}pn.prototype.clear=function(){this.__data__=new Jt,this.size=0},pn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},pn.prototype.get=function(e){return this.__data__.get(e)},pn.prototype.has=function(e){return this.__data__.has(e)},pn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Jt){var r=n.__data__;if(!en||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nn(r)}return n.set(e,t),this.size=n.size,this};var fn=Object.prototype.propertyIsEnumerable,mn=Object.getOwnPropertySymbols,gn=mn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}(mn(e),(function(t){return fn.call(e,t)})))}:function(){return[]};function yn(e){return function(e,t,n){var r=t(e);return Ue(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Ht,gn)}var bn=ut(Ie,"DataView"),_n=ut(Ie,"Promise"),wn=ut(Ie,"Set"),vn="[object Map]",Sn="[object Promise]",An="[object Set]",kn="[object WeakMap]",En="[object DataView]",In=nt(bn),xn=nt(en),Cn=nt(_n),Pn=nt(wn),On=nt(ht),$n=Re;(bn&&$n(new bn(new ArrayBuffer(1)))!=En||en&&$n(new en)!=vn||_n&&$n(_n.resolve())!=Sn||wn&&$n(new wn)!=An||ht&&$n(new ht)!=kn)&&($n=function(e){var t=Re(e),n="[object Object]"==t?e.constructor:void 0,r=n?nt(n):"";if(r)switch(r){case In:return En;case xn:return vn;case Cn:return Sn;case Pn:return An;case On:return kn}return t});var Ln=Ie.Uint8Array;function Mn(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var s=e[t];s&&(i[r++]=s)}return i}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nn;++t<n;)this.add(e[t])}function Tn(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 Rn(e,t){return e.has(t)}Nn.prototype.add=Nn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(e){return this.__data__.has(e)};var Dn=1,Fn=2;function zn(e,t,n,r,i,s){var o=n&Dn,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,p=n&Fn?new Nn:void 0;for(s.set(e,t),s.set(t,e);++h<a;){var f=e[h],m=t[h];if(r)var g=o?r(m,f,h,t,e,s):r(f,m,h,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!Tn(t,(function(e,t){if(!Rn(p,t)&&(f===e||i(f,e,n,r,s)))return p.push(t)}))){d=!1;break}}else if(f!==m&&!i(f,m,n,r,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Un(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Bn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var jn=1,Hn=2,Xn="[object Boolean]",Vn="[object Date]",Gn="[object Error]",Wn="[object Map]",Yn="[object Number]",qn="[object RegExp]",Kn="[object Set]",Qn="[object String]",Zn="[object Symbol]",Jn="[object ArrayBuffer]",er="[object DataView]",tr=xe?xe.prototype:void 0,nr=tr?tr.valueOf:void 0;var rr=1,ir=Object.prototype.hasOwnProperty;var sr=1,or="[object Arguments]",ar="[object Array]",cr="[object Object]",lr=Object.prototype.hasOwnProperty;function ur(e,t,n,r,i,s){var o=Ue(e),a=Ue(t),c=o?ar:$n(e),l=a?ar:$n(t),u=(c=c==or?cr:c)==cr,h=(l=l==or?cr:l)==cr,d=c==l;if(d&&Pt(e)){if(!Pt(t))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new pn),o||Dt(e)?zn(e,t,n,r,i,s):function(e,t,n,r,i,s,o){switch(n){case er:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jn:return!(e.byteLength!=t.byteLength||!s(new Ln(e),new Ln(t)));case Xn:case Vn:case Yn:return yt(+e,+t);case Gn:return e.name==t.name&&e.message==t.message;case qn:case Qn:return e==t+"";case Wn:var a=Un;case Kn:var c=r&jn;if(a||(a=Bn),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Hn,o.set(e,t);var u=zn(a(e),a(t),r,i,s,o);return o.delete(e),u;case Zn:if(nr)return nr.call(e)==nr.call(t)}return!1}(e,t,c,n,r,i,s);if(!(n&sr)){var p=u&&lr.call(e,"__wrapped__"),f=h&&lr.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return s||(s=new pn),i(m,g,n,r,s)}}return!!d&&(s||(s=new pn),function(e,t,n,r,i,s){var o=n&rr,a=yn(e),c=a.length;if(c!=yn(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:ir.call(t,u)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.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,s):r(m,g,u,e,t,s);if(!(void 0===y?m===g||i(m,g,n,r,s):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 s.delete(e),s.delete(t),p}(e,t,n,r,i,s))}function hr(e,t,n,r,i){return e===t||(null==e||null==t||!De(e)&&!De(t)?e!=e&&t!=t:ur(e,t,n,r,hr,i))}var dr=1,pr=2;function fr(e){return e==e&&!Ve(e)}function mr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function gr(e){var t=function(e){for(var t=Ht(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,fr(i)]}return t}(e);return 1==t.length&&t[0][2]?mr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var i=n.length,s=i;if(null==e)return!s;for(e=Object(e);i--;){var o=n[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){var a=(o=n[i])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u=new pn;if(!hr(l,c,dr|pr,r,u))return!1}}return!0}(n,0,t)}}function yr(e,t){return null!=e&&t in Object(e)}function br(e,t){return null!=e&&function(e,t,n){for(var r=-1,i=(t=ln(t,e)).length,s=!1;++r<i;){var o=hn(t[r]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&_t(i)&>(o,i)&&(Ue(e)||Et(e))}(e,t,yr)}var _r=1,wr=2;function vr(e,t){return Gt(e)&&fr(t)?mr(hn(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:dn(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?br(n,e):hr(t,r,_r|wr)}}function Sr(e){return Gt(e)?(t=hn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return dn(t,e)}}(e);var t}function Ar(e,t){return hr(e,t)}var kr=wn&&1/Bn(new wn([,-0]))[1]==1/0?function(e){return new wn(e)}:function(){},Er=200;function Ir(e,t){return e&&e.length?function(e,t,n){var r=-1,i=pt,s=e.length,o=!0,a=[],c=a;if(s>=Er){var l=t?null:kr(e);if(l)return Bn(l);o=!1,i=Rn,c=new Nn}else c=t?[]:a;e:for(;++r<s;){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 i(c,h,n)||(c!==a&&c.push(h),a.push(u))}return a}(e,"function"==typeof(n=t)?n:null==n?Ge:"object"==typeof n?Ue(n)?vr(n[0],n[1]):gr(n):Sr(n)):[];var n}const xr=new class{setDevice(e){this.setItem(I,e)}getDevice(){return this.getItem(I)}resetDevice(){this.resetItem(I)}getAnonymousMode(){return this.getItem(B)||!1}setAnonymousMode(e){this.setItem(B,e)}clearAnonymousMode(){this.resetItem(B)}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)}setActiveEntitlements(e,t){this.setItem(e,t)}setNamiEntitlements(e,t){this.setItem(e,t)}getNamiEntitlements(e){return this.getItem(e)||[]}setProducts(e,t){this.setItem(e,t)}getProducts(e){return this.getItem(e)}getCachedProducts(){const e=this.getItem(L)??[];return Ir(Mn([...this.getItem(F)??[],...e]),"sku_ref_id")}setNamiConfig(e){this.setItem(x,e)}getNamiConfig(){return this.getItem(x)}setCustomerAttribute(e,t){this.setItem(U+e,t)}getCustomerAttribute(e){return this.getItem(U+e)}getAllCustomerAttributes(){return Object.keys(localStorage).filter((e=>e.includes(U))).map((e=>e.replace(U,"")))}clearCustomerAttribute(e){const t=U+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}clearAllCustomerAttributes(){Object.keys(localStorage).filter((e=>e.includes(U))).map((e=>this.resetItem(e)))}setNamiProfile(e){this.setItem(C,e)}getNamiProfile(){return this.getItem(C)}removeNamiProfile(){this.resetItem(C)}setSessionCounter(){const e=this.getItem(j),t=e?parseInt(e):H||H;this.setItem(j,t+1)}setLastImpressionId(e){this.setItem(X,e)}getLastImpressionId(){return this.getItem(X)??""}setPurchaseImpression(){const e=this.getLastImpressionId()??"";this.setItem(V,e)}getPurchaseImpression(){return this.getItem(V)??""}setSessionId(e){e&&this.setItem(G,e)}getSessionId(){return this.getItem(G)??""}clearSessionId(){this.resetItem(G)}setItem(e,t){try{const n=JSON.stringify(t);localStorage.setItem(e,n)}catch(e){Ae.error("Error setting item in localStorage:",e)}}getItem(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return Ae.error("Error getting item from localStorage:",e,": ",t),null}}resetItem(e){try{localStorage.removeItem(e)}catch(e){Ae.error("Error removing item from localStorage:",e)}}clear(){try{localStorage.clear()}catch(e){Ae.error("Error clearing localStorage:",e)}}};class Cr extends Error{constructor(e,t){super(t),this.statusCode=e,this.status=e,this.message=`RetryLimitExceededError: ${this.message}`}}class Pr extends Error{constructor(){super(_)}}class Or extends Error{constructor(){super(g)}}class $r extends Error{constructor(){super(y)}}class Lr extends Error{constructor(){super(b)}}class Mr extends Error{constructor(){super(S)}}class Nr extends Error{constructor(){super(A)}}class Tr extends Error{constructor(){super(A)}}class Rr extends Error{constructor(){super(v)}}class Dr extends Error{constructor(e){super(e),this.message=`BadRequestError: ${this.message}`}}class Fr extends Error{constructor(e){super(e),this.message=`NotFoundError: ${this.message}`}}class zr extends Error{constructor(e,t){super(t),this.statusCode=e,this.message=`ClientError: ${this.message}`}}class Ur extends Error{constructor(e){super(e),this.message=`ServerError: ${this.message}`}}const Br=(e,t)=>{if(e==ce)throw new Dr(t);if(e==le)throw new Fr(t);if(e>ce&&e<ue)throw new zr(e,t);if(e>=ue)throw new Ur(t)};async function jr(e,t,n=se,r=re){let i=0;const s=async()=>{const o=await async function(e,t={},n){const r=new AbortController,i=setTimeout((()=>r.abort()),n);t.signal=r.signal;const s=await fetch(e,t);return clearTimeout(i),s}(e,t,n);if(!o.ok){if(i++,i<=r){const e=1e3*(i+ie);return await new Promise((t=>setTimeout(t,e))),s()}throw new Cr(o.status,`Request failed after ${r} retries`)}return o};return(await s()).json()}var Hr;!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",e.ENTITLEMENT_MANAGEMENT="entitlement_management"}(Hr||(Hr={}));const Xr=e=>{let t;if(e?.includes(Z))t=K;else{const n=e?.find((e=>e.includes(Q)));t=n?n.split("=")[1]:q}return t=t.replace(/\/$/,""),t+"/"+Y},Vr=e=>{const t=xr.getAppConfig(P)||xr.getAppConfig(T);return t?.capabilities?.includes(e)??!1},Gr=e=>{const t=!Vr(Hr.THIRD_PARTY_TRANSACTIONS);return e&&!t&&Ae.info(`[${e}] Your plan does not have purchase management features.`),t};function Wr(e,t,n){const r=n.value;return n.value=function(...e){if(!this.platformID)throw new Or;return r.apply(this,e)},n}function Yr(e,t,n){const r=n.value;return n.value=function(...e){const t=xr.getDevice();if(!t?.id)throw new $r;return r.apply(this,e)},n}class qr{get deviceID(){return xr.getDevice()?.id}static configure(e){this.instance.configure(e)}configure(e){this.baseURL=Xr(e.namiCommands),this.platformID=e.appPlatformID}async login(e){if(!e)throw new Lr;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"});xr.setSessionCounter(),n.id&&xr.setSessionId(n.id)}async postImpression(e){const t=`device/${this.deviceID}/impression/`,n=await this.requestBodyAPI(t,e,"POST",!0);n.id&&xr.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 jr(t)}async requestBodyAPI(e,t,n="POST",r=!1,i){const s=`${this.baseURL}/${this.platformID}/`+e,o={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:r};return await jr(s,o,i)}}qr.instance=new qr,h([Yr],qr.prototype,"login",null),h([Yr],qr.prototype,"logout",null),h([Yr],qr.prototype,"startSession",null),h([Yr],qr.prototype,"postImpression",null),h([Yr],qr.prototype,"postConversion",null),h([Yr],qr.prototype,"purchaseValidation",null),h([Wr],qr.prototype,"fetchAPI",null),h([Wr],qr.prototype,"requestBodyAPI",null);var Kr,Qr="object"==typeof Reflect?Reflect:null,Zr=Qr&&"function"==typeof Qr.apply?Qr.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Kr=Qr&&"function"==typeof Qr.ownKeys?Qr.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 ei(){ei.init.call(this)}ei.EventEmitter=ei,ei.prototype._events=void 0,ei.prototype._eventsCount=0,ei.prototype._maxListeners=void 0;var ti=10;function ni(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function ri(e){return void 0===e._maxListeners?ei.defaultMaxListeners:e._maxListeners}function ii(e,t,n,r){var i,s,o,a;if(ni(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=ri(e))>0&&o.length>i&&!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 si(){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 oi(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=si.bind(r);return i.listener=n,r.wrapFn=i,i}function ai(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]: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}(i):li(i,i.length)}function ci(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 li(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(ei,"defaultMaxListeners",{enumerable:!0,get:function(){return ti},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+".");ti=e}}),ei.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},ei.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},ei.prototype.getMaxListeners=function(){return ri(this)},ei.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 i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var o=r[e];if(void 0===o)return!1;if("function"==typeof o)Zr(o,this,t);else{var a=o.length,c=li(o,a);for(let e=0;e<a;++e)Zr(c[e],this,t)}return!0},ei.prototype.addListener=function(e,t){return ii(this,e,t,!1)},ei.prototype.on=ei.prototype.addListener,ei.prototype.prependListener=function(e,t){return ii(this,e,t,!0)},ei.prototype.once=function(e,t){return ni(t),this.on(e,oi(this,e,t)),this},ei.prototype.prependOnceListener=function(e,t){return ni(t),this.prependListener(e,oi(this,e,t)),this},ei.prototype.removeListener=function(e,t){var n,r,i,s,o;if(ni(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(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},ei.prototype.off=ei.prototype.removeListener,ei.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 i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);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},ei.prototype.listeners=function(e){return ai(this,e,!0)},ei.prototype.rawListeners=function(e){return ai(this,e,!1)},ei.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):ci.call(e,t)},ei.prototype.listenerCount=ci,ei.prototype.eventNames=function(){return this._eventsCount>0?Kr(this._events):[]};class ui{constructor(){this.emitter=new ei}static getInstance(){return this.instance||(this.instance=new ui),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 hi={"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"},di={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"},pi={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},fi={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"},mi={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class gi{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=gi.getVersionPrecision(e),i=gi.getVersionPrecision(t);let s=Math.max(r,i),o=0;const a=gi.map([e,t],(e=>{const t=s-gi.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return gi.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(o=s-Math.min(r,i)),s-=1;s>=o;){if(a[0][s]>a[1][s])return 1;if(a[0][s]===a[1][s]){if(s===o)return 0;s-=1}else if(a[0][s]<a[1][s])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,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;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 hi[e]}static getBrowserTypeByAlias(e){return di[e]||""}}const yi=/version\/(\d+(\.?_?\d+)+)/i,bi=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=gi.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=gi.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=gi.getFirstMatch(yi,e)||gi.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=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=gi.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=gi.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=gi.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=gi.getFirstMatch(yi,e)||gi.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=gi.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=gi.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=gi.getFirstMatch(yi,e)||gi.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=gi.getFirstMatch(yi,e)||gi.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=gi.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,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=gi.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=gi.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=gi.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=gi.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=gi.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=gi.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=gi.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=gi.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=gi.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=gi.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=gi.getFirstMatch(yi,e)||gi.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=gi.getFirstMatch(yi,e)||gi.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=gi.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=gi.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=gi.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=gi.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=gi.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=gi.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=gi.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=gi.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=gi.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=gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=gi.getFirstMatch(yi,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:gi.getFirstMatch(t,e),version:gi.getSecondMatch(t,e)}}}];var _i=[{test:[/Roku\/DVP/],describe(e){const t=gi.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:fi.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=gi.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:fi.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=gi.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=gi.getWindowsVersionName(t);return{name:fi.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:fi.iOS},n=gi.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=gi.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=gi.getMacOSVersionName(t),r={name:fi.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=gi.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:fi.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=gi.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=gi.getAndroidVersionName(t),r={name:fi.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=gi.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:fi.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=gi.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||gi.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||gi.getFirstMatch(/\bbb(\d+)/i,e);return{name:fi.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=gi.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:fi.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=gi.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:fi.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:fi.Linux})},{test:[/CrOS/],describe:()=>({name:fi.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=gi.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:fi.PlayStation4,version:t}}}],wi=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=gi.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:pi.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:pi.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:pi.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:pi.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:pi.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:pi.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:pi.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=gi.getFirstMatch(/(ipod|iphone)/i,e);return{type:pi.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:pi.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:pi.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:pi.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:pi.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:pi.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:pi.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:pi.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:pi.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:pi.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:pi.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:pi.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:pi.tv})}],vi=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:mi.Blink};const t=gi.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:mi.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:mi.Trident},n=gi.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:mi.Presto},n=gi.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:mi.Gecko},n=gi.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:mi.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:mi.WebKit},n=gi.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Si{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=gi.find(bi,(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=gi.find(_i,(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=gi.find(wi,(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=gi.find(vi,(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 gi.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach((s=>{const o=e[s];"string"==typeof o?(r[s]=o,i+=1):"object"==typeof o&&(t[s]=o,n+=1)})),n>0){const e=Object.keys(t),n=gi.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=gi.find(e,(e=>this.isPlatform(e)));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=gi.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 i=gi.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)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(gi.compareVersions(i,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 Ai{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Si(e,t)}static parse(e){return new Si(e).getResult()}static get BROWSER_MAP(){return di}static get ENGINE_MAP(){return mi}static get OS_MAP(){return fi}static get PLATFORMS_MAP(){return pi}}const ki={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Ei=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:p,language:"en"};const t=Ai.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:p,language:window.navigator.language};if(n.type&&(r.form_factor=ki[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(ee);n.platform=e[1],n.version=e[2]}return n})(e);r.extended_platform=t.platform,r.extended_platform_version=t.version}return r},Ii=()=>{const e=xr.getNamiConfig();if(e?.formFactor)return e.formFactor;if("undefined"==typeof window)return ki.desktop;const t=Ai.getParser(window.navigator.userAgent).getPlatform();return t.type?ki[t.type]:ki.desktop};class xi{constructor(e){this.currentFormFactor=e}async fetchCampaignRules(e){const t=xr.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})),xr.setCampaignRules(O,n),this.invokeAvailableCampaignsResponseHandler(),n}invokeAvailableCampaignsResponseHandler(e){const t=ui.getInstance().listeners(fe);if(!e){const t=xr.getCampaignRules(O)??[],n=xr.getCampaignRules(R)??[];e=Ir(Mn([...t,...n]),"rule")}t.forEach((t=>{t(e)}))}async getAnonymousCampaigns(){const e="campaign_rules/";let t=null;try{t=await qr.instance.fetchAPI(e)}catch(t){throw Ae.error(Br(t.status,e)),t}return t?.results||[]}async getCampaigns(e){const t=`device/${e}/campaign_rules/`;let n;try{n=await qr.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw Ae.error(Br(e.status,t)),e}return n?.results||[]}fallbackData(){const e=xr.getCampaignRules(O)||xr.getCampaignRules(R);return e?{count:e.length,results:e}:null}}xi.instance=new xi(Ii());class Ci{async createOrUpdateDevice(e){const t=xr.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&&xr.setDevice(t),t}async updateDevice(e,t){const n=await this.requestAPIData(`device/${e}/`,t,"PUT");return n&&xr.setDevice(n),n}async updateDeviceField(e,t){const n={[e]:t},r=xr.getDevice();if(!r?.id)throw new $r;const i=await this.requestAPIData(`device/${r.id}/`,n,"PATCH");return i&&xr.setDevice(i),i}async requestAPIData(e,t,n="POST"){let r;try{r=await qr.instance.requestBodyAPI(e,t,n,!1,oe)}catch(t){if(t instanceof Or)throw t;if(r=xr.getDevice(),!r)return Ae.error(Br(t.status,e)),null}return r}isEqualDevices(e,t){const n={...e,...t};return Ar(Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{}),e)}}Ci.instance=new Ci;class Pi{async fetchProducts(){if(Vr(Hr.THIRD_PARTY_TRANSACTIONS))return[];let e;try{e=await qr.instance.fetchAPI("products/")}catch(t){if(e=this.fallbackData(),!e)throw Ae.error(Br(t.status,"products/")),t}return e?.results&&xr.setProducts(L,e.results),e?.results||[]}fallbackData(){const e=xr.getProducts(L)||xr.getProducts(F);return e?{count:e.length,results:e}:null}}Pi.instance=new Pi;class Oi{async fetchPaywalls(){const e=xr.getDevice();let t;return t=e?.id?await this.getPaywalls(e.id):await this.getAnonymousPaywalls(),t&&xr.setPaywalls($,t),t}async getAnonymousPaywalls(e=p){const t=`paywalls/?sdk_version=${e}`;let n=null;try{n=await qr.instance.fetchAPI(t)}catch(e){throw Ae.error(Br(e.status,t)),e}return n?.results||[]}async getPaywalls(e){const t=`device/${e}/paywalls/`;let n;try{n=await qr.instance.fetchAPI(t)}catch(e){if(n=this.fallbackData(),!n)throw Ae.error(Br(e.status,t)),e}return n?.results||[]}fallbackData(){const e=xr.getPaywalls($)||xr.getPaywalls(D);return e?{count:e.length,results:e}:null}}Oi.instance=new Oi;class $i{async fetchConfig(){let e;try{e=await qr.instance.fetchAPI("config/")}catch(t){if(e=xr.getAppConfig(P)||xr.getAppConfig(T),!e)throw Ae.error(Br(t.status,"config/")),t}return e&&xr.setAppConfig(P,e),e}}$i.instance=new $i;class Li{async startSession(){xr.getAnonymousMode()?Ae.debug("Skipping session start call - anonymous mode"):await qr.instance.startSession(new Date)}}Li.instance=new Li;function Mi(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 Ti(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return t?.billingPeriod}}function Ni(e){if(!e||!e.subscription_period)return[];return Ti(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period)}function Ti(e,t){return e.map((e=>Ri(e,t)))}function Ri(e,t){if(!e)return{};const n=e.promo_period?.count??t?.count,r=e.promo_period?.type??t?.type,i=e.promo_price?.price??e.price,s=e.promo_price?.currency??e.currency;return{priceAmountMicros:1e6*i,priceCurrencyCode:s,billingPeriod:r?`P${n}${r[0].toUpperCase()}`:"",formattedPrice:Fi(s).format(i)}}function Di(e,t=!1,n=!1,r=!1){if(!e)return null;const i=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?/);if(!i)return null;const[s,o,a]=i.slice(1).map((e=>parseInt(e))),c=(e,t,n,r,i,s)=>r?e.toString():n?1===e||t?i:s:1===e||t?`${e} ${i}`:`${e} ${s}`;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(s,t,n,r,"year","years")}return null}function Fi(e){const t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:e})}catch{return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:"USD"})}}const zi=(e,t,n)=>e&&t&&n?n.format(e-t):null,Ui=(e,t,n,r)=>{if(e&&t&&n&&r){const i=100*(1-e/(n/r*t));return`${Math.round(i)}%`}return null},Bi=(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))},ji=e=>Xi(e.priceAmountMicros)/Hi(e.billingPeriod),Hi=e=>{let t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Xi=e=>e/1e6;function Vi(e){return parseFloat((Math.round(e)/100).toFixed(2))}const Gi={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},Wi=(e,t,n,r=[])=>{const i=Gi[e];if(!t)return i;return(0,{price:()=>Yi(t),name:()=>t?.name,title:()=>t?.name,description:()=>t?.description,duration:()=>qi(t),durationSingular:()=>qi(t,!0),period:()=>qi(t,!1,!0),periodNumber:()=>qi(t,!1,!1,!0),freeTrialDuration:()=>Ki(t),freeTrialDurationSingular:()=>Ki(t,!0),freeTrialPeriod:()=>Ki(t,!1,!0),freeTrialPeriodNumber:()=>Ki(t,!1,!1,!0),pricePerMonth:()=>Qi(t),pricePerMonthRounded:()=>Qi(t,!0),periodInMonths:()=>Zi(t),durationInMonths:()=>Ji(t),durationInMonthsSingular:()=>Ji(t,!0),periodNumberInMonths:()=>es(t),percentagePriceDifferenceFromSku:()=>ts(t,n,r),priceDifferenceFromSku:()=>ns(t,n,r),promoEligible:()=>null===rs(t)&&null!==is(t,n),freeTrialEligible:()=>null!==rs(t),promo:()=>is(t,n)?.offer_ref_id,promoCode:()=>"XXXXX",promoPrice:()=>ss(t,n)?.formattedPrice,promoPeriod:()=>os(t,n,!1,!0),promoPeriodNumber:()=>os(t,n,!1,!1,!0),promoDuration:()=>os(t,n),promoDurationSingular:()=>os(t,n,!0),introEligible:()=>!1,pricePerDay:()=>as(t),pricePerWeek:()=>cs(t),pricePerWeekRounded:()=>cs(t,!0),introductoryPrice:()=>ls(t,n),introductoryPeriod:()=>us(t,n,!1,!0),introductoryPeriodNumber:()=>us(t,n,!1,!1,!0),introductoryDuration:()=>us(t,n),introductoryDurationSingular:()=>us(t,n,!0),introductoryPricePerMonth:()=>hs(t,n),introductoryPricePerMonthRounded:()=>hs(t,n,!0),invalid:()=>!1,unavailable:()=>!1}[e])()??i??null},Yi=e=>{if("subscription"===e?.product_type){const t=Ni(e);return t&&t.length?t[0].formattedPrice:null}return null},qi=(e,t,n,r)=>Di(function(e){if("subscription"===e?.product_type){const t=Ni(e);if(t.length>0)return t[0].billingPeriod}}(e),t,n,r),Ki=(e,t,n,r)=>Di(Mi(e),t,n,r),Qi=(e,t)=>{const n=Ni(e);if(!n||0===n.length)return null;const r=ji(n[0]);return r?Fi(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Zi=e=>{const t=Ni(e);return"P1Y"===t[0].billingPeriod&&(t[0].billingPeriod="P12M"),t&&t.length?Di(t[0].billingPeriod):null},Ji=(e,t,n,r)=>{const i=Ni(e);return i&&0!==i.length?("P1Y"===i[0].billingPeriod&&(i[0].billingPeriod="P12M"),Di(i[0].billingPeriod,t,n,r)):null},es=e=>{if(!e)return 0;const t=Ni(e);return t&&t.length?Hi(t[0].billingPeriod):0},ts=(e,t,n=[])=>{const r=Ni(e);if(!r||0===r.length)return null;const i=Bi(n,t??"")?.product_details;if(!t||!i)return Ui(Vi(r[0].priceAmountMicros),es(e));const s=Ni(i);return Ui(Vi(r[0].priceAmountMicros),es(e),s?.length>0?Vi(s[0].priceAmountMicros):0,es(i))},ns=(e,t,n=[])=>{const r=Ni(e);if(!r||0===r.length)return null;const i=Bi(n,t??"")?.product_details;if(!t||!i)return zi(ji(r[0]));const s=Ni(i);return zi(ji(r[0]),ji(s[0]),Fi(s[0].priceCurrencyCode))},rs=e=>Mi(e),is=(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)},ss=(e,t)=>{if(!e)return null;return Ri(is(e,t),e.subscription_period)},os=(e,t,n,r,i)=>{const s=ss(e,t);return Di(s?.billingPeriod,n,r,i)},as=(e,t)=>{const n=Ni(e);if(!n||0===n.length)return null;const r=Xi(n[0].priceAmountMicros)/(e=>{const t=Hi(e);return t?30.437*t:1})(n[0].billingPeriod);return r?Fi(n[0].priceCurrencyCode).format(r):null},cs=(e,t)=>{const n=Ni(e);if(!n||0===n.length)return null;const r=Xi(n[0].priceAmountMicros)/(e=>{const t=Hi(e);return t?52*t/12:1})(n[0].billingPeriod);return r?Fi(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},ls=(e,t)=>{const n=ds(e,t);return n?.formattedPrice||null},us=(e,t,n,r,i)=>{const s=ds(e,t);return Di(s?.billingPeriod,n,r,i)},hs=(e,t,n)=>{const r=ds(e,t);if(!r)return;const i=Xi(r.priceAmountMicros),s=Hi(r.billingPeriod),o=n?Math.round(i/s):i/s;return Fi(r.priceCurrencyCode).format(o)},ds=(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],Ri(n,e.subscription_period)};function ps(e,t,n){if(!t)return{};const r=t.variables;return r&&Object.keys(r).forEach((t=>{var i;"string"==typeof r[t]&&r[t].includes("${")&&(r[t]=(i=r[t]).replace(ye,((t,r)=>{const s=ye.exec(i)?.slice(1)||[];r=s[0]??r;const o=s[1]?.replace(":","")??"";return Wi(r,e,o,n)})))})),{...t,...r}}function fs(e,t,n){return gs(t,n)?.some((()=>1==Wi("freeTrialEligible",ms(e,""))))??!1}function ms(e=[],t){return e.find((e=>e.name===t))||null}function gs(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}function ys(e){return!e||"object"==typeof e&&0==Object.keys(e).length}const bs={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign: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 _s=new class{constructor(){this.host=null,this.state=bs,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,n){this.state.paywallId!=e.id||n||(n=this.state.selectedCampaign);let r={...this.state,selectedPaywall:e,selectedCampaign:n};if(!ys(e)){const n=e.template.initialState.groups?.map((e=>e.ref))||[],i=function(e,t,n){const r=t?.find((e=>n===e.id))?.products||[];return r.map((t=>{t.product_details=ms(e,t.name||"")})),r.forEach((e=>{ps(e.product_details,e,r)})),r||[]}(this.productDetails,e.sku_menus,e.template.initialState.currentGroupId);r={...r,...e.template.initialState},r.skuItems=i,r.launch=t||{...this.state.launch,productGroups:n},r.anySkuHasTrialOffer=fs(this.productDetails,e.sku_menus,n),r.anySkuHasPromoOffer=function(e,t,n){return!fs(e,t,n)&&(gs(t,n)?.some((()=>1==Wi("promoEligible",ms(e,""))))??!1)}(this.productDetails,e.sku_menus,n),r.paywallId=e.id,r.sku=function(e,t,n,r){const i=n?.flatMap((e=>e.products)).find((e=>e.id===t.selectedProducts[t.currentGroupId]));return ps(ms(e,i?.name??""),i,r)}(this.productDetails,e.template.initialState,e.sku_menus,i)}this.setState(r)}getSelectedPaywall(){return this.state.selectedPaywall}getSelectedCampaign(){return this.state.selectedCampaign}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})}getFormFactor(){return this.state.formFactor}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})}setAppSuppliedVideoDetails({url:e,name:t}){this.setState({...this.state,appSuppliedVideoUrl:e,appSuppliedVideoName:t})}resetAppSuppliedVideoDetails(){delete this.state.appSuppliedVideoUrl,delete this.state.appSuppliedVideoName,this.setState(this.state)}setLaunchDetails(e,t){this.setState({...this.state,launchValue:e,launchType:t})}};class ws{constructor(){this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}}}ws.instance=new ws;const vs=()=>Ir(Mn([...xr.getNamiEntitlements(N),...xr.getNamiEntitlements(z)]),"referenceId"),Ss=()=>{ui.getInstance().emit(ge,vs())};function As(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type,entitlements:e.entitlements,productDetails:"product_details"in e?e.product_details:null}}class ks{constructor(){}async fetchActiveEntitlements(){let e=null;if(xr.getAnonymousMode()||Vr(Hr.THIRD_PARTY_TRANSACTIONS)||!Vr(Hr.ENTITLEMENT_MANAGEMENT))xr.getAnonymousMode()&&Ae.debug("Skipping active entitlements update - anonymous mode"),Vr(Hr.THIRD_PARTY_TRANSACTIONS)&&Ae.debug("Skipping active entitlements update - paywalls-only mode"),Vr(Hr.ENTITLEMENT_MANAGEMENT)||Ae.debug("Skipping active entitlements update - no entitlement_management capability");else{const t=xr.getDevice();if(t?.id){const n=await this.getAPIEntitlements(t.id);e=n?.results,e&&(xr.setActiveEntitlements(M,e),this.invokeActiveEntitlementsHandler(e))}}return e}async getAPIEntitlements(e){const t=`device/${e}/active_entitlements/`;let n={};try{n=await qr.instance.fetchAPI(t)}catch(e){throw Ae.error(Br(e.status,t)),e}return n}invokeActiveEntitlementsHandler(e){if(Gr()){(e=>{xr.setNamiEntitlements(N,e);const t=xr.getNamiEntitlements(z),n=new Set(e.map((e=>e.referenceId))),r=t.filter((e=>{const t=n.has(e.referenceId);return t&&Ae.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t}));r.length!==t.length&&xr.setNamiEntitlements(z,r),Ss()})(e.map((e=>(e=>{const t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:ws.instance.refIdToRelatedSKUs[t]||[],activePurchases:ws.instance.refIdToActivePurchases[t]||[],purchasedSkus:ws.instance.refIdToPurchasedSKUs[t]||[]}})(e))))}}}var Es;ks.instance=new ks,function(e){e.DEFAULT="default",e.LABEL="label",e.UNKNOWN="unknown",e.URL="url"}(Es||(Es={}));const Is=()=>Ir(Mn([...xr.getPaywalls($)??[],...xr.getPaywalls(D)??[]]),"id"),xs=e=>{try{return Boolean(new URL(e))}catch{return!1}},Cs=()=>Ir(Mn([...xr.getCampaignRules(O)??[],...xr.getCampaignRules(R)??[]]),"rule"),Ps=(e,t)=>{const n=Mn(Cs().filter((n=>t?n.type==t&&n.value==e:n.type==Es.DEFAULT))),r=Is().find((e=>n.find((t=>t.paywall===e.id)))),i=n.find((e=>e.paywall===r?.id));return{campaign:i,paywall:r}};class Os{async init(e){this.setInitialValues(e),await this.initAndFetchRequiredData(e)}setInitialValues(e){xr.clearSessionId(),xr.setNamiConfig(e);const t=e.initialConfig;if(t.campaign_rules&&xr.setCampaignRules(R,t.campaign_rules),t.appConfig||t.platform_config){const e=t?.appConfig||t?.platform_config;e&&xr.setAppConfig(T,e)}t?.paywalls&&xr.setPaywalls(D,t.paywalls),t?.products&&xr.setProducts(F,t.products)}async initAndFetchRequiredData(e){$i.instance.fetchConfig();let t=null;if(!xr.getAnonymousMode()){const n=Ei(e.namiCommands);e.formFactor&&(n.form_factor=e.formFactor),t=await Ci.instance.createOrUpdateDevice(n)}const n=e.formFactor??t?.form_factor??Ii();_s.setFormFactor(n),xi.instance.currentFormFactor=n;const r=Promise.all([Pi.instance.fetchProducts(),ks.instance.fetchActiveEntitlements(),Oi.instance.fetchPaywalls().then((e=>xi.instance.fetchCampaignRules(e)))]),i=e.initialConfig;i.campaign_rules?.length&&i.paywalls?.length||await r,r.then((()=>this.reRenderPaywall())),Li.instance.startSession()}reRenderPaywall(){if("undefined"==typeof document)return;const{launchValue:e,launchType:t}=_s.state,{campaign:n,paywall:r}=Ps(e,t),i=document.querySelector("nami-paywall");i&&r&&n&&i.setPaywallData(r,n)}}var $s,Ls;Os.instance=new Os;class Ms{constructor(){$s.set(this,!1)}get isInitialized(){return d(this,$s,"f")}static async configure(e){if(!e.appPlatformID)throw new Or;return this.setInitialConfig(e),await Ms.instance.initializeSDK(e)}static setInitialConfig(e){let t={};if(e.initialConfig)if("string"==typeof e.initialConfig)try{t=JSON.parse(e.initialConfig)}catch{Ae.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=d(this,$s,"f")?xr.getNamiConfig():null;if(Ae.setLogger(e.logLevel),null!==r){if(Ar(e,r))return Ae.warn("Nami SDK is already configured, ignoring this configure call."),{sdkInitialized:!0,configureState:pe};n=!0;const i=Xr(e.namiCommands),s=Xr(r.namiCommands);e.appPlatformID==r.appPlatformID&&i==s||(t=!0),e.namiLanguageCode===r.namiLanguageCode&&e.logLevel==r.logLevel||(n=!0)}t&&(Ae.info("SDK full reconfigure called"),xr.resetDevice()),function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(this,$s,!0,"f"),qr.configure(e),await Os.instance.init(e),Ae.info("SDK successfully initialized!");return{sdkInitialized:!0,configureState:n||t?de:he}}}$s=new WeakMap,Ms.instance=new 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"}(Ls||(Ls={}));class Ns{constructor(){this.load()}setExternalId(e){return this.externalId=e,this}getExternalId(){return this.externalId}isLoggedIn(){return!!this.externalId}save(){return this.externalId?xr.setNamiProfile({externalId:this.externalId}):xr.removeNamiProfile(),this}load(){const e=xr.getNamiProfile();e&&(this.externalId=e.externalId)}async login(e){const t=await qr.instance.login(e);t.external_id&&_s.setIsLoggedIn(!0),this.setExternalId(t.external_id).save()}async logout(){await qr.instance.logout(),_s.setIsLoggedIn(!1),this.setExternalId(void 0).save()}}var Ts;Ns.instance=new Ns,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"}(Ts||(Ts={}));class Rs{constructor(){this.emitter=ui.getInstance()}static isLoggedIn(){return Ns.instance.isLoggedIn()}static loggedInId(){return this.instance.isSDKInitialized||Ae.debug(_),Ns.instance.getExternalId()}static async login(e){if(!this.instance.isSDKInitialized){const e=new Pr;throw this.invokeStateHandler(Ts.LOGIN,!1,e),e}if(this.inAnonymousMode()){const e=new Tr;throw this.invokeStateHandler(Ts.LOGIN,!1,e),e}try{await Ns.instance.login(e),await ks.instance.fetchActiveEntitlements(),this.invokeStateHandler(Ts.LOGIN,!0)}catch(e){throw this.invokeStateHandler(Ts.LOGIN,!1,e),e}}static async logout(){if(!this.instance.isSDKInitialized){const e=new Pr;throw this.invokeStateHandler(Ts.LOGOUT,!1,e),e}if(this.inAnonymousMode()){const e=new Tr;throw this.invokeStateHandler(Ts.LOGOUT,!1,e),e}try{await Ns.instance.logout(),await ks.instance.fetchActiveEntitlements(),this.invokeStateHandler(Ts.LOGOUT,!0)}catch(e){throw this.invokeStateHandler(Ts.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?Ts.ANONYMOUS_MODE_ON:Ts.ANONYMOUS_MODE_OFF;if(!this.instance.isSDKInitialized){const e=new Pr;throw this.invokeStateHandler(t,!1,e),e}if(this.anonymousModeCapability())if(this.inAnonymousMode()!==e)if(e)xr.setAnonymousMode(e),xr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Ts.ANONYMOUS_MODE_ON,!0);else{xr.clearAnonymousMode();const e=xr.getNamiConfig()?.namiCommands;await Ci.instance.createOrUpdateDevice(Ei(e)),this.refetchConfig(),this.invokeStateHandler(Ts.ANONYMOUS_MODE_OFF,!0)}else{const n=e?new Mr:new Nr;this.invokeStateHandler(t,!1,n)}else Ae.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details.")}static inAnonymousMode(){return!!this.instance.isSDKInitialized&&xr.getAnonymousMode()}static setCustomerAttribute(e,t){if(!this.instance.isSDKInitialized)throw new Pr;xr.setCustomerAttribute(e,t),Vr(Hr.PAYWALL_PERSONALIZATION)?(_s.setCustomerAttribute({[e]:t}),Ae.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Ae.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 Pr;const t=xr.getCustomerAttribute(e);return null!=t?Vr(Hr.PAYWALL_PERSONALIZATION)?Ae.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Ae.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.`):Ae.warn(`No ${e} customer attribute found.`),t}static clearCustomerAttribute(e){if(!this.instance.isSDKInitialized)throw new Pr;xr.clearCustomerAttribute(e)?(_s.removeCustomerAttribute(e),Ae.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.`)):Ae.warn(`No value to clear for attribute ${e}.`)}static clearAllCustomerAttributes(){if(!this.instance.isSDKInitialized)throw new Pr;xr.getAllCustomerAttributes().forEach((e=>{_s.removeCustomerAttribute(e)})),xr.clearAllCustomerAttributes(),Ae.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 Ms.instance.isInitialized}static async updateCustomerDataPlatformId(e){if(!this.instance.isSDKInitialized){const e=new Pr;throw this.invokeStateHandler(Ts.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}if(this.inAnonymousMode()){const e=new Rr;throw this.invokeStateHandler(Ts.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e),e}try{await Ci.instance.updateDeviceField("customer_data_platform_id",e),this.invokeStateHandler(Ts.CUSTOMER_DATA_PLATFORM_ID_SET,!0)}catch(e){this.invokeStateHandler(Ts.CUSTOMER_DATA_PLATFORM_ID_SET,!1,e)}}static anonymousModeCapability(){if(!this.instance.isSDKInitialized)return!1;const e=Vr(Hr.ANONYMOUS_MODE_CAPABILITY),t=Vr(Hr.THIRD_PARTY_TRANSACTIONS);return e&&t}static async refetchConfig(){this.instance.isSDKInitialized&&await Promise.all([Pi.instance.fetchProducts(),Oi.instance.fetchPaywalls().then((e=>xi.instance.fetchCampaignRules(e)))])}}Rs.instance=new Rs;class Ds{constructor(){this.emitter=ui.getInstance()}static allPaywalls(){if(!this.instance.sdkInitialized)throw new Pr;return Is()}static setProductDetails(e){this.instance.productDetails=e,_s.setProductDetails(e)}static registerSignInHandler(e){return this.instance.emitter.addListener(Ls.PAYWALL_SIGNIN_REQUESTED,e),()=>{this.instance.emitter.removeListener(Ls.PAYWALL_SIGNIN_REQUESTED,e)}}static registerCloseHandler(e){return this.instance.emitter.addListener(Ls.PAYWALL_CLOSE_REQUESTED,e),()=>{this.instance.emitter.removeListener(Ls.PAYWALL_CLOSE_REQUESTED,e)}}static registerDeeplinkActionHandler(e){return this.instance.emitter.addListener(Ls.PAYWALL_DEEPLINK_ACTION,e),()=>{this.instance.emitter.removeListener(Ls.PAYWALL_DEEPLINK_ACTION,e)}}static registerBuySkuHandler(e){return Gr()&&Ae.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(Ls.REGISTER_BUY_SKU,e),()=>{this.instance.emitter.removeListener(Ls.REGISTER_BUY_SKU,e)}}static registerRestoreHandler(e){return this.instance.emitter.addListener(Ls.PAYWALL_RESTORE_REQUESTED,e),()=>{this.instance.emitter.removeListener(Ls.PAYWALL_RESTORE_REQUESTED,e)}}static async buySkuComplete(e){if(_s.setPurchaseInProgress(!1),Rs.inAnonymousMode())return void Ae.debug("Skipping purchase validation - anonymous mode");const t=xr.getSessionId(),n=xr.getPurchaseImpression();if(n){try{await(async e=>{if(xr.getAnonymousMode())Ae.info("Skipping transaction post - anonymous mode");else try{await qr.instance.postConversion(e)}catch(e){Ae.error("Error posting conversion",e)}})({purchase_env:"production",app_env:"production",impression:n,session:t,amount:e.amount,currency:e.currency,transaction_id:e.transactionId,sku:e.skuId})}catch(e){Ae.error("Error posting conversion",e)}if(!Vr(Hr.THIRD_PARTY_TRANSACTIONS))try{await qr.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId})}catch(e){Ae.error("Error validating purchase",e)}}else Ae.debug("Not sending paywall conversion call complete due to unknown impression")}static buySkuCancel(){Vr(Hr.THIRD_PARTY_TRANSACTIONS)?_s.setPurchase(!1):Ae.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}static setAppSuppliedVideoDetails(e,t){xs(e)?(Ae.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),_s.setAppSuppliedVideoDetails({url:e,name:t})):Ae.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}get sdkInitialized(){return Ms.instance.isInitialized}}Ds.instance=new Ds;const Fs=e`
|
|
2
2
|
:host {
|
|
3
3
|
-webkit-font-smoothing: antialiased;
|
|
4
4
|
}
|
|
@@ -15,18 +15,18 @@ import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as s,svg as
|
|
|
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
|
-
`;class xi{constructor(e){this.host=e,this.state=_i.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_i.subscribe(this.handleStateChange)}handleStateChange(){this.state=_i.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_i.unsubscribe(this.handleStateChange)}}const Ei=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ii=globalThis,Ci=Ii.ShadowRoot&&(void 0===Ii.ShadyCSS||Ii.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pi=Symbol(),Oi=new WeakMap;let $i=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Pi)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(Ci&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Oi.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Oi.set(t,e))}return e}toString(){return this.cssText}};const Mi=(e,t)=>{if(Ci)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Ii.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Li=Ci?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new $i("string"==typeof e?e:e+"",void 0,Pi))(t)})(e):e,{is:Ri,defineProperty:Ti,getOwnPropertyDescriptor:Ni,getOwnPropertyNames:Di,getOwnPropertySymbols:zi,getPrototypeOf:Fi}=Object,Ui=globalThis,Bi=Ui.trustedTypes,ji=Bi?Bi.emptyScript:"",Xi=Ui.reactiveElementPolyfillSupport,Hi=(e,t)=>e,Vi={toAttribute(e,t){switch(t){case Boolean:e=e?ji: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}},Gi=(e,t)=>!Ri(e,t),Yi={attribute:!0,type:String,converter:Vi,reflect:!1,hasChanged:Gi};Symbol.metadata??=Symbol("metadata"),Ui.litPropertyMetadata??=new WeakMap;class Wi 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=Yi){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&&Ti(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=Ni(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)??Yi}static _$Ei(){if(this.hasOwnProperty(Hi("elementProperties")))return;const e=Fi(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Hi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Hi("properties"))){const e=this.properties,t=[...Di(e),...zi(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(Li(e))}else void 0!==e&&t.push(Li(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 Mi(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:Vi).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:Vi;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??Gi)(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){}}Wi.elementStyles=[],Wi.shadowRootOptions={mode:"open"},Wi[Hi("elementProperties")]=new Map,Wi[Hi("finalized")]=new Map,Xi?.({ReactiveElement:Wi}),(Ui.reactiveElementVersions??=[]).push("2.0.4");const qi={attribute:!0,type:String,converter:Vi,reflect:!1,hasChanged:Gi},Ki=(e=qi,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 Qi(e){return(t,n)=>"object"==typeof n?Ki(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 Zi extends t{constructor(){super(),this.contextConsumer=new xi(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Ai,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Ai,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}Me([Qi({type:Object})],Zi.prototype,"contextConsumer",void 0);const Ji=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 eo=class extends Zi{constructor(e,t,n,r,s){super(),_i.setPaywall(e,s),_i.setFormFactor(t),this.formFactor=t,this.paywall=e,this.paywallEvent=n,r&&(this.campaign=r)}firstUpdated(){_i.setTimeSpentOnPaywall(Date.now()),(async e=>{if(ge.getAnonymousMode())return void me.info("Skipping paywall impression - anonymous mode");const t=ge.getSessionId();t&&(e.session=t),e.app_env="production",me.info("Post paywall impression - segment ",e.segment);try{await Ue.instance.postImpression(e)}catch(e){me.error("Error posting impression",e)}})({segment:this.campaign.segment,call_to_action:this.paywall.id}),ss.getInstance().emit(ce,{action:$s.SHOW_PAYWALL,...this.paywallEvent})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template.pages.find((t=>t.name===e))||{}}styles(){return e`
|
|
18
|
+
`;class zs{constructor(e){this.host=e,this.state=_s.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_s.subscribe(this.handleStateChange)}handleStateChange(){this.state=_s.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_s.unsubscribe(this.handleStateChange)}}const Us=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Bs=globalThis,js=Bs.ShadowRoot&&(void 0===Bs.ShadyCSS||Bs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Xs=new WeakMap;let Vs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hs)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(js&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Xs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xs.set(t,e))}return e}toString(){return this.cssText}};const Gs=(e,t)=>{if(js)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Bs.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Ws=js?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Vs("string"==typeof e?e:e+"",void 0,Hs))(t)})(e):e,{is:Ys,defineProperty:qs,getOwnPropertyDescriptor:Ks,getOwnPropertyNames:Qs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,eo=globalThis,to=eo.trustedTypes,no=to?to.emptyScript:"",ro=eo.reactiveElementPolyfillSupport,io=(e,t)=>e,so={toAttribute(e,t){switch(t){case Boolean:e=e?no: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}},oo=(e,t)=>!Ys(e,t),ao={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;class co 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=ao){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&&qs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=Ks(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const s=r?.call(this);i.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ao}static _$Ei(){if(this.hasOwnProperty(io("elementProperties")))return;const e=Js(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(io("properties"))){const e=this.properties,t=[...Qs(e),...Zs(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(Ws(e))}else void 0!==e&&t.push(Ws(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 Gs(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 i=(void 0!==n.converter?.toAttribute?n.converter:so).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),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),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:so;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??oo)(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){}}co.elementStyles=[],co.shadowRootOptions={mode:"open"},co[io("elementProperties")]=new Map,co[io("finalized")]=new Map,ro?.({ReactiveElement:co}),(eo.reactiveElementVersions??=[]).push("2.0.4");const lo={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo},uo=(e=lo,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,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 i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function ho(e){return(t,n)=>"object"==typeof n?uo(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 po extends t{constructor(){super(),this.contextConsumer=new zs(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Fs,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Fs,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}h([ho({type:Object})],po.prototype,"contextConsumer",void 0);const fo=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()};var mo;!function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.DEEPLINK="DEEPLINK",e.TOGGLE_CHANGE="TOGGLE_CHANGE",e.PAGE_CHANGE="PAGE_CHANGE",e.SLIDE_CHANGE="SLIDE_CHANGE",e.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",e.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",e.VIDEO_STARTED="VIDEO_STARTED",e.VIDEO_PAUSED="VIDEO_PAUSED",e.VIDEO_RESUMED="VIDEO_RESUMED",e.VIDEO_ENDED="VIDEO_ENDED",e.VIDEO_CHANGED="VIDEO_CHANGED",e.VIDEO_MUTED="VIDEO_MUTED",e.VIDEO_UNMUTED="VIDEO_UNMUTED",e.UNKNOWN="UNKNOWN"}(mo||(mo={}));let go=class extends po{constructor(e,t,n,r){super(),_s.setPaywall(e,r,n),this.formFactor=_s.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,_s.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){_s.setTimeSpentOnPaywall(Date.now()),ys(this.paywall)||this.postImpression(this.paywall,this.campaign),ui.getInstance().emit(me,{...this.paywallEvent,action:mo.SHOW_PAYWALL})}postImpression(e,t){(async e=>{if(xr.getAnonymousMode())return void Ae.info("Skipping paywall impression - anonymous mode");const t=xr.getSessionId();t&&(e.session=t),e.app_env="production",Ae.info("Post paywall impression - segment ",e.segment);try{await qr.instance.postImpression(e)}catch(e){Ae.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e`
|
|
19
19
|
:host {
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
width: 100%;
|
|
22
22
|
position: relative;
|
|
23
23
|
display: inline-block;
|
|
24
|
-
}`}render(){const{state:e}=this.contextConsumer,t=this.getTemplate()
|
|
24
|
+
}`}render(){const{state:e}=this.contextConsumer,t=this.getTemplate();if(ys(this.paywall))return r``;const{backgroundContainer:n,header:i=[],footer:s=[],contentContainer:o}=t;e.selectedPaywall&&"undefined"!=typeof document&&function(e){const t=Object.values(e).map((({id:e,family:t,style:n,file:r})=>("production"===m&&(r=r.replace(_e,we)),{id:e,family:t,style:n,file:r})));fo(t)}(e.selectedPaywall.fonts);const a=e.fullScreenPresentation??!1;return r`
|
|
25
25
|
<nami-background-container
|
|
26
26
|
.component=${n}
|
|
27
27
|
></nami-background-container>
|
|
28
28
|
<nami-header
|
|
29
|
-
.components=${
|
|
29
|
+
.components=${i}
|
|
30
30
|
.inFullScreen=${a}
|
|
31
31
|
></nami-header>
|
|
32
32
|
<nami-content-container
|
|
@@ -34,14 +34,16 @@ import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as s,svg as
|
|
|
34
34
|
.device=${this.formFactor}>
|
|
35
35
|
</nami-content-container>
|
|
36
36
|
<nami-footer
|
|
37
|
-
.components=${
|
|
37
|
+
.components=${s}>
|
|
38
38
|
</nami-footer>
|
|
39
|
-
`}};var to;eo=Me([Ei("nami-paywall")],eo),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"}(to||(to={}));class no{constructor(){this.emitter=ss.getInstance()}static{this.instance=new no}static allCampaigns(){if(!this.instance.sdkInitialized)throw new be;return Xr(Kn([...ge.getCampaignRules(C)??[],...ge.getCampaignRules(M)??[]]),"rule")}static isCampaignAvailable(e){if(!this.instance.sdkInitialized)throw new be;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=Kn(this.allCampaigns().filter((e=>e.type===t&&e.value===n)));return r=r.flatMap((e=>{const t=ki.allPaywalls().find((t=>t.id===e.paywall));return t?[e]:[]})),r.length>0}static async refresh(){if(!this.instance.sdkInitialized)throw new be;const e=await As.instance.fetchPaywalls();return await vs.instance.fetchCampaignRules(e),this.allCampaigns()}static registerAvailableCampaignsHandler(e){return this.instance.emitter.addListener(ae,e),()=>{this.instance.emitter.removeListener(ae,e)}}static launch(e,t,n,r,s){let i;r=r??(()=>{});let o="";if(e?(o=e,i=Ps.LABEL):t&&(o=t,i=Ps.URL),!this.instance.sdkInitialized)throw r(!1,to.SDK_NOT_INITIALIZED),new be;const a=Kn(this.allCampaigns().filter((e=>i?e.type==i&&e.value==o:e.type==Ps.DEFAULT))),c=ki.allPaywalls().find((e=>a.find((t=>t.paywall===e.id))));if(!c){let n;throw n=e?to.LABELED_CAMPAIGN_NOT_FOUND:t?to.URL_CAMPAIGN_NOT_FOUND:to.DEFAULT_CAMPAIGN_NOT_FOUND,r(!1,n),new Se}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 eo(c,vs.instance.currentFormFactor,u,l,n);return s&&this.instance.emitter.addListener(ce,(({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 Cs.instance.isInitialized}}const ro={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},so={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},io={top:"start",left:"start",right:"end",bottom:"end",center:"center"};function oo(e){let t;return t="number"==typeof e?`${e}px`:"fitContent"==e?"fit-content":e,`${t} !important`}function ao(e){return e.includes("gradient")?`background-image: ${e};`:`background-color: ${e};`}function co(e,t){return t&&e.focusedFillColor?ao(e.focusedFillColor):ao(e.fillColor||"transparent")}function lo({direction:e}){return`flex-direction: ${"vertical"===e?"column":"row"};`}function uo(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 ho({alignment:e}){return`\n justify-content: ${e&&io[e]||"center"};\n `}function po(e){return e?"\n text-decoration: line-through;\n text-decoration-thickness: auto;\n ":""}function fo({fontName:e}){const[t]=(e||"").split("-");return`font-family: '${e}', '${t}', 'Helvetica';`}function mo(e,t){return`\n transition: all 0.3s;\n ${function({grow:e}){return e?"flex-grow: 1;":""}(e)}\n ${uo(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=>`${ro[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=>`${so[e]}: solid;`)).join("\n"):"border-style: solid;"}\n ${i}\n `}(e,t)}\n ${function({alignment:e}){return`\n align-items: ${e&&io[e]||"center"};\n `}(e)}\n ${ho(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: ${oo(t)};`:""}\n ${void 0!==n?`height: ${oo(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 go(e){if(!e)return"";const[t,n]=e.split("-");return`\n align-self: ${t};\n ${n}: 0;\n `}let yo=class extends Zi{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const e=this.component,t=e.height||e.fixedHeight||e.width||e.fixedWidth;return s(`\n :host {\n display: block;\n ${t?"":"flex-grow: 1;"}\n ${mo(e,this.inFocusedState)}\n }\n `)}render(){return r``}};function bo(e,t){return Array.isArray(e)?e.reduce(((e,n)=>{const r=bo(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:bo(r,t);return{...e,[n]:s}}),{}):"string"==typeof e?Ao(e,t):e}function _o(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=xo(t),r.components&&n(r.components)};n(e)}(t,e);const a={sku:o,media:ko(n,{convertToUrl:!0})};return[e.featured??!1,bo(t,bo(a,a))]}),[])}function wo(e){return e.assertions?e.assertions.every(So):!!e.orAssertions&&(!e.orAssertions.length||e.orAssertions.some(So))}function vo(e,t){const n=_i.state,r={state:n,launch:n.launch,sku:n.sku,customer:n.customer};return"string"==typeof e&&e.startsWith("${")&&(e=Ao(e,r)),e}function So({value:e,expected:t,operator:n}){const r=/\${[A-Za-z.]+}/g;return e=vo(e),t=vo(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 ko(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 Ao(e,t){let n=e;if("string"!=typeof e)return n;for(const[s,i]of Array.from(e.matchAll(ue))){const o=Ao(i,t);if(s===e)return r(s,o);o!==i&&(n=n.replace(i,o)),n=n.replace(ue,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:Ao(r,t)}}function xo(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type,entitlements:e.entitlements,productDetails:e.product_details}}Me([Qi({type:Object})],yo.prototype,"component",void 0),Me([Qi({type:Boolean})],yo.prototype,"inFocusedState",void 0),yo=Me([Ei("nami-spacer")],yo);function Eo(e,t){if("condition"===e.component){if(!wo(e))return null;const n=e.components?.map((e=>Eo(e,t)));return n}return e.conditionAttributes&&(e=function({conditionAttributes:e,...t}){return e?e.reduce(((e,t)=>wo(t)?(Object.entries(t.attributes).forEach((([e,n])=>{t.attributes[e]=vo(n)})),{...e,...t.attributes}):e),t):t}(e)),Object.keys(e).forEach((t=>{e[t]=vo(e[t])})),((e,t)=>{const n=e.component;switch(n){case"spacer":return r`<nami-spacer .component=${e} .inFocusedState=${t}></nami-spacer>`;case"button":return r`<nami-button .component=${e} .inFocusedState=${t}></nami-button>`;case"text":return r`<nami-text .component=${e} .inFocusedState=${t}></nami-text>`;case"text-list":return r`<nami-text-list .component=${e} .inFocusedState=${t}></nami-text-list>`;case"segmentPicker":return r`<nami-segment-picker .component=${e} .inFocusedState=${t}></nami-segment-picker>`;case"segmentPickerItem":return r`<nami-segment-picker-item .component=${e} .inFocusedState=${t}></nami-segment-picker-item>`;case"container":return r`<nami-container .component=${e} .inFocusedState=${t}></nami-container>`;case"productContainer":return r`<nami-product-container .component=${e} .inFocusedState=${t}></nami-product-container>`;case"image":return r`<nami-image .component=${e} .inFocusedState=${t}></nami-image>`;case"symbol":return r`<nami-symbol .component=${e} .inFocusedState=${t}></nami-symbol>`;default:return me.debug("Cannot render component:",n),r``}})(e,t??!1)}const{NAMI_CLOSE_PAYWALL:Io="namiClosePaywall",NAMI_RESTORE_PURCHASES:Co="namiRestorePurchases",NAMI_SIGN_IN:Po="namiSignIn",NAMI_BUY_SKU:Oo="namiBuySKU",SET_STATE:$o="setState",NAMI_SELECT_SKU:Mo="namiSelectSKU",NAMI_PURCHASE_SELECTED_SKU:Lo="namiPurchaseSelectedSKU",NAMI_DEEP_LINK:Ro="namiDeeplink",NAMI_NAVIGATE_TO_SCREEN:To="namiNavigateToScreen",NAMI_RELOAD_PRODUCTS:No="namiReloadProducts",UNSUPPORTED:Do="",NAMI_PURCHASE_SUCCESS:zo="namiPurchaseSuccess",NAMI_PURCHASE_CANCELLED:Fo="namiPurchaseCancelled",NAMI_PURCHASE_FAILED:Uo="namiPurchaseFailed",NAMI_PURCHASE_PENDING:Bo="namiPurchasePending",NAMI_PURCHASE_UNKNOWN:jo="namiPurchaseUnknown",NAMI_SHOW_PAYWALL:Xo="namiShowPaywall",NAMI_PAGE_CHANGE:Ho="namiPageChange",NAMI_TOGGLE_CHANGE:Vo="namiToggleChange",NAMI_SLIDE_CHANGE:Go="namiSlideChange"}={},Yo=(e,t)=>{let n,r,s=$s.EMPTY;switch(e?.function){case Io:s=$s.CLOSE_PAYWALL,n=Wo(),qo();break;case Co:s=$s.RESTORE_PURCHASES,Ko();break;case Po:s=$s.SIGN_IN,Qo();break;case Ro:Zo(e.parameters?.url);break;case Oo:t&&(s=$s.BUY_SKU,t=Jo(e,t));break;case To:r={name:e?.parameters?.screen},ea(e?.parameters?.screen);break;case $o:ta();break;case Mo:t&&(s=$s.SELECT_SKU,na(t));break;case Lo:t&&(s=$s.PURCHASE_SELECTED_SKU,ra(t))}s!==$s.EMPTY&&ss.getInstance().emit(ce,{action:s,sku:t,timeSpentOnPaywall:n,componentChange:r,purchaseError:undefined,purchases:undefined})},Wo=()=>{const e=_i.state.timeSpentOnPaywall;if(e)return Date.now()-e},qo=()=>{sa(Os.PAYWALL_CLOSE_REQUESTED)||"undefined"==typeof window||window.history.back()},Ko=()=>{const e=Ne(Re.THIRD_PARTY_TRANSACTIONS);sa(Os.PAYWALL_RESTORE_REQUESTED)||e||me.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},Qo=()=>{sa(Os.PAYWALL_SIGNIN_REQUESTED)},Zo=e=>{e?sa(Os.PAYWALL_DEEPLINK_ACTION,e)||"undefined"!=typeof window&&window.open(e,"_blank"):me.debug("Paywall deep link action invoked, but no url present.")},Jo=(e,t)=>{const n=e.parameters?.promo,r=t;if(n)me.debug(`promo id is not null ${t?.id}`),r.promoId=n.toString(),ia(r);else{me.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)me.debug(`Found a free trial offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id.toString();else{const t=e.offers[0];t&&(me.debug(`Found an offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id?.toString())}}ia(r)}return r},ea=e=>{e&&(window.history.state?.prevUrl==e?window.history.back():_i.setCurrentPage(e))},ta=()=>{const e=ki.allPaywalls().find((e=>e.id===_i.paywallId()));e&&(e.template.initialState={...e.template.initialState,currentGroupId:_i.currentGroupId()},_i.setPaywall(e))},na=e=>{const t=_i.currentGroupId(),n=_i.selectedProducts();t&&e.id!=n[t]&&(n[t]=e.id,_i.setSelectedProdcuts(n))},ra=e=>{_i.setPurchase(!0,e)};function sa(e,...t){const n=ss.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}function ia(e){if(Ne(Re.THIRD_PARTY_TRANSACTIONS)){if(ss.getInstance().listenerCount(Os.REGISTER_BUY_SKU)<=0)return void me.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.");me.info(`Handing off purchase for processing by developer skuId=${e.skuId} promoId=${e.promoId}`),sa(Os.REGISTER_BUY_SKU,e)}}let oa=class extends Zi{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{Yo(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 s(`\n :host {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n ${co(e,t)}\n ${lo(e)}\n ${mo(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 r`<span class="loader"></span>`;return function(e){const t={sku:_i.state.sku};return bo(e.components||[],bo(t,t))}(this.component).map((e=>Eo(e,this.inFocusedState)))}};Me([Qi({type:Object})],oa.prototype,"component",void 0),Me([Qi({type:Boolean})],oa.prototype,"inFocusedState",void 0),oa=Me([Ei("nami-button")],oa);let aa=class extends Zi{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 s(`\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=>Eo(e,this.inFocusedState)))}};Me([Qi({type:Array})],aa.prototype,"components",void 0),Me([Qi({type:String})],aa.prototype,"zIndex",void 0),Me([Qi({type:Boolean})],aa.prototype,"inFullScreen",void 0),Me([Qi({type:Boolean})],aa.prototype,"inFocusedState",void 0),aa=Me([Ei("nami-header")],aa);let ca=class extends Zi{constructor(){super(...arguments),this.components=[],this.zIndex="3",this.inFocusedState=!1}styles(){return s(`\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=>Eo(e,this.inFocusedState)))}};function la(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}Me([Qi({type:Array})],ca.prototype,"components",void 0),Me([Qi({type:String})],ca.prototype,"zIndex",void 0),Me([Qi({type:Boolean})],ca.prototype,"inFocusedState",void 0),ca=Me([Ei("nami-footer")],ca);let ua={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function ha(e){ua=e}const da=/[&<>"']/,pa=new RegExp(da.source,"g"),fa=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ma=new RegExp(fa.source,"g"),ga={"&":"&","<":"<",">":">",'"':""","'":"'"},ya=e=>ga[e];function ba(e,t){if(t){if(da.test(e))return e.replace(pa,ya)}else if(fa.test(e))return e.replace(ma,ya);return e}const _a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function wa(e){return e.replace(_a,((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 va=/(^|[^\[])\^/g;function Sa(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(va,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function ka(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Aa={exec:()=>null};function xa(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 Ea(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 Ia(e,t,n,r){const s=t.href,i=t.title?ba(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:ba(o)}}class Ca{options;rules;lexer;constructor(e){this.options=e||ua}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:Ea(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=Ea(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=Ea(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=xa(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(xa(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:ba(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=Ea(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)),Ia(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 Ia(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=ba(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=ba(t[1]),n="mailto:"+e):(e=ba(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=ba(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=ba(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]:ba(t[0]),{type:"text",raw:t[0],text:e}}}}const Pa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Oa=/(?:[*+-]|\d{1,9}[.)])/,$a=Sa(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Oa).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(),Ma=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,La=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ra=Sa(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",La).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ta=Sa(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oa).getRegex(),Na="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",Da=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,za=Sa("^ {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",Da).replace("tag",Na).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fa=Sa(Ma).replace("hr",Pa).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",Na).getRegex(),Ua={blockquote:Sa(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fa).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Ra,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Pa,html:za,lheading:$a,list:Ta,newline:/^(?: *(?:\n|$))+/,paragraph:Fa,table:Aa,text:/^[^\n]+/},Ba=Sa("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pa).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",Na).getRegex(),ja={...Ua,table:Ba,paragraph:Sa(Ma).replace("hr",Pa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ba).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",Na).getRegex()},Xa={...Ua,html:Sa("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Da).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:Aa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Sa(Ma).replace("hr",Pa).replace("heading"," *#{1,6} *[^\n]").replace("lheading",$a).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ha=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Va=/^( {2,}|\\)\n(?!\s*$)/,Ga="\\p{P}\\p{S}",Ya=Sa(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ga).getRegex(),Wa=Sa(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ga).getRegex(),qa=Sa("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ga).getRegex(),Ka=Sa("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ga).getRegex(),Qa=Sa(/\\([punct])/,"gu").replace(/punct/g,Ga).getRegex(),Za=Sa(/^<(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(),Ja=Sa(Da).replace("(?:--\x3e|$)","--\x3e").getRegex(),ec=Sa("^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",Ja).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,nc=Sa(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",tc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rc=Sa(/^!?\[(label)\]\[(ref)\]/).replace("label",tc).replace("ref",La).getRegex(),sc=Sa(/^!?\[(ref)\](?:\[\])?/).replace("ref",La).getRegex(),ic={_backpedal:Aa,anyPunctuation:Qa,autolink:Za,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Va,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Aa,emStrongLDelim:Wa,emStrongRDelimAst:qa,emStrongRDelimUnd:Ka,escape:Ha,link:nc,nolink:sc,punctuation:Ya,reflink:rc,reflinkSearch:Sa("reflink|nolink(?!\\()","g").replace("reflink",rc).replace("nolink",sc).getRegex(),tag:ec,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Aa},oc={...ic,link:Sa(/^!?\[(label)\]\((.*?)\)/).replace("label",tc).getRegex(),reflink:Sa(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tc).getRegex()},ac={...ic,escape:Sa(Ha).replace("])","~|])").getRegex(),url:Sa(/^((?: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={...ac,br:Sa(Va).replace("{2,}","*").getRegex(),text:Sa(ac.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lc={normal:Ua,gfm:ja,pedantic:Xa},uc={normal:ic,gfm:ac,breaks:cc,pedantic:oc};class hc{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ua,this.options.tokenizer=this.options.tokenizer||new Ca,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:lc.normal,inline:uc.normal};this.options.pedantic?(t.block=lc.pedantic,t.inline=uc.pedantic):this.options.gfm&&(t.block=lc.gfm,this.options.breaks?t.inline=uc.breaks:t.inline=uc.gfm),this.tokenizer.rules=t}static get rules(){return{block:lc,inline:uc}}static lex(e,t){return new hc(t).lex(e)}static lexInline(e,t){return new hc(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 dc{options;constructor(e){this.options=e||ua}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+ba(r)+'">'+(n?e:ba(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:ba(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=ka(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=ka(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 pc{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 fc{options;renderer;textRenderer;constructor(e){this.options=e||ua,this.options.renderer=this.options.renderer||new dc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new pc}static parse(e,t){return new fc(t).parse(e)}static parseInline(e,t){return new fc(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,wa(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 mc{options;constructor(e){this.options=e||ua}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const gc=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(hc.lex,fc.parse);parseInline=this.#t(hc.lexInline,fc.parseInline);Parser=fc;Renderer=dc;TextRenderer=pc;Lexer=hc;Tokenizer=Ca;Hooks=mc;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 dc(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 Ca(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 mc;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];mc.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 hc.lex(e,t??this.defaults)}parser(e,t){return fc.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>"+ba(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function yc(e,t){return gc.parse(e,t)}yc.options=yc.setOptions=function(e){return gc.setOptions(e),yc.defaults=gc.defaults,ha(yc.defaults),yc},yc.getDefaults=la,yc.defaults=ua,yc.use=function(...e){return gc.use(...e),yc.defaults=gc.defaults,ha(yc.defaults),yc},yc.walkTokens=function(e,t){return gc.walkTokens(e,t)},yc.parseInline=gc.parseInline,yc.Parser=fc,yc.parser=fc.parse,yc.Renderer=dc,yc.TextRenderer=pc,yc.Lexer=hc,yc.lexer=hc.lex,yc.Tokenizer=Ca,yc.Hooks=mc,yc.parse=yc,yc.options,yc.setOptions,yc.use,yc.walkTokens,yc.parseInline,fc.parse,hc.lex;const bc={CheckCircleFilled:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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:i`<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 _c(e,t=""){const n=e.linkColor||"blue";return s(`\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 wc=class extends Zi{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{component:e}=this;return"legal"===e.textType?s(`\n :host {\n display: block;\n overflow-wrap: break-word;\n width: fit-content;\n ${co(e,this.inFocusedState)}\n color: ${e.fontColor};\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${fo(e)}\n ${mo(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${_c(e,":host")}\n `):s(`\n :host {\n display: flex;\n width: fit-content;\n ${function(e){return"fitContent"===e.width?"white-space: nowrap;":"overflow-wrap: anywhere;"}(e)}\n ${co(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 ${po("string"!=typeof e.strikethrough&&e.strikethrough)}\n ${fo(e)}\n ${mo(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${s(_c(e,":host"))}\n `)}render(){return this.component.text?r`<div class="content" .innerHTML="${yc.parse(this.component.text)}"></div>`:(this.style.display="none",r``)}};Me([Qi({type:Object})],wc.prototype,"component",void 0),Me([Qi({type:Boolean})],wc.prototype,"inFocusedState",void 0),wc=Me([Ei("nami-text")],wc);let vc=class extends Zi{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return s(`\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 r`<slot></slot>`}};Me([Qi({type:Object})],vc.prototype,"component",void 0),Me([Qi({type:Boolean})],vc.prototype,"inFocusedState",void 0),vc=Me([Ei("nami-text-list-item-wrapper")],vc);let Sc=class extends Zi{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return s(`\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 ${co(this.component,this.inFocusedState)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n }\n `)}render(){return r`
|
|
39
|
+
`}};var yo;h([ho({type:String})],go.prototype,"formFactor",void 0),h([ho({type:Object})],go.prototype,"campaign",void 0),h([ho({type:Object})],go.prototype,"paywall",void 0),h([ho({type:Object})],go.prototype,"paywallEvent",void 0),go=h([Us("nami-paywall")],go),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"}(yo||(yo={}));class bo{constructor(){this.emitter=ui.getInstance()}static allCampaigns(){if(!this.instance.sdkInitialized)throw new Pr;return Cs()}static isCampaignAvailable(e){if(!this.instance.sdkInitialized)throw new Pr;const t=xs(e)?Es.URL:Es.LABEL;let n=Mn(this.allCampaigns().filter((n=>n.type===t&&n.value===e)));return n=n.flatMap((e=>{const t=Ds.allPaywalls().find((t=>t.id===e.paywall));return t?[e]:[]})),n.length>0}static async refresh(){if(!this.instance.sdkInitialized)throw new Pr;const e=await Oi.instance.fetchPaywalls();return await xi.instance.fetchCampaignRules(e),this.allCampaigns()}static registerAvailableCampaignsHandler(e){return this.instance.emitter.addListener(fe,e),()=>{this.instance.emitter.removeListener(fe,e)}}static launch(e,t,n,r,i){let s;r=r??(()=>{});let o="";if(e?(o=e,s=Es.LABEL):t&&(o=t,s=Es.URL),!this.instance.sdkInitialized)throw r(!1,yo.SDK_NOT_INITIALIZED),new Pr;_s.setLaunchDetails(o,s);const a=Ps(o,s);let c=a.paywall;const l=a.campaign;if(!c){let n;n=e?yo.LABELED_CAMPAIGN_NOT_FOUND:t?yo.URL_CAMPAIGN_NOT_FOUND:yo.DEFAULT_CAMPAIGN_NOT_FOUND,r(!1,n),c={}}const 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??null,action:mo.UNKNOWN},h=new go(c,u,l,n);return i&&this.instance.emitter.addListener(me,(({action:e,sku:t,timeSpentOnPaywall:n,componentChange:r,purchaseError:s,purchases:o})=>{i({...u,action:e,sku:t,componentChange:r,purchaseError:s,purchases:o,timeSpentOnPaywall:n})})),setTimeout((()=>r(!0)),0),h}get sdkInitialized(){return Ms.instance.isInitialized}}bo.instance=new bo;class _o{constructor(){this.emitter=ui.getInstance()}static active(){return Gr(),vs()}static isEntitlementActive(e){return!!Gr("NamiEntitlementManager.isEntitlementActive")&&this.active().some((t=>t.referenceId==e))}static async refresh(){if(!this.instance.sdkInitialized)throw new Pr;return Gr("NamiEntitlementManager.refresh")?(await ks.instance.fetchActiveEntitlements(),vs()):[]}static registerActiveEntitlementsHandler(e){if(Gr("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(ge,e),()=>{this.instance.emitter.removeListener(ge,e)}}get sdkInitialized(){return Ms.instance.isInitialized}}_o.instance=new _o;const wo={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},vo={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},So={top:"start",left:"start",right:"end",bottom:"end",center:"center"};function Ao(e){let t;return t="number"==typeof e?`${e}px`:"fitContent"==e?"fit-content":e,`${t} !important`}function ko(e){return e.includes("gradient")?`background-image: ${e};`:`background-color: ${e};`}function Eo(e,t){return t&&e.focusedFillColor?ko(e.focusedFillColor):ko(e.fillColor||"transparent")}function Io({direction:e}){return`flex-direction: ${"vertical"===e?"column":"row"};`}function xo(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 Co({alignment:e}){return`\n justify-content: ${e&&So[e]||"center"};\n `}function Po(e){return e?"\n text-decoration: line-through;\n text-decoration-thickness: auto;\n ":""}function Oo({fontName:e}){const[t]=(e||"").split("-");return`font-family: '${e}', '${t}', 'Helvetica';`}function $o(e,t){return`\n transition: all 0.3s;\n ${function({grow:e}){return e?"flex-grow: 1;":""}(e)}\n ${xo(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,i=t&&e.focusedRoundBorders?e.focusedRoundBorders:e.roundBorders||null,s=i?i.map((e=>`${wo[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=>`${vo[e]}: solid;`)).join("\n"):"border-style: solid;"}\n ${s}\n `}(e,t)}\n ${function({alignment:e}){return`\n align-items: ${e&&So[e]||"center"};\n `}(e)}\n ${Co(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: ${Ao(t)};`:""}\n ${void 0!==n?`height: ${Ao(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 Lo(e){if(!e)return"";const[t,n]=e.split("-");return`\n align-self: ${t};\n ${n}: 0;\n `}function Mo(e,t){return Object.keys(t).filter((t=>t.startsWith(e))).reduce(((n,r)=>{const i=function(e,t){const n=e.replace(t,"");return n.charAt(0).toLowerCase()+n.slice(1)}(r,e);return n[i]=t[r],n}),{})}function No(e,t){return`\n ${Eo(e,t)}\n ${To(e)}\n ${$o(e,t)}\n width: 50% !important;\n height: 100% !important;\n `}function To(e){return`\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 `}let Ro=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const e=this.component,t=e.height||e.fixedHeight||e.width||e.fixedWidth;return i(`\n :host {\n display: ${e.hidden?"none":"block"};\n ${t?"":"flex-grow: 1;"}\n ${$o(e,this.inFocusedState)}\n }\n `)}render(){return r``}};function Do(e,t){return Array.isArray(e)?e.reduce(((e,n)=>{const r=Do(n,t);return Array.isArray(r)?[...e,...r]:[...e,r]}),[]):null==e?e:"object"==typeof e?Object.entries(e).reduce(((e,[n,r])=>{const i="newRow"===n?r:Do(r,t);return{...e,[n]:i}}),{}):"string"==typeof e?Ho(e,t):e}function Fo(e,t,n={},r){const i=t.productBaseComponents||t.components||[],s=t.productFeaturedComponents||i;return e.map((e=>{const t=e.featured?s:i,o={...e,...e.variables,...r,id:e.sku_ref_id};!function(e,t){const n=e=>{for(const r of e)r.sku=As(t),r.components&&n(r.components)};n(e)}(t,e);const a={sku:o,media:jo(n,{convertToUrl:!0})};return[e.featured??!1,Do(t,Do(a,a))]}),[])}function zo(e){return e.assertions?e.assertions.every(Bo):!!e.orAssertions&&(!e.orAssertions.length||e.orAssertions.some(Bo))}function Uo(e,t){const n=_s.state,r={state:n,launch:n.launch,sku:n.sku,customer:n.customer};return"string"==typeof e&&e.startsWith("${")&&(e=Ho(e,r)),e}function Bo({value:e,expected:t,operator:n}){const r=/\${[A-Za-z.]+}/g;return e=Uo(e),t=Uo(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 jo(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 Ho(e,t){let n=e;if("string"!=typeof e)return n;for(const[i,s]of Array.from(e.matchAll(be))){const o=Ho(s,t);if(i===e)return r(i,o);o!==s&&(n=n.replace(s,o)),n=n.replace(be,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:Ho(r,t)}}h([ho({type:Object})],Ro.prototype,"component",void 0),h([ho({type:Boolean})],Ro.prototype,"inFocusedState",void 0),Ro=h([Us("nami-spacer")],Ro);function Xo(e,t){if("condition"===e.component){if(!zo(e))return null;const n=e.components?.map((e=>Xo(e,t)));return n}return e.conditionAttributes&&(e=function({conditionAttributes:e,...t}){return e?e.reduce(((e,t)=>zo(t)?(Object.entries(t.attributes).forEach((([e,n])=>{t.attributes[e]=Uo(n)})),{...e,...t.attributes}):e),t):t}(e)),Object.keys(e).forEach((t=>{e[t]=Uo(e[t])})),((e,t)=>{const n=e.component;switch(n){case"spacer":return r`<nami-spacer .component=${e} .inFocusedState=${t}></nami-spacer>`;case"button":return r`<nami-button .component=${e} .inFocusedState=${t}></nami-button>`;case"text":return r`<nami-text .component=${e} .inFocusedState=${t}></nami-text>`;case"text-list":return r`<nami-text-list .component=${e} .inFocusedState=${t}></nami-text-list>`;case"segmentPicker":return r`<nami-segment-picker .component=${e} .inFocusedState=${t}></nami-segment-picker>`;case"segmentPickerItem":return r`<nami-segment-picker-item .component=${e} .inFocusedState=${t}></nami-segment-picker-item>`;case"container":return r`<nami-container .component=${e} .inFocusedState=${t}></nami-container>`;case"productContainer":return r`<nami-product-container .component=${e} .inFocusedState=${t}></nami-product-container>`;case"image":return r`<nami-image .component=${e} .inFocusedState=${t}></nami-image>`;case"videoUrl":return r`<nami-video .component=${e} .inFocusedState=${t}></nami-video>`;case"symbol":return r`<nami-symbol .component=${e} .inFocusedState=${t}></nami-symbol>`;case"collapseContainer":return r`<nami-collapse-container .component=${e} .inFocusedState=${t}></nami-collapse-container>`;default:return Ae.debug("Cannot render component:",n),r``}})(e,t??!1)}const{NAMI_CLOSE_PAYWALL:Vo="namiClosePaywall",NAMI_RESTORE_PURCHASES:Go="namiRestorePurchases",NAMI_SIGN_IN:Wo="namiSignIn",NAMI_BUY_SKU:Yo="namiBuySKU",SET_STATE:qo="setState",NAMI_SELECT_SKU:Ko="namiSelectSKU",NAMI_PURCHASE_SELECTED_SKU:Qo="namiPurchaseSelectedSKU",NAMI_DEEP_LINK:Zo="namiDeeplink",NAMI_NAVIGATE_TO_SCREEN:Jo="namiNavigateToScreen",NAMI_RELOAD_PRODUCTS:ea="namiReloadProducts",UNSUPPORTED:ta="",NAMI_PURCHASE_SUCCESS:na="namiPurchaseSuccess",NAMI_PURCHASE_CANCELLED:ra="namiPurchaseCancelled",NAMI_PURCHASE_FAILED:ia="namiPurchaseFailed",NAMI_PURCHASE_PENDING:sa="namiPurchasePending",NAMI_PURCHASE_UNKNOWN:oa="namiPurchaseUnknown",NAMI_SHOW_PAYWALL:aa="namiShowPaywall",NAMI_PAGE_CHANGE:ca="namiPageChange",NAMI_TOGGLE_CHANGE:la="namiToggleChange",NAMI_SLIDE_CHANGE:ua="namiSlideChange"}={};var ha,da;!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(ha||(ha={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(da||(da={}));const pa=(e,t)=>{let n,r,i=mo.UNKNOWN;switch(e?.function){case Vo:i=mo.CLOSE_PAYWALL,n=fa(),ma();break;case Go:i=mo.RESTORE_PURCHASES,ga();break;case Wo:i=mo.SIGN_IN,ya();break;case Zo:ba(e.parameters?.url);break;case Yo:t&&(i=mo.BUY_SKU,t=_a(e,t));break;case Jo:r={name:e?.parameters?.screen},wa(e?.parameters?.screen);break;case qo:va();break;case Ko:t&&(i=mo.SELECT_SKU,Sa(t));break;case Qo:t&&(i=mo.PURCHASE_SELECTED_SKU,Aa(t))}i!==mo.UNKNOWN&&ui.getInstance().emit(me,{action:i,sku:t,timeSpentOnPaywall:n,componentChange:r,purchaseError:undefined,purchases:undefined})},fa=()=>{const e=_s.state.timeSpentOnPaywall;if(e)return Date.now()-e},ma=()=>{if(!ka(Ls.PAYWALL_CLOSE_REQUESTED)&&"undefined"!=typeof window)return window.history.back(),void _s.resetAppSuppliedVideoDetails()},ga=()=>{const e=Vr(Hr.THIRD_PARTY_TRANSACTIONS);ka(Ls.PAYWALL_RESTORE_REQUESTED)||e||Ae.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},ya=()=>{ka(Ls.PAYWALL_SIGNIN_REQUESTED)},ba=e=>{e?ka(Ls.PAYWALL_DEEPLINK_ACTION,e)||"undefined"!=typeof window&&window.open(e,"_blank"):Ae.debug("Paywall deep link action invoked, but no url present.")},_a=(e,t)=>{const n=e.parameters?.promo,r=t;if(n)Ae.debug(`promo id is not null ${t?.id}`),r.promoId=n.toString();else{Ae.debug(`promo id is null for ${t.id}, product details: ${JSON.stringify(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)Ae.debug(`Found a free trial offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id.toString();else{const t=e.offers[0];t&&(Ae.debug(`Found an offer ${t.offer_ref_id}`),r.promoId=t.offer_ref_id?.toString())}}}return function(e){if(Vr(Hr.THIRD_PARTY_TRANSACTIONS)){if(xr.setPurchaseImpression(),ui.getInstance().listenerCount(Ls.REGISTER_BUY_SKU)<=0)return void Ae.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.");Ae.info(`Handing off purchase for processing by developer skuId=${e.skuId} promoId=${e.promoId}`),ka(Ls.REGISTER_BUY_SKU,e)}else{const t=function(e){if(!Gr("NamiPurchaseManager.buySKU"))return;const t=xr.getCachedProducts(),n=t?.find((t=>t.sku_ref_id==e));return{success:!!n,billingResponseCode:n?0:-999}}(e.skuId);if(t&&(Ae.info(`Purchase flow completed, success=${t.success}, code=${t.billingResponseCode}, message=${t.message}`),t.success)){ui.getInstance().emit(me,{action:mo.CLOSE_PAYWALL,sku:e,timeSpentOnPaywall:fa()});const t=_s.getSelectedCampaign();t&&t.conversion_event_type==da.IN_APP&&t.conversion_event_url?window.location.href=t.conversion_event_url:ma()}}}(r),r},wa=e=>{e&&(window.history.state?.prevUrl==e?window.history.back():_s.setCurrentPage(e))},va=()=>{const e=Ds.allPaywalls().find((e=>e.id===_s.paywallId()));e&&(e.template.initialState={...e.template.initialState,currentGroupId:_s.currentGroupId()},_s.setPaywall(e))},Sa=e=>{const t=_s.currentGroupId(),n=_s.selectedProducts();t&&e.id!=n[t]&&(n[t]=e.id,_s.setSelectedProdcuts(n))},Aa=e=>{_s.setPurchase(!0,e)};function ka(e,...t){const n=ui.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}const{SHOULD_SHOW_LOADING_INDICATOR:Ea=!1}={};let Ia=class extends po{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 i(`\n :host {\n display: ${e.hidden?"none":"flex"};\n flex-direction: column;\n cursor: pointer;\n ${Eo(e,t)}\n ${Io(e)}\n ${$o(e,t)}\n }\n\n :host > :not(:first-child) {\n ${n}: ${r}px;\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(){this.tabIndex=0;const e=this.contextConsumer.state.purchaseInProgress&&this.component.sku?.id==this.contextConsumer.state.productBeingPurchased?.id;if(Ea&&e)return r`<span class="loader"></span>`;return function(e){const t={sku:_s.state.sku};return Do(e.components||[],Do(t,t))}(this.component).map((e=>Xo(e,this.inFocusedState)))}};h([ho({type:Object})],Ia.prototype,"component",void 0),h([ho({type:Boolean})],Ia.prototype,"inFocusedState",void 0),Ia=h([Us("nami-button")],Ia);let xa=class extends po{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 i(`\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=>Xo(e,this.inFocusedState)))}};h([ho({type:Array})],xa.prototype,"components",void 0),h([ho({type:String})],xa.prototype,"zIndex",void 0),h([ho({type:Boolean})],xa.prototype,"inFullScreen",void 0),h([ho({type:Boolean})],xa.prototype,"inFocusedState",void 0),xa=h([Us("nami-header")],xa);let Ca=class extends po{constructor(){super(...arguments),this.components=[],this.zIndex="3",this.inFocusedState=!1}styles(){return i(`\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=>Xo(e,this.inFocusedState)))}};function Pa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}h([ho({type:Array})],Ca.prototype,"components",void 0),h([ho({type:String})],Ca.prototype,"zIndex",void 0),h([ho({type:Boolean})],Ca.prototype,"inFocusedState",void 0),Ca=h([Us("nami-footer")],Ca);let Oa={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function $a(e){Oa=e}const La=/[&<>"']/,Ma=new RegExp(La.source,"g"),Na=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ta=new RegExp(Na.source,"g"),Ra={"&":"&","<":"<",">":">",'"':""","'":"'"},Da=e=>Ra[e];function Fa(e,t){if(t){if(La.test(e))return e.replace(Ma,Da)}else if(Na.test(e))return e.replace(Ta,Da);return e}const za=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Ua(e){return e.replace(za,((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 Ba=/(^|[^\[])\^/g;function ja(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Ba,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function Ha(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,i=t;for(;--i>=0&&"\\"===n[i];)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 Ga(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const s=e.charAt(r-i-1);if(s!==t||n){if(s===t||!n)break;i++}else i++}return e.slice(0,r-i)}function Wa(e,t,n,r){const i=t.href,s=t.title?Fa(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:i,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:s,text:Fa(o)}}class Ya{options;rules;lexer;constructor(e){this.options=e||Oa}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:Ga(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=Ga(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=Ga(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,i={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 s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.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+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=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," ")),i.test(l))break;if(s.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(i.test(r))break;if(s.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)}}i.loose||(c?i.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]\] +/,""))),i.items.push({type:"list_item",raw:o,task:!!p,checked:d,loose:!1,text:a,tokens:[]}),i.raw+=o}i.items[i.items.length-1].raw=o.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}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("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of i)s.rows.push(Va(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}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:Fa(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=Ga(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)),Wa(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 Wa(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 i,s,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(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=[...i].length,r[3]||r[4]){o+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(o-=s,o>0)continue;s=Math.min(s,s+o+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%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=Fa(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=Fa(t[1]),n="mailto:"+e):(e=Fa(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=Fa(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=Fa(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]:Fa(t[0]),{type:"text",raw:t[0],text:e}}}}const qa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ka=/(?:[*+-]|\d{1,9}[.)])/,Qa=ja(/^(?!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=ja(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ja).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tc=ja(/^( {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]*?(?:-->|$))/,ic=ja("^ {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(),sc=ja(Za).replace("hr",qa).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:ja(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sc).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:qa,html:ic,lheading:Qa,list:tc,newline:/^(?: *(?:\n|$))+/,paragraph:sc,table:Xa,text:/^[^\n]+/},ac=ja("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qa).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:ja(Za).replace("hr",qa).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:ja("^ *(?: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:ja(Za).replace("hr",qa).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=ja(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,dc).getRegex(),fc=ja(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,dc).getRegex(),mc=ja("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,dc).getRegex(),gc=ja("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,dc).getRegex(),yc=ja(/\\([punct])/,"gu").replace(/punct/g,dc).getRegex(),bc=ja(/^<(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=ja(rc).replace("(?:--\x3e|$)","--\x3e").getRegex(),wc=ja("^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=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sc=ja(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",vc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ac=ja(/^!?\[(label)\]\[(ref)\]/).replace("label",vc).replace("ref",Ja).getRegex(),kc=ja(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ja).getRegex(),Ec={_backpedal:Xa,anyPunctuation:yc,autolink:bc,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:hc,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Xa,emStrongLDelim:fc,emStrongRDelimAst:mc,emStrongRDelimUnd:gc,escape:uc,link:Sc,nolink:kc,punctuation:pc,reflink:Ac,reflinkSearch:ja("reflink|nolink(?!\\()","g").replace("reflink",Ac).replace("nolink",kc).getRegex(),tag:wc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Xa},Ic={...Ec,link:ja(/^!?\[(label)\]\((.*?)\)/).replace("label",vc).getRegex(),reflink:ja(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vc).getRegex()},xc={...Ec,escape:ja(uc).replace("])","~|])").getRegex(),url:ja(/^((?: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={...xc,br:ja(hc).replace("{2,}","*").getRegex(),text:ja(xc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pc={normal:oc,gfm:cc,pedantic:lc},Oc={normal:Ec,gfm:xc,breaks:Cc,pedantic:Ic};class $c{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Oa,this.options.tokenizer=this.options.tokenizer||new Ya,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:Pc.normal,inline:Oc.normal};this.options.pedantic?(t.block=Pc.pedantic,t.inline=Oc.pedantic):this.options.gfm&&(t.block=Pc.gfm,this.options.breaks?t.inline=Oc.breaks:t.inline=Oc.gfm),this.tokenizer.rules=t}static get rules(){return{block:Pc,inline:Oc}}static lex(e,t){return new $c(t).lex(e)}static lexInline(e,t){return new $c(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,i,s;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(i=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&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],s&&"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),s=i.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,i,s,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.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(i=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&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))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 Lc{options;constructor(e){this.options=e||Oa}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+Fa(r)+'">'+(n?e:Fa(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Fa(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=Ha(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){const r=Ha(e);if(null===r)return n;let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class Mc{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 Nc{options;renderer;textRenderer;constructor(e){this.options=e||Oa,this.options.renderer=this.options.renderer||new Lc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mc}static parse(e,t){return new Nc(t).parse(e)}static parseInline(e,t){return new Nc(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,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(i.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Ua(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;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 s="";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]});s+=this.renderer.tablerow(r)}n+=this.renderer.table(t,s);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,r=e.start,s=e.loose;let o="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,i=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);s?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,s),o+=this.renderer.listitem(a,i,!!r)}n+=this.renderer.list(o,t,r);continue}case"html":{const e=i;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=i,o=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],o+="\n"+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const e='Token with "'+i.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 i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":{const e=i;n+=t.text(e.text);break}case"html":{const e=i;n+=t.html(e.text);break}case"link":{const e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=i;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;n+=t.text(e.text);break}default:{const e='Token with "'+i.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||Oa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Rc=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.#e($c.lex,Nc.parse);parseInline=this.#e($c.lexInline,Nc.parseInline);Parser=Nc;Renderer=Lc;TextRenderer=Mc;Lexer=$c;Tokenizer=Ya;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 i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,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 Lc(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,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new Ya(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,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.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,i=e.hooks[r],s=t[r];Tc.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));const n=i.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.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 $c.lex(e,t??this.defaults)}parser(e,t){return Nc.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const i={...r},s={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const o=this.#t(!!s.silent,!!s.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(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let i=t(r,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return o(e)}}}#t(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>"+Fa(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Dc(e,t){return Rc.parse(e,t)}Dc.options=Dc.setOptions=function(e){return Rc.setOptions(e),Dc.defaults=Rc.defaults,$a(Dc.defaults),Dc},Dc.getDefaults=Pa,Dc.defaults=Oa,Dc.use=function(...e){return Rc.use(...e),Dc.defaults=Rc.defaults,$a(Dc.defaults),Dc},Dc.walkTokens=function(e,t){return Rc.walkTokens(e,t)},Dc.parseInline=Rc.parseInline,Dc.Parser=Nc,Dc.parser=Nc.parse,Dc.Renderer=Lc,Dc.TextRenderer=Mc,Dc.Lexer=$c,Dc.lexer=$c.lex,Dc.Tokenizer=Ya,Dc.Hooks=Tc,Dc.parse=Dc,Dc.options,Dc.setOptions,Dc.use,Dc.walkTokens,Dc.parseInline,Nc.parse,$c.lex;const Fc={CheckCircleFilled:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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:s`<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 zc(e,t=""){const n=e.linkColor||"blue";return i(`\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 Uc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{component:e}=this;return"legal"===e.textType?i(`\n :host {\n display: block;\n overflow-wrap: break-word;\n width: fit-content;\n ${Eo(e,this.inFocusedState)}\n color: ${e.fontColor};\n font-size: ${e.fontSize??12}px;\n text-align: ${e.alignment||"center"};\n ${Oo(e)}\n ${$o(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${zc(e,":host")}\n `):i(`\n :host {\n display: flex;\n width: fit-content;\n ${function(e){return"fitContent"===e.width?"white-space: nowrap;":"overflow-wrap: anywhere;"}(e)}\n ${Eo(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 ${Po("string"!=typeof e.strikethrough&&e.strikethrough)}\n ${Oo(e)}\n ${$o(e,this.inFocusedState)}\n }\n :host p {\n margin: 0;\n }\n ${i(zc(e,":host"))}\n `)}render(){return this.component.text?r`<div class="content" .innerHTML="${Dc.parse(this.component.text)}"></div>`:(this.style.display="none",r``)}};h([ho({type:Object})],Uc.prototype,"component",void 0),h([ho({type:Boolean})],Uc.prototype,"inFocusedState",void 0),Uc=h([Us("nami-text")],Uc);let Bc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return i(`\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 r`<slot></slot>`}};h([ho({type:Object})],Bc.prototype,"component",void 0),h([ho({type:Boolean})],Bc.prototype,"inFocusedState",void 0),Bc=h([Us("nami-text-list-item-wrapper")],Bc);let jc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return i(`\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 ${Eo(this.component,this.inFocusedState)}\n color: ${this.component.fontColor};\n font-size: ${this.component.fontSize??12}px;\n }\n `)}render(){return r`
|
|
40
40
|
<span role="img" aria-label="${this.component.name}" class="anticon anticon-${this.component.name}">
|
|
41
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,
|
|
42
|
+
${e=this.component.name,Fc[e]||Fc.CheckCircleOutlined}
|
|
43
43
|
</svg>
|
|
44
|
-
</span>`;var e}};
|
|
44
|
+
</span>`;var e}};h([ho({type:Object})],jc.prototype,"component",void 0),h([ho({type:Boolean})],jc.prototype,"inFocusedState",void 0),jc=h([Us("nami-symbol")],jc);let Hc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){return i(`\n :host {\n line-height: 1.5715;\n display: grid;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Eo(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 ${Po("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Oo(this.component)}\n ${$o(this.component,this.inFocusedState)}\n ${zc(this.component)}\n ${Io(this.component)}\n ${Co(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 ${Eo(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 ${Po("string"!=typeof this.component.strikethrough&&this.component.strikethrough)}\n ${Oo(this.component)}\n }\n :host .bullet-text-wrapper p {\n margin: 0;\n line-height: 1.2em;\n }\n ${zc(this.component,":host .bullet-text-wrapper")}\n `)}render(){const{fontColor:e,fontSize:t,bulletComponent:n,texts:i,spacing:s}=this.component,o=n?{fontColor:e,fontSize:t,spacing:s,...n}:null;if(!Array.isArray(i))return r``;const a=i.map((e=>e?r`<nami-text-list-item-wrapper .component=${this.component}>
|
|
45
45
|
${o&&r`<nami-symbol .component=${o}></nami-symbol>`}
|
|
46
|
-
<div class="bullet-text-wrapper" .innerHTML="${
|
|
47
|
-
</nami-text-list-item-wrapper>`:null));return r`${a}`}};
|
|
46
|
+
<div class="bullet-text-wrapper" .innerHTML="${Dc(e)}"></div>
|
|
47
|
+
</nami-text-list-item-wrapper>`:null));return r`${a}`}};h([ho({type:Object})],Hc.prototype,"component",void 0),h([ho({type:Boolean})],Hc.prototype,"inFocusedState",void 0),Hc=h([Us("nami-text-list")],Hc);let Xc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{component:e,inFocusedState:t}=this,n="vertical"===e.direction?"margin-top":"margin-left",r=e.fillImage?i(`\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 `):i(Eo(e,t));return i(`\n :host {\n display: ${e.hidden?"none":"flex"};\n ${r};\n ${Lo(e.position)}\n ${Io(e)}\n ${$o(e,t)}\n }\n :host > :not(:first-child) {\n ${n}: ${e.spacing||0}px;\n }\n `)}render(){return(this.component.components??[]).map((e=>Xo(e)))}};h([ho({type:Object})],Xc.prototype,"component",void 0),h([ho({type:Boolean})],Xc.prototype,"inFocusedState",void 0),Xc=h([Us("nami-container")],Xc);let Vc=class extends po{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?i(`\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 `):i(Eo(this.component,this.inFocusedState));return i(`\n :host {\n opacity: 0;\n display: flex;\n ${r};\n ${Lo(this.component.position)}\n ${Io(this.component)}\n ${$o(this.component,this.inFocusedState)}\n justify-content: center;\n transition: transform .5s ease-in;\n }\n :host > * {\n ${t}: 100%;\n }\n :host > :not(:first-child) {\n ${n}: ${this.component.spacing||0}px;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}updated(){const{currentGroupId:e}=_s.state;Ar(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout((()=>this.classList.add("fade-in")),100),this.currentGroupId=e)}_offerState(){const{anySkuHasTrialOffer:e,anySkuHasIntroOffer:t,anySkuHasPromoOffer:n}=_s.state;return{freeTrialEligible:e,introEligible:t,promoEligible:n}}render(){const{skuItems:e,mediaList:t}=_s.state;return Fo(e,this.component,t,this._offerState()).map((([,e])=>e.map((e=>Xo(e,this.inFocusedState)))))}};h([ho({type:Object})],Vc.prototype,"component",void 0),h([ho({type:Boolean})],Vc.prototype,"inFocusedState",void 0),Vc=h([Us("nami-product-container")],Vc);let Gc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{url:e,imageCropping:t,alignment:n,height:r,width:s,rightMargin:o,spacing:a}=this.component;return i(`\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: ${Ao(r??"100%")};\n width: ${Ao(("fitContent"==s?r:s)??"100%")};\n margin-right: ${o||a||0}px;\n ${xo(this.component)}\n ${this.component.hidden?"display:none":""}\n }\n `)}render(){return r``}};h([ho({type:Object})],Gc.prototype,"component",void 0),h([ho({type:Boolean})],Gc.prototype,"inFocusedState",void 0),Gc=h([Us("nami-image")],Gc);let Wc=class extends po{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,o="phone"===r?e?0:30:0;return i(`\n :host {\n display: ${n.hidden?"none":"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: ${o}px;\n top: ${s}px;\n ${Eo(n,t)}\n transition: all 0.3s;\n ${xo(n)}\n }\n `)}render(){return(this.component.components??[]).map((e=>Xo(e)))}};h([ho({type:Object})],Wc.prototype,"component",void 0),h([ho({type:Boolean})],Wc.prototype,"fullscreen",void 0),h([ho({type:Boolean})],Wc.prototype,"inFocusedState",void 0),Wc=h([Us("nami-background-container")],Wc);let Yc=class extends po{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%;":"",o=t.spacing??0;return i(`\n :host {\n display: ${t.hidden?"none":"flex"};\n position: relative;\n ${Io(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 ${xo(t)}\n }\n :host > * {\n width: 100%;\n }\n \n :host > *:not(:first-child) {\n ${"vertical"===t.direction?`margin-top: ${o}px;`:`margin-left: ${o}px;`}\n `)}render(){return this.component.components.map((e=>Xo(e,this.inFocusedState)))}};h([ho({type:Object})],Yc.prototype,"component",void 0),h([ho({type:Number})],Yc.prototype,"zIndex",void 0),h([ho({type:Boolean})],Yc.prototype,"inFocusedState",void 0),Yc=h([Us("nami-content-container")],Yc);let qc=class extends po{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{pa(this.component.onTap)},this.addEventListener("click",this._handleClick)}styles(){const e=Mo("active",this.component.components[0]);return i(`\n :host {\n cursor: pointer;\n ${Eo(this.component,this.inFocusedState)}\n ${$o(this.component,this.inFocusedState)}\n ${this.component.hidden?"display:none":""}\n }\n\n .toggle{\n position: absolute !important;\n top: 0;\n bottom: 0;\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${No(e,this.inFocusedState)}\n }\n \n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n }\n `)}render(){const e=this.component.components.map((e=>Xo(e,this.inFocusedState)));return r`${e}<div class="toggle"></div>`}};h([ho({type:Object})],qc.prototype,"component",void 0),h([ho({type:Boolean})],qc.prototype,"inFocusedState",void 0),qc=h([Us("nami-segment-picker")],qc);let Kc=class extends po{constructor(){super(),this.inFocusedState=!1,this._handleClick=()=>{this.component.id&&_s.setCurrentGroupId(this.component.id)},this._handleHover=()=>{this.inFocusedState=!0},this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover)}styles(){const e=Mo("active",this.component),t=Mo("inactive",this.component);return i(`\n :host {\n display: ${this.component.hidden?"none":"inline-flex"};\n cursor: pointer;\n ${No({...t,...this.component},this.inFocusedState)}\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${To({...e,...this.component})}\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}render(){const e=this.component.id===_s.state.currentGroupId;return this.classList.toggle("active",e),r`<input type="radio" id="${this.component.text}" name="${this.component.text}" value="${this.component.text}" checked="${e}" />
|
|
48
|
+
<label for="${this.component.text}">${this.component.text}</label>`}};h([ho({type:Object})],Kc.prototype,"component",void 0),h([ho({type:Boolean})],Kc.prototype,"inFocusedState",void 0),Kc=h([Us("nami-segment-picker-item")],Kc);let Qc=class extends po{constructor(){super(...arguments),this.inFocusedState=!1}styles(){const{url:e,imageCropping:t,alignment:n,height:r,width:s,rightMargin:o,spacing:a}=this.component,c="fit"===t,l=c?"":i(" position: fixed;\n right: 0;\n bottom: 0;\n min-width: 100%;\n min-height: 100%;\n ");return i(`\n :host {\n box-sizing: border-box;\n transition: all 0.3s;\n background-image: url(${e});\n background-size: ${c?"contain":"cover"};\n background-position: ${n||""} center;\n background-repeat: no-repeat;\n height: ${Ao(r??"100%")};\n width: ${Ao(("fitContent"==s?r:s)??"100%")};\n margin-right: ${o||a||0}px;\n ${$o(this.component)}\n ${this.component.hidden?"display:none":""}\n ${l}\n }\n\n #nami-video {\n height: ${Ao(r??"100%")};\n width: ${Ao(("fitContent"==s?r:s)??"100%")};\n object-fit: ${c?"contain":"cover"};\n }\n `)}updated(){Object.keys(this.component).forEach((e=>{this.component[e]=Uo(this.component[e])}));const{url:e,autoplayVideo:t,mute:n,loopVideo:r,controlsType:i,fallbackImage:s}=this.component,o=this.shadowRoot?.getElementById("nami-video");o&&(o.autoplay=t??!1,o.loop=r??!1,o.muted=!!t||(n??!1),o.controls="none"!==i,o.poster=s??"",o.src=e??"")}render(){return r`<video id="nami-video" preload="auto"></video>`}};h([ho({type:Object})],Qc.prototype,"component",void 0),h([ho({type:Boolean})],Qc.prototype,"inFocusedState",void 0),Qc=h([Us("nami-video")],Qc);let Zc=class extends po{constructor(){super(),this.inFocusedState=!1,this.height=0,this._handleClick=()=>{this.height=this.shadowRoot?.getElementById("collapse")?.scrollHeight||0,this.shadowRoot?.getElementById("collapse")?.classList.toggle("hidden")},this.addEventListener("click",this._handleClick,!1)}styles(){const e="vertical"===this.component.direction?"margin-top":"margin-left",t=i(Eo(this.component,this.inFocusedState));return i(`\n :host {\n display: flex;\n ${t};\n ${Io(this.component)}\n ${$o(this.component,this.inFocusedState)}\n justify-content: center;\n cursor: pointer;\n }\n :host > :not(:first-child) {\n ${e}: ${this.component.spacing||0}px;\n }\n #collapse.hidden{\n max-height: 0;\n opacity: 0;\n }\n #collapse {\n max-height: ${this.height}px;\n opacity: 1;\n transition: all linear 0.5s;\n }\n `)}render(){const{components:e,collapseHeader:t,open:n}=this.component,i=e.map((e=>Xo(e,this.inFocusedState)));return r`${Xo(t,this.inFocusedState)}
|
|
49
|
+
<div id="collapse" class="${"collapse"===n?"hidden":""}">${i}</div>`}};h([ho({type:Object})],Zc.prototype,"component",void 0),h([ho({type:Boolean})],Zc.prototype,"inFocusedState",void 0),h([ho({type:Number})],Zc.prototype,"height",void 0),Zc=h([Us("nami-collapse-container")],Zc);export{Ms as Nami,bo as NamiCampaignManager,Es as NamiCampaignRuleType,Rs as NamiCustomerManager,_o as NamiEntitlementManager,mo as NamiPaywallAction,Ds as NamiPaywallManager};
|