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