PageSourceSearch

https://247wallst.com/esubscribe/component/latest/fwp-email-subscribe.js?ver=3.4.2

js 247wallst.com collected 2026-09-24 15:18:24 UTC 56,571 bytes, 130 lines download raw bytes

1var FWPEmailSubscribe=(()=>{var $=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var Oe=(o,e,t)=>e in o?$(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var De=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},Re=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Le(e))!$e.call(o,i)&&i!==t&&$(o,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return o};var Fe=o=>Re($({},"__esModule",{value:!0}),o);var H=(o,e,t)=>Oe(o,typeof e!="symbol"?e+"":e,t);var ct={};De(ct,{FWPEmailSubscribe:()=>K});var J=[{name:"heading",default:"",group:"Content",description:"Form heading text. If empty, no heading is shown."},{name:"body",default:"",group:"Content",description:"Description/body text below the heading. Supports HTML (e.g. <code>&lt;p&gt;</code> tags). If empty, no body text is shown."},{name:"emailplaceholdertext",default:"Enter your best email",group:"Content",description:"Placeholder text inside the email input field."},{name:"buttontext",default:"Get Report Now -- It's Free >>",group:"Content",description:"Text on the submit button."},{name:"thankyoucopy",default:"",group:"Content",description:"Message shown after a successful subscription (replaces the form). If empty, auto-detects: shows a redirect message when a redirect is configured, or a simple thank-you otherwise."},{name:"layout",default:"default",group:"Layout",description:"Form layout variant: <code>default</code> (standard), <code>slim</code> (compact green box), or <code>expandable</code> (collapsible with toggle)."},{name:"noredirect",default:"",group:"Post-Subscribe Behavior",description:'Set to <code>"1"</code> to stay on the page after subscribe. No redirect at all \u2014 just shows the thank you message.'},{name:"redirecttocurrent",default:"",group:"Post-Subscribe Behavior",description:'Set to <code>"1"</code> to reload the current page after a 2-second delay.'},{name:"thankyouredirecturl",default:"",group:"Post-Subscribe Behavior",description:"URL to redirect to after a 2-second delay. Only used if <code>noredirect</code> and <code>redirecttocurrent</code> are not set."},{name:"offers",default:"",group:"Post-Subscribe Behavior",description:'Controls offers redirect. Empty = auto-detect from <code>window.pitchConfig.offersHandler</code>. Set to <code>"none"</code> to disable. Any other value (e.g. <code>"afterOffers"</code>) enables offers with that service name.'},{name:"offers-mode",default:"",group:"Post-Subscribe Behavior",description:`Set to <code>"modal"</code> to open the offer flow in a modal over this page instead of navigating to the offers page: after subscribe the component opens a <code>&lt;dialog&gt;</code> with a same-origin iframe and POSTs the same merge fields (plus <code>mode=modal</code>) to <code>/offers/start</code>, served by the offer-flow interpreter in the FWP proxy. Requires a running Pitcher offer flow for the <code>offers</code> identifier on this site; if none is running the component falls back to the normal offers POST. Esc or the flow's "No thanks" closes the modal and goes to <code>thankyouredirecturl</code>. Add <code>?fwp_offers=open</code> to the page URL to open the modal on load without subscribing (QA hook).`},{name:"offers-theme",default:"",group:"Post-Subscribe Behavior",description:'Palette for the offers modal steps: <code>"dark"</code> or <code>"light"</code>. Empty lets the flow pick its default. Only used with <code>offers-mode="modal"</code>.'},{name:"autofocus",default:"",group:"Behavior",description:'Set to <code>"1"</code> to automatically focus the email input when the component renders.'},{name:"double-optin",default:"",group:"Behavior",description:'Set to <code>"1"</code> to enable double opt-in. The subscriber receives a confirmation email and must click the link before being marked active. Default is single opt-in (immediately active).'},{name:"sms-capture",default:"",group:"Behavior",description:'Set to <code>"1"</code> to render a <code>&lt;fwp-sms-subscribe&gt;</code> upsell after successful email signup. The post-email redirect is deferred until the user either subscribes, skips, or errors on the SMS step. Any <code>sms-*</code> attribute on this element is forwarded to the child (e.g. <code>sms-heading</code>, <code>sms-buttontext</code>, <code>sms-list-id</code>) with the <code>sms-</code> prefix stripped.'},{name:"list-id",default:"default",group:"API / Tracking",description:"The mailing list ID to subscribe the user to."},{name:"esp",default:"mailerlite",group:"API / Tracking",description:"Email service provider to route the subscription to. The worker selects the matching mailer (e.g. <code>mailerlite</code>, <code>flymail</code>, <code>clickfunnels</code>, <code>brevo</code>). If the named ESP is not configured on the worker, the worker falls back to all configured mailers."},{name:"api-endpoint",default:"",group:"API / Tracking",description:"API endpoint for the subscribe call. Defaults to <code>
1/workers/subscribe</code> on the current domain. Only set this to override."},{name:"ga-id-primary",default:"",group:"API / Tracking",description:"Google Analytics 4 measurement ID (e.g. <code>G-XXXXXXX</code>). Used to capture the GA client/session IDs for tracking."},{name:"event-label",default:"",group:"API / Tracking",description:"Analytics event label sent with the subscribe event (e.g. <code>report_dividend_legends</code>). The consuming site provides this \u2014 it is NOT hardcoded."},{name:"form-name",default:"",group:"API / Tracking",description:"Custom form name for tracking attribution. If empty, auto-generates as <code>sub_post_id_{postId}</code>."},{name:"tickers",default:"",group:"API / Tracking",description:'Comma-separated ticker symbols (e.g. <code>"AAPL,MSFT"</code>). Falls back to <code>window.fwpGetTickers()</code> then <code>window.pitchConfig.tickers</code>.'},{name:"category",default:"",group:"API / Tracking",description:"WordPress primary category slug to record on the subscriber (sent as the <code>category</code> merge field, stored on the MailerLite contact). Falls back to <code>window.analyticsConfig.primaryCategory</code>."},{name:"pitcher-conversion-url",default:"",group:"API / Tracking",description:"Pitcher API endpoint the component POSTs the ecap conversion to after a successful subscribe. Empty = auto: derived from <code>window.pitcherData.tracking.impressionUrl</code> when the pitch injector is on the page, otherwise the production API (<code>https://pitcher-api.flywheel-publishing.com/api/t/conversion</code>) \u2014 except on localhost, loopback and <code>staging</code> hosts, where the POST is skipped instead. Only set this to override."},{name:"pitcher-tracking-key",default:"",group:"API / Tracking",description:"Pitcher tracking API key sent as <code>X-API-Key</code> on the conversion POST. Empty = auto: <code>window.analyticsConfig.pitcherTrackingApiKey</code>, then <code>window.pitchConfig.pitcherTrackingApiKey</code>. With no key anywhere the conversion is skipped with a console warning."},{name:"disclaimer-url",default:"https://247wallst.com/disclaimer-and-terms-of-use/",group:"Legal / Disclaimer",description:"URL for the terms/disclaimer link in the legal text."},{name:"disclaimer-text",default:"By providing your email address, you agree to receive communications from us regarding website updates and other offerings that may be of interest to you. You can unsubscribe at any time. Past performance is not indicative of future results.",group:"Legal / Disclaimer",description:"Custom disclaimer copy."}],Z=Object.fromEntries(J.map(o=>[o.name,o.default])),Q=J.map(o=>o.name);function ee(o){let e=o.variant,t=Ne(o);return e==="expandable"?Me(o,t):Ue(o,t,e)}function Ue(o,e,t){let r=o.attr("heading"),i=o.attr("body");return`
2    <div class="${t}-wrapper">
3      ${r?`<slot name="heading"><h3 part="heading" class="heading">${f(r)}</h3></slot>`:'<slot name="heading"></slot>'}
4      ${i?`<slot name="body"><div part="body" class="body-text">${i}</div></slot>`:'<slot name="body"></slot>'}
5      ${e}
6      ${te(o)}
7    </div>
8  `}function Me(o,e){let t=o.attr("heading")||"Subscribe",r=o.attr("body");return`
9    <div class="expandable-wrapper">
10      <button part="toggle" class="expandable-toggle" type="button" data-toggle aria-expanded="false">
11        <span>${f(t)}</span>
12        <svg class="toggle-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
13          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
14        </svg>
15      </button>
16      <div class="expandable-content" role="region">
17        ${r?`<div part="body" class="body-text">${r}</div>`:""}
18        ${e}
19        ${te(o)}
20      </div>
21    </div>
22  `}function Ne(o){let e=f(o.attr("emailplaceholdertext")),t=o.attr("buttontext"),r=o.attr("thankyoucopy");return`
23    <form part="form" class="fwp-subscribe" novalidate>
24      <div part="spinner" class="loading-spinner"></div>
25
26      <input class="catchyah" type="text" tabindex="-1" autocomplete="off" aria-hidden="true">
27
28      <input type="hidden" name="list_id" value="${f(o.attr("list-id"))}">
29
30      <div class="custom-email-field hide-on-subscribe">
31        <div part="input-wrapper" class="input-border">
32          <div class="control control-input">
33            <input
34              part="email-input"
35              class="recipient_email"
36              type="email"
37              name="email"
38              placeholder="${e}"
39              autocomplete="email"
40              required
41            >
42          </div>
43          <div class="control control-button">
44            <slot name="button">
45              <button part="submit-button" type="submit" class="subscribe">
46                ${f(t)}
47              </button>
48            </slot>
49          </div>
50        </div>
51      </div>
52
53      <div class="subscribe-thanks">
54        <slot name="thanks">
55          <span part="thanks">${f(r)}</span>
56        </slot>
57      </div>
58    </form>
59  `}function te(o){let e=o.attr("disclaimer-text"),t=o.attr("disclaimer-url"),r=t?` For more information, please review our <a href="${f(t)}" target="_blank" rel="noopener noreferrer">Disclaimer and Terms of Use</a>.`:"";return`
60    <div class="subscribe-legalease hide-on-subscribe">
61      <slot name="legal">
62        <span part="legal">${f(e)}${r}</span>
63      </slot>
64    </div>
65  `}function re(o){function e(u){let d=u&&u!=="none";return`<span class="debug-indicator ${d?"on":"off"}">${d?"&#x2705;":"&#x274C;"}</span>`}function t(u,d){let m=d||"",g=!m;return`<div class="debug-row"><span class="debug-key">${f(u)}</span><span class="debug-val${g?" empty":""}">${g?"(empty)":f(m)}</span></div>`}let r=o.attr("list-id"),i=o.attr("double-optin")==="1",s=o.attr("api-endpoint")||window.pitchConfig?.subscriptionHandlerApiUrl||"/workers/subscribe",n=o.attr("tickers")||(typeof window.fwpGetTickers=="function"?window.fwpGetTickers():null)||window.pitchConfig?.tickers||"",a=Ge(o),c=o.attr("disclaimer-text"),l=c.length>60?c.substring(0,60)+"...":c;return`
66    <style>
67      .fwp-debug-panel{background:#1e1e2e;color:#cdd6f4;font-family:'SF Mono','Fira Code','Consolas',monospace;font-size:11px;line-height:1.5;padding:10px 12px;border-radius:6px;border:1px solid #45475a;margin-bottom:8px;max-height:300px;overflow-y:auto}
68      .fwp-debug-panel summary{cursor:pointer;font-weight:700;font-size:11px;color:#f38ba8;user-select:none;padding:2px 0}
69      .fwp-debug-panel summary:hover{color:#fab387}
70      .fwp-debug-panel .debug-section{margin:6px 0 2px;font-weight:600;color:#89b4fa;font-size:10px;text-transform:uppercase;letter-spacing:.05em}
71      .fwp-debug-panel .debug-row{display:flex;gap:6px;padding:1px 0;align-items:baseline}
72      .fwp-debug-panel .debug-key{color:#a6adc8;min-width:140px;flex-shrink:0}
73      .fwp-debug-panel .debug-val{color:#a6e3a1;word-break:break-all}
74      .fwp-debug-panel .debug-val.empty{color:#6c7086;font-style:italic}
75      .fwp-debug-panel .debug-indicator{font-size:13px;line-height:1}
76      .fwp-debug-panel .debug-indicator.on{color:#a6e3a1}
77      .fwp-debug-panel .debug-indicator.off{color:#f38ba8}
78    </style>
79    <details class="fwp-debug-panel" open>
80      <summary>fwpDebug &mdash; &lt;fwp-email-subscribe&gt;</summary>
81
82      <div class="debug-section">Key Settings</div>
83      <div class="debug-row"><span class="debug-key">list-id</span>${e(r)} <span class="debug-val">${f(r)}</span></div>
84      <div class="debug-row"><span class="debug-key">double-optin</span>${e(i?"1":"")} <span class="debug-val">${i?"enabled":"disabled"}</span></div>
85
86      <div class="debug-section">Content</div>
87      ${t("heading",o.attr("heading"))}
88      ${t("body",o.attr("body"))}
89      ${t("buttontext",o.attr("buttontext"))}
90      ${t("emailplaceholdertext",o.attr("emailplaceholdertext"))}
91      ${t("thankyoucopy",o.attr("thankyoucopy"))}
92
93      <div class="debug-section">Layout</div>
94      ${t("layout",o.attr("layout"))}
95      ${t("variant (resolved)",o.variant)}
96
97      <div class="debug-section">Post-Subscribe Behavior</div>
98      ${t("noredirect",o.attr("noredirect"))}
99      ${t("redirecttocurrent",o.attr("redirecttocurrent"))}
100      ${t("thankyouredirecturl",o.attr("thankyouredirecturl"))}
101      ${t("offers",o.attr("offers"))}
102      ${t("offers-mode",o.attr("offers-mode"))}
103      ${t("offers-theme",o.attr("offers-theme"))}
104      ${t("redirect \u2192 (resolved)",a)}
105
106      <div class="debug-section">API / Tracking</div>
107      ${t("api-endpoint (resolved)",s)}
108      ${t("ga-id-primary",o.attr("ga-id-primary")||window.analyticsConfig?.gaId||"")}
109      ${t("event-label",o.attr("event-label"))}
110      ${t("form-name",o.attr("form-name"))}
111      ${t("tickers (resolved)",Array.isArray(n)?n.join(","):n)}
112
113      <div class="debug-section">Behavior</div>
114      ${t("autofocus",o.attr("autofocus"))}
115
116      <div class="debug-section">Legal</div>
117      ${t("disclaimer-url",o.attr("disclaimer-url"))}
118      ${t("disclaimer-text",l)}
119    </details>
120  `}function Ge(o){return o.attr("noredirect")==="1"?"none (noredirect)":o.attr("redirecttocurrent")==="1"?"reload current page":o.attr("thankyouredirecturl")?o.attr("thankyouredirecturl"):o.attr("offers")!=="none"?o.attr("offers-mode")==="modal"?"offers modal (/offers/start)":"offers page":"none"}function f(o){return o?o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}var q=":host{--fwp-max-width:640px;--fwp-font-family:inherit;--fwp-input-height:48px;--fwp-input-bg:#fff;--fwp-input-color:#111;--fwp-input-border-color:#e5e7eb;--fwp-input-border-width:2px;--fwp-input-border-radius:8px;--fwp-input-padding:0.75rem 1rem;--fwp-input-font-size:1rem;--fwp-input-focus-border-color:#22c55e;--fwp-input-placeholder-color:#9ca3af;--fwp-button-bg:#16a34a;--fwp-button-color:#fff;--fwp-button-hover-bg:#15803d;--fwp-button-font-size:0.875rem;--fwp-button-font-weight:600;--fwp-button-letter-spacing:0.05em;--fwp-button-text-transform:uppercase;--fwp-button-padding:0.75rem 1.5rem;--fwp-button-border-radius:8px;--fwp-thanks-bg:#f0fdf4;--fwp-thanks-color:#16a34a;--fwp-thanks-font-size:1.125rem;--fwp-thanks-border-radius:8px;--fwp-thanks-padding:1.25rem;--fwp-legal-font-size:0.5rem;--fwp-legal-color:#6b7280;--fwp-legal-link-color:#2563eb;--fwp-spinner-color:#16a34a;--fwp-spinner-size:24px;--fwp-heading-font-size:1.75rem;
120--fwp-heading-font-weight:700;--fwp-heading-color:inherit;--fwp-body-font-size:1rem;--fwp-body-color:inherit;display:block;max-width:var(--fwp-max-width);font-family:var(--fwp-font-family);box-sizing:border-box}:host([hidden]){display:none}*,*::before,*::after{box-sizing:border-box}.heading{font-size:var(--fwp-heading-font-size);font-weight:var(--fwp-heading-font-weight);color:var(--fwp-heading-color);line-height:1.3;margin:0 0 0.5rem 0;letter-spacing:-0.02em}.body-text{font-size:var(--fwp-body-font-size);color:var(--fwp-body-color);line-height:1.6;margin:0 0 1rem 0}.body-text p{margin:0 0 0.75em 0}.body-text p:last-child{margin-bottom:0}.fwp-subscribe{position:relative;overflow:visible;max-width:var(--fwp-max-width);margin:0}.input-border{display:flex;gap:0;align-items:stretch;margin-bottom:0}.control{margin:0}.control-input{flex:1 1 0%}.control-button{flex:0 0 auto}.catchyah{position:absolute;left:-5000px;width:1px;height:1px;overflow:hidden}.recipient_email{width:100%;padding:var(--fwp-input-padding);font-size:var(--fwp-input-font-size);font-family:var(--fwp-font-family);color:var(--fwp-input-color);background:var(--fwp-input-bg);border:var(--fwp-input-border-width) solid var(--fwp-input-border-color);border-right:none;border-radius:var(--fwp-input-border-radius) 0 0 var(--fwp-input-border-radius);height:var(--fwp-input-height);outline:none;transition:border-color 0.2s ease;-webkit-appearance:none;appearance:none}.recipient_email::placeholder{color:var(--fwp-input-placeholder-color)}.recipient_email:hover{border-color:#d1d5db}.recipient_email:focus{border-color:var(--fwp-input-focus-border-color)}.subscribe{padding:var(--fwp-button-padding);font-size:var(--fwp-button-font-size);font-weight:var(--fwp-button-font-weight);font-family:var(--fwp-font-family);letter-spacing:var(--fwp-button-letter-spacing);text-transform:var(--fwp-button-text-transform);color:var(--fwp-button-color);background-color:var(--fwp-button-bg);border:none;border-radius:0 var(--fwp-button-border-radius) var(--fwp-button-border-radius) 0;height:var(--fwp-input-height);cursor:pointer;white-space:nowrap;display:flex;align-items:center;justify-content:center;transition:background-color 0.2s ease,opacity 0.2s ease}.subscribe:hover:not(:disabled){background-color:var(--fwp-button-hover-bg)}.subscribe:disabled{opacity:0.5;cursor:not-allowed}.fwp-subscribe.is-loading .loading-spinner{display:block}.fwp-subscribe.is-loading .subscribe{opacity:0.6;cursor:not-allowed}.loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--fwp-spinner-size);height:var(--fwp-spinner-size);border:3px solid var(--fwp-spinner-color);border-top-color:transparent;border-radius:50%;animation:fwp-spin 0.8s linear infinite;z-index:10}@keyframes fwp-spin{to{transform:translate(-50%,-50%) rotate(360deg)}}.subscribe-thanks{display:none;padding:var(--fwp-thanks-padding);background:var(--fwp-thanks-bg);border-radius:var(--fwp-thanks-border-radius);color:var(--fwp-thanks-color);font-size:var(--fwp-thanks-font-size);font-weight:500;text-align:center}.subscribe-legalease{font-size:var(--fwp-legal-font-size);line-height:1.5;color:var(--fwp-legal-color);margin:1rem 0 0 0;text-align:center;max-width:var(--fwp-max-width)}.subscribe-legalease a{color:var(--fwp-legal-link-color);text-decoration:underline}.subscribe-legalease a:hover{text-decoration:none}.hide-on-subscribe{display:block;visibility:visible;opacity:1;transition:opacity 0.3s ease}@media screen and (max-width:639px){.input-border{flex-direction:column;gap:0}.control{width:100%}.recipient_email{border-radius:var(--fwp-input-border-radius) var(--fwp-input-border-radius) 0 0;border-right:var(--fwp-input-border-width) solid var(--fwp-input-border-color);border-bottom:none}.subscribe{width:100%;padding:0.875rem 1rem;font-size:1rem;border-radius:0 0 var(--fwp-button-border-radius) var(--fwp-button-border-radius)}.heading{font-size:1.5rem}.subscribe-legalease{margin:1rem 0 0 0}}",ze=':host([layout="slim"]){--fwp-input-height:36px;--fwp-input-border-width:1px;--fwp-input-border-color:#16a34a;--fwp-input-font-size:0.875rem;--fwp-button-font-size:0.875rem;--fwp-button-padding:0.25rem 0.75rem;--fwp-input-padding:0.25rem 0.5rem;--fwp-legal-font-size:0.75rem;--fwp-heading-font-size:1rem;--fwp-body-font-size:0.875rem}.slim-wrapper{padding:0.75rem;margin-bottom:1rem;border:1px solid #16a34a;border-radius:0.5rem;background-color:#f0fdf4}.slim-wrapper .heading{margin:0 0 0.25rem 0}.slim-wrapper .body-text{margin:0 0 0.5rem 0}.slim-wrapper .subscribe-legalease{text-align:left;margin:0.5rem 0 0 0}@media screen and (max-width:639px){.slim-wrapper .recipient_email{width:100%;min-width:0}}',Be=':host([layout="expandable"]){--fwp-input-height:36px;--fwp-input-font-size:0.875rem;--fwp-button-font-size:0.875rem;--fwp-button-padding:0.375rem 0.75rem;--fwp-input-padding:0.25rem 0.5rem;--fwp-input-border-color:#d1d5db;--fwp-input-border-width:1px}.expandable-wrapper{border:2px solid #10b981;border-radius:0.5rem;margin-bottom:1rem;overflow:hidden}.expandable-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0.625rem 0.75rem;background:none;border:none;cursor:pointer;font-weight:600;font-size:0.875rem;font-family:var(--fwp-font-family);color:inherit;text-align:left}.expandable-toggle:hover{background-color:rgba(16,185,129,0.05)}.toggle-arrow{width:1.25rem;height:1.25rem;transition:transform 0.3s ease;flex-shrink:0}.toggle-arrow.rotated{transform:rotate(180deg)}.expandable-content{display:none;padding:0 0.75rem 0.75rem 0.75rem}.expandable-content.expanded{display:block}.expandable-content .body-text{margin:0 0 0.5rem 0;font-size:0.875rem}.expandable-content .subscribe-legalease{text-align:left;font-size:0.75rem;margin:0.5rem 0 0 0}';function oe(o){return o==="slim"?q+ze:o==="expandable"?q+Be:q}var w=class{constructor(e,t=3600*1e3){this.namespace=e,this.defaultTTL=t,(window.location.host.includes("localhost")||window.location.host.includes("bigscoots-staging.com"))&&(this.defaultTTL=60*1e3),this.currentTime=
120Date.now()}getKeyWithNamespace(e){return this.namespace+"_"+e}getItemWithExpiration(e){let t;try{t=localStorage.getItem(e)}catch{return null}if(!t)return null;let r;try{r=JSON.parse(t),typeof r=="string"&&(r=JSON.parse(r))}catch{return this.removeByNamespacedKey(e),null}return r.value==null?(this.removeByNamespacedKey(e),null):Date.now()>r.expiry?(this.removeByNamespacedKey(e),null):r.value}GetItem(e){return this.getItemWithExpiration(this.getKeyWithNamespace(e))}SetItem(e,t){try{localStorage.setItem(this.getKeyWithNamespace(e),JSON.stringify({value:t,expiry:this.currentTime+this.defaultTTL}))}catch{}}removeByNamespacedKey(e){try{localStorage.removeItem(e)}catch{}}RemoveItem(e){this.removeByNamespacedKey(this.getKeyWithNamespace(e))}};var O="fwp_uid";var Ke=["utm_source","utm_campaign","utm_content","utm_term","utm_medium"],ie=["referrer","start_url","tpid",...Ke],se=["tv","tc"],ne=[{input:{utm_source:"247wallst",utm_term:"Microsoft"},output:{utm_source:"msn"}},{input:{utm_source:"247wallst",utm_term:"microsoft"},output:{utm_source:"msn"}},{input:{utm_source:null,utm_campaign:null,utm_content:null,utm_term:null,utm_medium:null,referrer:""},output:{utm_source:"(direct)"}},{input:{utm_source:null,referrer:"https://247wallst.com/"},output:{utm_source:"(direct)"}},{input:{utm_source:null,referrer:"https://247wallstcom.bigscoots-staging.com/"},output:{utm_source:"(direct)"}},{input:{utm_source:null,referrer:"https://247tempo.com/"},output:{utm_source:"247tempo"}},{input:{referrer:"android-app://com.robinhood.android/",utm_source:null,start_url:"?.tsrc=rss"},output:{utm_campaign:"feed",utm_source:"robinhood",utm_medium:"link"}},{input:{referrer:"https://robinhood.com/",utm_source:null,start_url:"?.tsrc=rss"},output:{utm_campaign:"feed",utm_source:"robinhood",utm_medium:"link"}},{input:{referrer:"https://news.google.com/",utm_source:null},output:{utm_source:"google_news"}},{input:{referrer:"https://www.google.com/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://www.google.co.uk/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://www.google.ca/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://www.google.com.au/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://www.google.co.in/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://www.google.de/",utm_source:null},output:{utm_source:"google"}},{input:{referrer:"https://lens.google.com/",utm_source:null},output:{utm_source:"google",utm_medium:"google_lens"}},{input:{referrer:"android-app://com.google.android.googlequicksearchbox/",utm_source:null},output:{utm_source:"google_discover",utm_medium:"google_quicksearch_box"}},{input:{referrer:"android-app://com.google.android.googlequicksearchbox/https/www.google.com",utm_source:null},output:{utm_source:"google",utm_medium:"google_quicksearch_box"}},{input:{referrer:"android-app://com.google.android.gm/",utm_source:null},output:{utm_source:"google",utm_medium:"google_gmail"}},{input:{utm_source:"247wallst",utm_term:"newsbreak"},output:{utm_source:"newsbreak"}},{input:{utm_source:"247wallst",utm_term:"NewsBreak"},output:{utm_source:"newsbreak"}},{input:{referrer:"https://www.newsbreakapp.com/",utm_source:null},output:{utm_source:"newsbreak"}},{input:{referrer:"https://flipboard.com/",utm_source:null},output:{utm_source:"flipboard"}},{input:{referrer:"android-app://flipboard.app/",utm_source:null},output:{utm_source:"flipboard_app"}},{input:{referrer:"https://www.facebook.com/",utm_source:null},output:{utm_source:"facebook"}},{input:{referrer:"https://lm.facebook.com/",utm_source:null},output:{utm_source:"facebook"}},{input:{referrer:"http://m.facebook.com/",utm_source:null},output:{utm_source:"facebook"}},{input:{referrer:"https://l.facebook.com/",utm_source:null},output:{utm_source:"facebook"}},{input:{referrer:"https://apple.news/",utm_source:null},output:{utm_source:"apple_news"}},{input:{referrer:"https://t.co/",utm_source:null},output:{utm_source:"twitter"}},{input:{referrer:"https://www.msn.com/",utm_source:null},output:{utm_source:"msn"}},{input:{referrer:"https://www.bing.com/",utm_source:null},output:{utm_source:"bing"}},{input:{referrer:"https://www.linkedin.com/",utm_source:null},output:{utm_source:"linkedin"}},{input:{referrer:"https://us.search.yahoo.com/",utm_source:null},output:{utm_source:"yahoo"}},{input:{referrer:"https://search.yahoo.com/",utm_source:null},output:{utm_source:"yahoo"}},{input:{referrer:"https://news.search.yahoo.com/",utm_source:null},output:{utm_source:"yahoo",utm_medium:"yahoo_news"}},{input:{referrer:"https://search.aol.com/",utm_source:null},output:{utm_source:"aol"}},{input:{referrer:"http://www.smartnews.com/",utm_source:null},output:{utm_source:"smartnews"}},{input:{referrer:"https://duckduckgo.com/",utm_source:null},output:{utm_source:"duckduckgo"}},{input:{referrer:"https://c.newsnow.com/",utm_source:null},output:{utm_source:"newsnow"}},{input:{referrer:"https://c.newsnow.co.uk/",utm_source:null},output:{utm_source:"newsnow"}},{input:{referrer:"https://www.marketbeat.com/",utm_source:null},output:{utm_source:"marketbeat"}},{input:{referrer:"https://r.brevo.etailment.de/",utm_source:null},output:{utm_source:"brevo"}},{input:{referrer:"https://www.sofi.com/",utm_source:null},output:{utm_source:"sofi"}},{input:{referrer:"https://yandex.ru/",utm_source:null},output:{utm_source:"yandex"}},{input:{referrer:"https://www.etoro.com/",utm_source:null},output:{utm_source:"etoro"}},{input:{referrer:"https://aktien.guide/",utm_source:null},output:{utm_source:"aktien"}},{input:{referrer:"https://www.ecosia.org/",utm_source:null},output:{utm_source:"ecosia"}},{input:{referrer:"https://www.realcleardefense.com/",utm_source:null},output:{utm_source:"realcleardefense"}},{input:{referrer:"https://weissratings.com/",utm_source:null},output:{utm_source:"weissratings"}}];var Y=class{constructor(e){this.mappings=e}Run(e){if(!e)return e;let t={...e},r=[];
120return this.mappings.forEach(i=>{let s=!0;for(let[n,a]of Object.entries(i.input))if(s)if(n==="referrer"){if(typeof e.referrer>"u"||e.referrer===null){s=!1;break}a===null||a===""?(a="",e.referrer!==a&&(s=!1)):e.referrer.startsWith(a.toString())||(s=!1)}else if(n==="start_url"){if(typeof e.start_url>"u"||e.start_url===null){s=!1;break}e.start_url.includes(a.toString())||(s=!1)}else e[n]!==a&&(s=!1);s&&r.push(i)}),r.forEach(i=>{for(let[s,n]of Object.entries(i.output))t[s]=n}),t}},ae=Y;var _=class{constructor(e=null,t=null,r=null){this.storage=t||new w("analytics"),e?this.trackingParams=e:this.trackingParams=ie,r||(r=ne),this.trackingParamsTransformer=new ae(r)}Get(){let e={};return this.trackingParams.forEach(t=>{e[t]=this.storage.GetItem(t)}),this.log("Got utm results of",e),this.trackingParamsTransformer.Run(e)}isBeginSession(){let e=!1,t="begin_session";return this.storage.GetItem(t)||(this.log("Beginning user session since couldnt find begin session in storage"),e=!0),this.storage.SetItem(t,!0),e}extractTpidFromUtmContent(e){if(!e)return null;let t=e.split("|");if(t.length>0){let r=t[t.length-1];if(/^\d+$/.test(r))return r}return null}extractTpidFromUtmTerm(e){if(!e)return null;if(/^\d+$/.test(e)){let r=e.split("");return r.length>2?r.slice(1,-1).join(""):null}let t=e.match(/^[st](\d+)$/);if(t){let r=t[1].split("");if(r.length>2)return r.slice(1,-1).join("")}return null}getCurrentPostId(){return window.analyticsConfig?.postId}log(e){}Update(){this.log("SessionTrackingInformation->Update() running");let e=this.isBeginSession(),t=new URLSearchParams(window.location.search);this.trackingParams.forEach(r=>{let i=this.storage.GetItem(r);if(this.log(`Got ${i} from storage for key ${r}`),r==="referrer"){e&&(this.log("Is beginning session, save referrer"),i=document.referrer),i!=null&&(this.log(`Saving referrer of ${i}`),this.storage.SetItem(r,i));return}if(r==="start_url"){e&&(this.log("Is beginning session, save start_url"),i=window.location.href),i!=null&&(this.log(`Saving start_url of ${i}`),this.storage.SetItem(r,i));return}if(i){this.log("Update old item"),this.storage.SetItem(r,i),this.log(`Extending session length on ${r} with ${i} value`);return}this.log(`Did not find value for key ${r} in storage`);let s=t.get(r);e&&(this.log(`It is the beginning of the session so looking for params from the url. i value is '${r}'`),r==="tpid"&&!s&&(s?this.log("tpid was in the url so not overriding"):this.setTpidFromOtherParamsIfNotSet(t,r)),s&&(this.log("Is beginning session. Save new item"),this.storage.SetItem(r,s),this.log(`Saving ${r} with ${s} value`)))})}setTpidLog(e){this.log("- setTpidFromOtherParamsIfNotSet: "+e)}setTpidFromOtherParamsIfNotSet(e,t){this.setTpidLog("tpid was not set on the url. check other params");let r=null,i=e.get("utm_content");if(i&&(this.setTpidLog("trying to set tpid from utm_content if correct format"),r=this.extractTpidFromUtmContent(i)),!r){let s=e.get("utm_term");if(s&&(this.setTpidLog("trying to set tpid from utm_term if correct format"),r=this.extractTpidFromUtmTerm(s)),!r&&(r=this.getCurrentPostId(),!r)){this.setTpidLog("tpid wasnt in the url and couldnt find it from the page so no tpid value");return}}r&&(this.setTpidLog(`tpid value set to ${r}`),this.storage.SetItem(t,r))}};var b=class b{constructor(){this.migrateFromLegacy()}async sha256(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(s=>s.toString(16).padStart(2,"0")).join("")}migrateFromLegacy(){if(localStorage.getItem(b.LEGACY_KEY)!=="true")return;let t=this.getSubscriptionData();t.isSubscriber||(t.isSubscriber=!0,this.setSubscriptionData(t)),localStorage.removeItem(b.LEGACY_KEY)}getSubscriptionData(){try{return JSON.parse(localStorage.getItem(b.FWP_SUB_KEY))||{}}catch{return{}}}setSubscriptionData(e){localStorage.setItem(b.FWP_SUB_KEY,JSON.stringify(e))}IsSubscriber(){return this.getSubscriptionData().isSubscriber||!1}async FlagAsSubscriber(e=null,t=null){let r=this.getSubscriptionData();if(r.isSubscriber=!0,r.subscribedAt=new Date().toISOString(),e){let i=e.toLowerCase().trim();r.emh=await this.sha256(i)}t&&(r.subscriberId=t),this.setSubscriptionData(r)}
120GetEmailHash(){return this.getSubscriptionData().emh||null}GetSubscriberId(){return this.getSubscriptionData().subscriberId||null}};H(b,"FWP_SUB_KEY","fwp_sub"),H(b,"LEGACY_KEY","isEmailSubscriber");var S=b;var k=class{constructor(e,t=null){this.value=localStorage.getItem(e),this.value||(this.value=crypto.randomUUID(),localStorage.setItem(e,this.value),typeof t=="function"&&t(this.value))}toString(){return this.value}};var I=class{constructor(e,t=null){this.analyticsStorage=new w("fwp"),this.isNew=!1,this.value=this.analyticsStorage.GetItem(e),this.value||(this.value=crypto.randomUUID(),this.isNew=!0,typeof t=="function"&&t(this.value)),this.analyticsStorage.SetItem(e,this.value)}onNewSession(e){this.isNew&&typeof e=="function"&&e(this.value)}toString(){return this.value}};var y=class{constructor(){this.sessionSources=new _().Get(),this.eventParams=se,this.thisUrlParams=new URLSearchParams(window.location.search)}Get(){let e=this.thisUrlParams,t={};this.eventParams.forEach(r=>{let i=e.get(r);i!==null&&(t[r]=i)});for(let r in this.sessionSources)this.sessionSources.hasOwnProperty(r)&&this.sessionSources[r]&&(t[r]=this.sessionSources[r]);return t}};function V(){try{let o=typeof window<"u"&&window.fwpAnalytics&&window.fwpAnalytics.sessionId;if(o!=null&&o!=="")return o.toString();let e=new w("fwp").GetItem("sid");return e||null}catch{return null}}function F(){if(typeof document>"u"||!document.cookie)return null;let o=document.cookie.match(/(?:^|;\s*)_ga=([^;]+)/);if(!o)return null;let e=o[1].split(".");return e.length>=4?e.slice(2).join("."):null}function U(o){if(typeof document>"u"||!document.cookie)return null;let e=o;if(e==null&&typeof window<"u"&&window.analyticsConfig&&(e=window.analyticsConfig.gaId),!e)return null;let t=String(e).replace(/^G-/,"").replace(/[^A-Za-z0-9]/g,"");if(!t)return null;let r=document.cookie.match(new RegExp("(?:^|;\\s*)_ga_"+t+"=([^;]+)"));if(!r)return null;let i=r[1].match(/^GS\d+\.\d+\.s?(\d{8,})/);return i?i[1]:null}function j(o,e){let t=e||{},r=t.timeoutMs!=null?t.timeoutMs:2e3,i=t.intervalMs!=null?t.intervalMs:200,s=o;s==null&&typeof window<"u"&&window.analyticsConfig&&(s=window.analyticsConfig.gaId);let a=!!(s?String(s).replace(/^G-/,"").replace(/[^A-Za-z0-9]/g,""):"");return new Promise(c=>{let l=Date.now(),u=()=>{let d={gaClientId:F(),gaSessionId:U(o)};if(a?d.gaClientId&&d.gaSessionId:d.gaClientId){c(d);return}if(Date.now()-l>=r){c(d);return}setTimeout(u,i)};u()})}var Bt=new k(O),Kt=new I("sid");function ce(){try{return new URLSearchParams(window.location.search).get("fwpDebug")==="true"}catch{return!1}}function le(){return window.location.hostname.includes("localhost")}function ue(){return window.location.href.includes("staging")}function M(){return window.analyticsConfig?.postId}var x=class{constructor(e=null,t=null){this.apiEndpoint=e,this.primaryGAnalyticsId=t,this.gaIdsPromise=this.initGoogleAnalytics()}initGoogleAnalytics(){return this.primaryGAnalyticsId?j(this.primaryGAnalyticsId):Promise.resolve({gaClientId:null,gaSessionId:null})}async trackEmailSubscribe(e,t,r,i){if(typeof zaraz<"u"&&zaraz.track("email_subscribe",{...t,emh:r.emh||null}),typeof fbq<"u"){let l=r.emh?{em:r.emh}:{};fbq("track","Lead",l),fbq("trackCustom","email_subscribe",l)}typeof posthog<"u"&&posthog.capture&&posthog.capture("email_subscribe_cs",{...t,is_new:r.isNew||!1}),await new S().FlagAsSubscriber(e);let n=!1;function a(){n||(n=!0,i?.(r))}if(typeof gtag<"u"&&!r.dont_fire_ga_client_side){let l={...t,is_new:r.isNew?"true":"false",has_email_subscribed:"true"};gtag("event","email_subscribe",{...l,event_callback:a}),gtag("event","generate_lead",l),setTimeout(a,5e3)}else a()}createMergeFields(e,t,r={}){let i={...t,...e,event_category:"email_subscribe",form:t.formName||`sub_post_id_${M()}`};return r.gaClientId&&(i.gacli1=r.gaClientId),r.gaSessionId&&(i.gasid1=r.gaSessionId),i}async Subscribe(e,t,r={},i=null){let s=await this.gaIdsPromise;return new Promise((n,a)=>{let c="/workers/subscribe";(le()||ue())&&(c="https://247wallst.com"+c),this.apiEndpoint&&(c=this.apiEndpoint);let l=r.double_optin===!0,u=r.esp||"",{double_optin:d,esp:m,...g}=r,C=new y().Get(),p=this.createMergeFields(C,g,s),h=new XMLHttpRequest;h.onreadystatechange=()=>{if(h.readyState===4){if(h.status===200){try{let L=JSON.parse(h.responseText);this.trackEmailSubscribe(e,p,L,i),n(L)}catch(L){a(L)}return}a(new Error(this.getErrorMessage(h.status)))}},h.open("POST",c,!0),h.setRequestHeader("Content-type","application/json");let X=window.fwpSourcePostId||window.postId,P={email:e,list_id:t,merge_fields:p,url:window.location.href};l&&(P.double_optin=!0),u&&(P.esp=u),X&&(P.postId=X),window.location.host.includes("localhost"),h.send(JSON.stringify(P))})}getErrorMessage(e){return{404:"Resource not found",406:"Invalid email, please fix and try again",412:"Some precondition failed",500:"An error occurred, please try again"}[e]||"Subscription failed"}};var He="https://247wallst.com/esubscribe/component/latest/fwp-sms-subscribe.js",N="fwp-sms-subscribe",qe=new Set(["https:","http:"]),Ye=new Set(["fwp-sms-subscribe.js","fwp-sms-subscribe.esm.js"]),Ve=/^(.*\/)fwp-email-subscribe(?:\.auto|\.compat|\.esm)?\.js(\?.*)?$/,de=typeof document<"u"?document.currentScript:null,T=null;function je(o){let e=o.pathname.split("/").pop()||"";return Ye.has(e)}function fe(o){if(typeof o!="string"||!o)return null;let e;try{e=new URL(o,typeof location<"u"?location.origin:void 0)}catch{return null}return!qe.has(e.protocol)||!je(e)?null:e.href}function pe(o){if(!o)return null;let e=o.match(Ve);if(!e)return null;let t=`${e[1]}fwp-sms-subscribe.js${e[2]||""}`;return fe(t)}function We(){let o=pe(de&&de.src);if(o)return o;let e=document.querySelectorAll("script[src]");for(let t of e){let r=pe(t.src);if(r)return r}return He}function me(){if(customElements.get(N))return Promise.resolve();if(T)return T;let o=We(),e=fe(o);return e?(T=new Promise((t,r)=>{let i=document.createElement("script");i.src=e,i.async=!0,i.addEventListener("load",()=>{customElements.whenDefined(N).then(t,r)}
120),i.addEventListener("error",()=>{T=null,r(new Error(`Failed to load ${N} from ${e}`))}),document.head.appendChild(i)}),T):Promise.reject(new Error(`Refusing to load ${N} from unsafe URL: ${o}`))}var he="fwp_ecap_attribution",ge=/^[A-Za-z0-9_-]{8,64}$/;function we(o){try{let e=o??(typeof window<"u"&&window.location?window.location.search:"");return new URLSearchParams(e||"").get("fwp_clk")}catch{return null}}function Xe(){try{let o=typeof window<"u"&&window.sessionStorage?window.sessionStorage.getItem(he):null,e=o?JSON.parse(o):null;return e&&e.clickId?e.clickId:null}catch{return null}}function be(o){let e=we(o);if(!(!e||!ge.test(e))){try{window.sessionStorage.setItem(he,JSON.stringify({clickId:e}))}catch{return}if(o===void 0)try{let t=new URLSearchParams(window.location.search);t.delete("fwp_clk");let r=t.toString();window.history.replaceState(null,"",window.location.pathname+(r?`?${r}`:"")+window.location.hash)}catch{}}}var _e="fwp_ecap_converted";function ye(o){try{window.sessionStorage.setItem(_e,o)}catch{}}function ve(o){try{return!!o&&window.sessionStorage.getItem(_e)===o}catch{return!1}}var Se="fwp_ecap_ga_fired";function ke(o){try{window.sessionStorage.setItem(Se,o)}catch{}}function Ie(o){try{return!!o&&window.sessionStorage.getItem(Se)===o}catch{return!1}}function G(o){for(let e of[we(o),Xe()])if(e&&ge.test(e))return e;return null}var Je=/^[A-Za-z0-9_-]{1,64}$/,Ze=100;function xe(o){let e;try{let i=o??(typeof window<"u"&&window.location?window.location.search:"");e=new URLSearchParams(i||"")}catch{return null}let t=e.get("exp")||"",r=e.get("var")||"";return!Je.test(t)||r===""||r.length>Ze?null:{exp:t,var:r}}var W=["fwp_block","fwp_variant","fwp_sig"];function Te(o){let e;try{let r=o??(typeof window<"u"&&window.location?window.location.search:"");e=new URLSearchParams(r||"")}catch{return{}}let t={};for(let r of W){let i=e.get(r);i&&(t[r]=i)}return t}var Qe="https://pitcher-api.flywheel-publishing.com/api/t/conversion",Ee="/t/impression",et="/t/conversion",tt=/(^|\.)localhost$|^127\.|^0\.0\.0\.0$|^\[?::1\]?$|(^|[.-])staging([.-]|$)/;function rt(){try{let o=new URLSearchParams(window.location.search);return{utmSource:o.get("utm_source")||"",utmCampaign:o.get("utm_campaign")||"",utmMedium:o.get("utm_medium")||"",utmContent:o.get("utm_content")||"",utmTerm:o.get("utm_term")||""}}catch{return{utmSource:"",utmCampaign:"",utmMedium:"",utmContent:"",utmTerm:""}}}function ot(o){let e={...o};try{e.gaClientId||(e.gaClientId=F()||null),e.gaSessionId||(e.gaSessionId=U()||null)}catch{}return e}function it(){try{return V()?.toString()||window.fwpAnalytics?.sessionId?.toString()||""}catch{return""}}var z=class{constructor(e,t={}){this.host=e,this._fetch=t.fetch||((...r)=>window.fetch(...r)),this._hostname=t.hostname}resolveUrl(){let e=this.host.attr("pitcher-conversion-url");if(e)return e;let t=window.pitcherData?.tracking?.impressionUrl;if(typeof t=="string"&&t.includes(Ee))return t.replace(Ee,et);let r=this._hostname??window.location?.hostname??"";return tt.test(r)?"":Qe}resolveApiKey(){return this.host.attr("pitcher-tracking-key")||window.analyticsConfig?.pitcherTrackingApiKey||window.pitchConfig?.pitcherTrackingApiKey||""}async track({response:e,gaIds:t}){let r=this._resolveContext();if(!r||r.mode==="landing"&&ve(r.clickId))return null;let i=e?.isNew,s=typeof i=="boolean"?i:null,n={};try{n=await t||{}}catch{n={}}n=ot(n);let a=this._buildBody(r,s,n);r.mode==="inline"&&this._fireGa(r,s,n);let c=()=>(r.mode==="landing"&&this._fireLandingGaOnce(r,s,n),null),l=(p,h={})=>c(),u=this.resolveUrl();if(!u)return l("no pitcher endpoint for this host",{hostname:this._hostname??window.location?.hostname});let d=this.resolveApiKey();if(!d)return l("no tracking key");let m=null;try{let p=await this._fetch(u,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":d},body:JSON.stringify(a),keepalive:!0});if(!p||!p.ok){let h=p&&typeof p.text=="function"?await p.text().catch(()=>""):"";return c()}m=typeof p.json=="function"?await p.json().catch(()=>null):null}catch{return c()}let g={...r,pitchId:m?.pitchId||r.pitchId||"",campaignId:m?.campaignId||r.campaignId||"",pitchName:m?.pitchName||r.pitchName||""},C=m?.deduplicated===!0;return r.mode==="landing"&&(ye(r.clickId),C||this._fireLandingGaOnce(g,s,n)),{mode:r.mode,deduplicated:C,pitchId:g.pitchId,campaignId:g.campaignId,pitchName:g.pitchName}}
120_resolveContext(){let e=this.host.closest?.("[data-pitch-id]"),t=e?.getAttribute("data-pitch-id")||"";if(t)return{mode:"inline",pitchId:t,pitchName:e.getAttribute("data-pitch-name")||"",impressionId:e.getAttribute("data-impression-id")||"",campaignId:e.getAttribute("data-campaign-id")||"",positionId:e.getAttribute("data-position-id")||"",lineupId:e.getAttribute("data-lineup-id")||""};let r=G();return r?{mode:"landing",clickId:r,pitchId:"",pitchName:"",campaignId:"",impressionId:"",positionId:""}:null}_buildBody(e,t,r){let i={conversionType:"ecap",position:e.positionId,referrer:typeof document<"u"&&document.referrer||"",gaClientId:r.gaClientId||"",...rt(),metadata:{isNew:t}};if(e.mode==="inline"){i.pitchId=e.pitchId,i.impressionId=e.impressionId,i.campaignId=e.campaignId,i.lineupId=e.lineupId||window.pitcherData?.lineupId||window.pitcherData?.tracking?.lineupId||window.pitchConfig?.pitcherLineupId||"";let s=window.pitchConfig?.postId||M();i.postId=s?String(s):""}else i.clickId=e.clickId;return i}_fireLandingGaOnce(e,t,r){Ie(e.clickId)||this._fireGa(e,t,r)&&ke(e.clickId)}_fireGa(e,t,r){if(typeof window.gtag!="function")return!1;let i={pitch_id:e.pitchId||void 0,pitch_name:e.pitchName||void 0,click_id:e.clickId||void 0,campaign_id:e.campaignId||void 0,impression_id:e.impressionId,position:e.positionId,is_new_subscriber:t,url:window.location.href,pitcher_api:!0,non_interaction:!1,ga_client_id:r.gaClientId||void 0,ga_session_id:r.gaSessionId||void 0},s=it();return window.gtag("event","pitch_ecap",s?{...i,fwp_sid:s}:i),!0}};var st="/offers/start",Ce="fwp-offers-frame",v="fwp-offers-dialog",Ae="fwp-offers-dialog-style";var nt=`
121dialog.${v}{border:0;padding:0;margin:0;background:transparent;max-width:none;max-height:none;width:100%;height:100%;inset:0;position:fixed;display:none;overflow:auto;-webkit-overflow-scrolling:touch}
122dialog.${v}[open]{display:flex}
123dialog.${v}::backdrop{background:#0e1a13}
124dialog.${v}[data-theme="dark"]::backdrop{background:#0b0c0e}
125.fwp-offers-sheet{width:min(720px,calc(100vw - 32px));margin:auto;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);background:#fff;border-radius:14px;box-shadow:0 30px 80px rgba(0,0,0,.55);overflow:hidden;display:flex;flex-direction:column}
126dialog.${v}[data-theme="dark"] .fwp-offers-sheet{background:#17181b}
127.fwp-offers-sheet iframe{display:block;flex:0 1 auto;min-height:0;width:100%;height:420px;border:0;background:transparent}
128@media (max-width:640px){.fwp-offers-sheet{width:calc(100vw - 24px);max-height:92vh;max-height:92dvh}}
129`,E=null,B=class{constructor({onDone:e,onUnavailable:t}){this.onDone=e,this.onUnavailable=t,this.startUrl=st,this._active=!1,this._revealed=!1,this._heard=!1,this._readyTimer=null,this._loadTimer=null,this._onMessage=this._handleMessage.bind(this),this._onFrameLoad=this._handleFrameLoad.bind(this)}open(e){let{dialog:t,frame:r}=at();this._dialog=t,this._frame=r,t._fwpOwner&&t._fwpOwner!==this&&t._fwpOwner._deactivate(),this._deactivate(),t._fwpOwner=this,this._active=!0,this._revealed=!1,this._heard=!1,t.setAttribute("data-theme",e.theme==="dark"?"dark":"light"),t.hasAttribute("open")&&this._hide(),window.addEventListener("message",this._onMessage),r.addEventListener("load",this._onFrameLoad),this._readyTimer=setTimeout(()=>this._giveUp(),1e4);let i=document.createElement("form");i.method="POST",i.action=this.startUrl,i.target=Ce,i.style.display="none";for(let[s,n]of Object.entries(e)){if(n==null)continue;let a=document.createElement("input");a.type="hidden",a.name=s,a.value=String(n),i.appendChild(a)}document.body.appendChild(i),i.submit(),document.body.removeChild(i)}close(){this._hide(),this._deactivate()}_reveal(){if(this._revealed)return;this._revealed=!0;let e=this._dialog;!e||e.hasAttribute("open")||(typeof e.showModal=="function"?e.showModal():e.setAttribute("open",""))}_hide(){let e=this._dialog;e&&e.hasAttribute("open")&&(typeof e.close=="function"?e.close():e.removeAttribute("open"))}_deactivate(){this._active=!1,window.removeEventListener("message",this._onMessage),this._frame&&this._frame.removeEventListener("load",this._onFrameLoad),clearTimeout(this._readyTimer),clearTimeout(this._loadTimer),this._readyTimer=null,this._loadTimer=null}_handleFrameLoad(){if(!this._active||this._heard)return;let e="";try{e=this._frame.contentWindow.location.href}catch{}e!=="about:blank"&&(clearTimeout(this._loadTimer),this._loadTimer=setTimeout(()=>{this._active&&!this._heard&&this._giveUp()},1e3))}_giveUp(){this._active&&(this.close(),this.onUnavailable())}_cancel(){this._active&&(this.close(),this.onDone(null))}_handleMessage(e){if(!this._active||e.origin!==window.location.origin)return;let t=e.data;if(!(!t||typeof t!="object"||typeof t.type!="string"||t.type.indexOf("fwp-offer-flow:")!==0))if(this._heard=!0,clearTimeout(this._readyTimer),clearTimeout(this._loadTimer),t.type==="fwp-offer-flow:resize"){let r=Math.max(280,Math.ceil(Number(t.height)||0));this._frame&&(this._frame.style.height=`${r}px`),this._reveal()}else t.type==="fwp-offer-flow:done"?(this.close(),this.onDone(typeof t.redirect=="string"&&t.redirect?t.redirect:null)):t.type==="fwp-offer-flow:unavailable"&&(this.close(),this.onUnavailable())}};function at(){if(E&&E.dialog.isConnected)return E;if(!document.getElementById(Ae)){let r=document.createElement("style");r.id=Ae,r.textContent=nt,document.head.appendChild(r)}let o=document.createElement("dialog");o.className=v,o.setAttribute("aria-label","Partner offers");let e=document.createElement("div");e.className="fwp-offers-sheet";let t=document.createElement("iframe");return t.name=Ce,t.title="Partner offers",e.appendChild(t),o.appendChild(e),document.body.appendChild(o),o.addEventListener("cancel",r=>{r.preventDefault(),o._fwpOwner&&o._fwpOwner._cancel()}),E={dialog:o,frame:t},E}var A=class{constructor(e){this.host=e,this.shadow=e.shadowRoot,this._onSubmit=this._handleSubmit.bind(this),this._onToggle=this._handleToggle.bind(this),this._client=null,this._conversion=null}bind(){let e=this.shadow.querySelector("form");if(!e)return;e.addEventListener("submit",this._onSubmit),this._maybeAutoOpenOffersModal();let t=this.shadow.querySelector("[data-toggle]");t&&t.addEventListener("click",this._onToggle),new _().Update(),this._client=new x(this.host.attr("api-endpoint")||window.pitchConfig?.subscriptionHandlerApiUrl||void 0,this.host.attr("ga-id-primary")||window.analyticsConfig?.gaId||void 0)}unbind(){let e=this.shadow.querySelector("form");e&&e.removeEventListener("submit",this._onSubmit);let t=this.shadow.querySelector("[data-toggle]");t&&t.removeEventListener("click",this._onToggle),this._client=null}_handleSubmit(e){if(e.preventDefault(),this.shadow.querySelector(".catchyah")?.value)return;let i=this.shadow.querySelector(".recipient_email")?.value?.trim();if(!i)return;this._lastEmail=i;let s=this.host.attr("list-id");
129this._setLoading(!0);let n=this._collectAdditionalParams();this._client.Subscribe(i,s,n).then(a=>this._onSuccess(a)).catch(a=>this._onError(a))}_collectAdditionalParams(){let e={},t=window.analyticsConfig?.postId||window.fwpSourcePostId||window.postId;e.formName=this.host.attr("form-name")||`sub_post_id_${t||"unknown"}`;let r=this.host.attr("event-label");r&&(e.event_label=r);let i=this._resolveTickers();i&&(e.tickers=i),window.pitchConfig?.primaryTickers&&(e.primaryTickers=window.pitchConfig.primaryTickers);let s=this.host.attr("category")||window.analyticsConfig?.primaryCategory;s&&(e.category=s);let n=G();n&&(e.fwp_click_id=n);try{let c=window.fwpAnalytics?.userId?.toString(),l=window.fwpAnalytics?.sessionId?.toString();c&&(e.user_id=c),l&&(e.session_id=l);let u=window.posthog?.get_session_id?.();u&&(e.phsid=u)}catch{}Array.isArray(window.experiments)&&window.experiments.length&&(e.experiments=window.experiments),this.host.attr("double-optin")==="1"&&(e.double_optin=!0);let a=this.host.attr("esp");return a&&(e.esp=a),e}_setLoading(e){let t=this.shadow.querySelector("form");if(!t)return;t.classList.toggle("is-loading",e);let r=this.shadow.querySelector(".subscribe"),i=this.shadow.querySelector(".recipient_email");r&&(r.disabled=e),i&&(i.disabled=e)}_trackPitcherConversion(e){let t=this._client?.gaIdsPromise??Promise.resolve({});this._conversion??(this._conversion=new z(this.host)),this._conversion.track({response:e,gaIds:t}).catch(()=>null)}_onSuccess(e){this._setLoading(!1),this._collectRedirectData(e),this._trackPitcherConversion(e),this.shadow.querySelectorAll(".hide-on-subscribe").forEach(r=>{r.style.display="none"});let t=this.shadow.querySelector(".subscribe-thanks");if(t&&(this._updateThanksText(t),t.style.display="block"),this.host.dispatchEvent(new CustomEvent("fwp-subscribe-success",{bubbles:!0,composed:!0,detail:{response:e}})),this.host.attr("sms-capture")==="1"){this._renderSmsCapture();return}this._handleRedirect()}_renderSmsCapture(){me().then(()=>this._insertSmsElement()).catch(e=>{this._handleRedirect()})}_insertSmsElement(){let e=document.createElement("fwp-sms-subscribe");for(let i of Array.from(this.host.attributes))i.name.startsWith("sms-")&&i.name!=="sms-capture"&&e.setAttribute(i.name.slice(4),i.value);this._lastEmail&&e.setAttribute("email",this._lastEmail);let t=()=>{e.removeEventListener("fwp-sms-success",t),e.removeEventListener("fwp-sms-error",t),e.removeEventListener("fwp-sms-skip",t),this._handleRedirect()};e.addEventListener("fwp-sms-success",t),e.addEventListener("fwp-sms-error",t),e.addEventListener("fwp-sms-skip",t);let r=this.shadow.querySelector(".subscribe-thanks");r&&r.parentNode?r.parentNode.insertBefore(e,r.nextSibling):this.shadow.appendChild(e)}_onError(e){this._setLoading(!1);let t=e?.message||"An error occurred, please try again";alert(t),this.host.dispatchEvent(new CustomEvent("fwp-subscribe-error",{bubbles:!0,composed:!0,detail:{error:e}}))}_resolveTickers(){let e=this.host.attr("tickers");if(e)return e;if(typeof window.fwpGetTickers=="function"){let t=window.fwpGetTickers();if(t)return Array.isArray(t)?t.join(","):t}return window.pitchConfig?.tickers}_isDebugRedirect(){try{return new URLSearchParams(window.location.search).get("redirect")==="0"}catch{return!1}}_getOffersHandlerUrl(){return window.pitchConfig?.offersHandler||"https://247wallst.com/thank-you-offers/"}_getOffersServiceName(){let e=this.host.attr("offers");return e&&e!=="none"?e:window.pitchConfig?.defaultOffersService||"afterOffers"}_collectRedirectData(e){let t={};try{t=new y().Get()}catch{}this._redirectData={email:this._lastEmail||"",response:e,eventTrackingParams:t,tickers:this._resolveTickers()||"",primaryTickers:window.pitchConfig?.primaryTickers||"",offersService:this._getOffersServiceName(),listId:this.host.attr("list-id")||"",experiment:xe()}}_buildOffersParams(){let e=this._redirectData||{},t={offersService:e.offersService||this._getOffersServiceName(),email:e.email||"",...e.eventTrackingParams||{}};e.tickers&&(t.tickers=e.tickers),e.primaryTickers&&(t.primaryTickers=e.primaryTickers),e.listId&&(t.list_id=e.listId),e.experiment?(t.exp=e.experiment.exp,t.var=e.experiment.var):(delete t.exp,delete t.var);for(let i of W)delete t[i];Object.assign(t,Te());let r=this.host.attr("thankyouredirecturl");return r&&(t.redirect=r),t}_postToOffersPage(e){let t=this._buildOffersParams(),r=document.createElement("form");r.method="POST",r.action=e,r.style.display="none";for(let[i,s]of Object.entries(t)){if(s==null)continue;let n=document.createElement("input");n.type="hidden",n.name=i,n.value=String(s),r.appendChild(n)}document.body.appendChild(r),r.submit(),document.body.removeChild(r)}_isOffersModalMode(){return this.host.attr("offers-mode")==="modal"}_openOffersModal(){this._offersModal||(this._offersModal=new B({onDone:r=>{let i=r||this.host.attr("thankyouredirecturl");i&&this._navigate(i)},onUnavailable:()=>this._postToOffersPage(this._getOffersHandlerUrl())}));let e={...this._buildOffersParams(),mode:"modal"},t=this.host.attr("offers-theme");(t==="dark"||t==="light")&&(e.theme=t),this._offersModal.open(e)}_maybeAutoOpenOffersModal(){if(!this._isOffersModalMode())return;let e;try{e=new URLSearchParams(window.location.search)}catch{return}e.get("fwp_offers")==="open"&&setTimeout(()=>this._openOffersModal(),0)}_navigate(e){window.location.href=e}_willRedirect(){return this.host.attr("noredirect")==="1"?!1:!!(this.host.attr("redirecttocurrent")==="1"||this.host.attr("offers")!=="none"||this.host.attr("thankyouredirecturl"))}_updateThanksText(e){if(this.host.hasAttribute("thankyoucopy"))return;let t=e.querySelector('[part="thanks"]');t&&(t.textContent=this._willRedirect()?"Thanks! Please hold while we redirect you...":"Thanks for subscribing! Please check your email.")}_handleRedirect(){if(this.host.attr("noredirect")==="1")return;let e=this._isDebugRedirect(),t=this.host.attr("offers")==="none";if(this.host.attr("redirecttocurrent")==="1"){if(e)return;setTimeout(()=>window.location.reload(),2e3);return}if(!t){if(this._isOffersModalMode()){if(e)return;setTimeout(()=>this._openOffersModal(),2e3);return}let i=this._getOffersHandlerUrl();if(e)return;setTimeout(()=>this._postToOffersPage(i),2e3);return}let r=this.host.attr("thankyouredirecturl");
129if(r){if(e)return;setTimeout(()=>this._navigate(r),2e3)}}_handleToggle(){let e=this.shadow.querySelector(".expandable-content");if(!e)return;let t=e.classList.toggle("expanded"),r=this.shadow.querySelector(".toggle-arrow");r&&r.classList.toggle("rotated",t);let i=this.shadow.querySelector("[data-toggle]");i&&i.setAttribute("aria-expanded",String(t))}};be();var K=class extends HTMLElement{static get observedAttributes(){return Q}constructor(){super(),this.attachShadow({mode:"open"}),this._formHandler=null}connectedCallback(){this.render(),this._formHandler=new A(this),this._formHandler.bind(),this._autoFocus()}_autoFocus(){if(this.attr("autofocus")!=="1")return;let e=this.shadowRoot.querySelector(".recipient_email");e&&e.focus()}disconnectedCallback(){this._formHandler?.unbind(),this._formHandler=null}attributeChangedCallback(e,t,r){t!==r&&this.isConnected&&(this._formHandler?.unbind(),this.render(),this._formHandler=new A(this),this._formHandler.bind())}attr(e){return this.getAttribute(e)??Z[e]??""}get variant(){let e=this.attr("layout");return e==="slim"||e==="expandable"?e:"default"}render(){let e=oe(this.variant),t=ee(this),r=ce()?re(this):"";this.shadowRoot.innerHTML=`<style>${e}</style>${r}${t}`}};customElements.get("fwp-email-subscribe")||customElements.define("fwp-email-subscribe",K);return Fe(ct);})();
130//# sourceMappingURL=fwp-email-subscribe.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.