PageSourceSearch

https://www.sharkscope.com/v7/assets/PublishingView-CwwYnsXY.js

js sharkscope.com collected 2026-10-03 21:06:39 UTC 20,195 bytes, 15 lines download raw bytes

1import{a6 as He,I as Oe,x as a,gu as ge,t,gv as $e,gw as je,w as e,gx as I,gy as Ye,gz as Ge,gA as Xe,gB as ze,gC as Je,gD as qe,gE as Ve,gF as Ze,gG as Ke,bp as Qe}from"./core-hEbRg-IQ.js";const et="Serving generated demo data — add ?provider=real or clear localStorage ss_v7_provider",fe=/^\S+@\S+\.\S+$/,tt=["https://discord.com/api/webhooks/","https://discordapp.com/api/webhooks/"],st=2e3,nt=15e4,X=["custom1","custom2","custom3"];function p(i){switch(i){case"Connected":return{text:t("Connected."),tone:"ok"};case"Saved":return{text:t("Your email destinations were saved."),tone:"ok"};case"Removed":return{text:t("Disconnected."),tone:"ok"};case"InvalidUrl":return{text:t("That doesn’t look like a valid URL — please check it and try again."),tone:"err"};case"Unreachable":return{text:t("We couldn’t reach that webhook — check the URL is correct and still active."),tone:"err"};case"AuthenticationFailed":return{text:t("Bluesky rejected those details — check your handle and app password."),tone:"err"};case"EncryptionNotConfigured":return{text:t("Bluesky isn’t available right now — server encryption isn’t configured."),tone:"err"};case"InvalidRequest":return{text:t("Please enter both your Bluesky handle and an app password."),tone:"err"};case"InvalidEmail":return{text:t("One of the addresses isn’t valid — please check it and try again."),tone:"err"};case"BotNotConfigured":return{text:t("Telegram isn’t available right now — the bot isn’t configured."),tone:"err"};case"NotConnected":return{text:t("Not connected."),tone:"info"};default:return{text:i,tone:"info"}}}function x(i){return Qe(i)}function T({fb:i}){return i===null?null:e.jsx("p",{className:`pub-msg pub-msg-${i.tone}`,role:i.tone==="err"?"alert":"status",children:i.text})}function D({kind:i}){const W=i==="connected"?"Connected":i==="unavailable"?t("Not available"):t("Not connected");return e.jsx("span",{className:`pub-badge pub-badge-${i}`,children:W})}function at(){return e.jsxs("svg",{className:"pub-icon",viewBox:"0 0 24 24",width:"26",height:"26","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),e.jsx("path",{d:"m3 7 9 6 9-6"})]})}function it(){const{user:i,openLogin:W}=He(),z=Oe()==="demo",U=!z&&!(i!==null),r=a.useRef(!0);a.useEffect(()=>()=>{r.current=!1},[]);const[l,J]=a.useState(null),[q,H]=a.useState("loading"),h=a.useCallback(()=>{ge().then(s=>{r.current&&J(s)}).catch(()=>{})},[]),[g,ye]=a.useState(null),[O,$]=a.useState("loading"),[V,Z]=a.useState(!0),[K,Q]=a.use
1State(!1),[ee,te]=a.useState(!1),[d,F]=a.useState([]),[u,se]=a.useState(!1),[ke,B]=a.useState(null),Y=a.useCallback(s=>{ye(s);const n=new Map(s.slots.map(E=>[E.slot,E])),o=n.get("account"),c=n.get("manager"),C=n.get("secondary_manager");Z(o?o.enabled:!0),Q(c?c.enabled:!1),te(C?C.enabled:!1);const b=[];for(const E of X){const _=n.get(E);_&&_.customEmail!==null&&_.customEmail!==""&&b.push({slot:E,email:_.customEmail})}F(b)},[]),[ne,ae]=a.useState(""),[w,P]=a.useState(!1),[ve,f]=a.useState(null),[S,L]=a.useState(!1),[Ne,m]=a.useState(null),M=a.useRef(null),y=a.useCallback(()=>{M.current!==null&&(window.clearInterval(M.current),M.current=null)},[]);a.useEffect(()=>y,[y]);const we=a.useCallback(()=>{y();const s=Date.now();M.current=window.setInterval(()=>{if(Date.now()-s>nt){y(),r.current&&m({text:t("We didn’t detect a connection — tap Connect to try again."),tone:"info"});return}$e().then(n=>{n==="Connected"&&(y(),r.current&&(m({text:t("Connected."),tone:"ok"}),h()))}).catch(()=>{})},st)},[h,y]),[le,Ce]=a.useState(""),[oe,ce]=a.useState(""),[k,A]=a.useState(!1),[Se,v]=a.useState(null),[ie,Ee]=a.useState(""),[G,re]=a.useState("json"),[j,R]=a.useState(!1),[Te,N]=a.useState(null);a.useEffect(()=>{if(U)return;let s=!1;return H("loading"),ge().then(n=>{s||(J(n),H("ready"))}).catch(()=>{s||H("error")}),$("loading"),je().then(n=>{s||(Y(n),$("ready"))}).catch(()=>{s||$("error")}),()=>{s=!0}},[U,Y]);function De(){if(d.length>=3)return;const s=new Set(d.map(o=>o.slot)),n=X.find(o=>!s.has(o));n!==void 0&&F([...d,{slot:n,email:""}])}function Fe(s){F(d.filter(n=>n.slot!==s))}function Be(s,n){F(d.map(o=>o.slot===s?{...o,email:n}:o))}function Pe(){if(u||g===null)return;for(const c of d)if(!fe.test(c.email.trim())){B({text:t("Please enter a valid address in each custom email row, or remove it."),tone:"err"});return}const s=g;se(!0),B(null);const n=[I("account",{enabled:V})];s.managerEmail!==null&&n.push(I("manager",{enabled:K})),s.secondaryManagerEmail!==null&&n.push(I("secondary_manager",{enabled:ee}));for(const c of d)n.push(I(c.slot,{customEmail:c.email.trim(),enabled:!0}));const o=new Set(d.map(c=>c.slot));for(const c of X)s.slots.some(b=>b.slot===c&&b.customEmail!==null&&b.customEmail!=="")&&!o.has(c)&&n.push(Ye(c));Promise.all(n).then(c=>{const C=c.find(b=>b!=="Saved"&&b!=="Removed");return B(C!==void 0?p(C):{text:t("Your email destinations were saved."),tone:"ok"}),je()}).then(c=>{r.current&&Y(c)}).catch(c=>B({text:x(c),tone:"err"})).finally(()=>{r.current&&se(!1)})}function Le(){const s=ne.trim();if(!tt.some(n=>s.startsWith(n))){f({text:t("Enter a Discord webhook URL beginning with https://discord.com/api/webhooks/"),tone:"err"});return}P(!0),f(null),Ge(s).then(n=>{f(p(n)),n==="Connected"&&(ae(""),h())}).catch(n=>f({text:x(n),tone:"err"})).finally(()=>{r.current&&P(!1)})}function Me(){P(!0),f(null),Xe().then(s=>{f(p(s)),h()}).catch(s=>f({text:x(s),tone:"err"})).finally(()=>{r.current&&P(!1)})}function Ae(){L(!0),m(null),ze().then(s=>{if(s==="BotNotConfigured"){m(p(s));return}window.open(s,"_blank","noopener,noreferrer"),m({text:t("Telegram opened in a new tab — tap Start there, then come back. We’ll detect the connection automatically."),tone:"info"}),we()}).catch(s=>m({text:x(s),tone:"err"})).finally(()=>{r.current&&L(!1)})}function Re(){y(),L(!0),m(null),Je().then(s=>{m(p(s)),h()}).catch(s=>m({text:x(s),tone:"err"})).finally(()=>{r.current&&L(!1)})}function _e(){const s=le.trim(),n=oe.trim();if(s===""||n===""){v({text:t("Please enter both your Bluesky handle and an app password."),tone:"err"});return}A(!0),v(null),qe(s,n).then(o=>{v(p(o)),o==="Connected"&&(ce(""),h())}).catch(o=>v({text:x(o),tone:"err"})).finally(()=>{r.current&&A(!1)})}function Ie(){A(!0),v(null),Ve().then(s=>{v(p(s)),h()}).catch(s=>v({text:x(s),tone:"err"})).finally(()=>{r.current&&A(!1)})}function We(){const s=ie.trim();if(!/^https?:\/\/.+/i.test(s)){N({text:t("Enter a valid http(s) URL."),tone:"err"});return}R(!0),N(null),Ze(s,G).then(n=>{N(p(n)),n==="Connected"&&h()}).catch(n=>N({text:x(n),tone:"err"})).finally(()=>{r.current&&R(!1)})}function Ue(){R(!0),N(null),Ke().then(s=>{N(p(s)),h()}).catch(s=>N({text:x(s),tone:"err"})).finally(()=>{r.current&&R(!1)})}const de=e.jsxs("div",{className:"pub-head",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:t("Alert destinations")}),e.jsx("p",{className:"page-sub",children:t("Once a destination is connected here, you choose which players to publish from the Publish tab.")})]}),z&&e.jsx("span",{className:"chip",title:et,children:t("demo data")})]});if(U)return e.jsxs("div",{className:"pub-wrap",children:[de,e.jsxs("div",{className:"panel pub-gate",children:[e.jsx("p",{className:"pub-gate-text",children:t("Log in to connect and manage your publishing destinations. They’re free for any SharkScope account.")}),e.jsx("button",{type:"button",className:"btn btn-cta",onClick:W,children:t("Log in")})]})]});const ue=(l==null?void 0:l.hasDiscord)===!0,he=(l==null?void 0:l.telegramAvailable)===!0,me=(l==null?void 0:l.hasTelegram)===!0,be=(l==null?void 0:l.blueskyAvailable)===!0,pe=(l==null?void 0:l.hasBluesky)===!0,xe=(l==null?void 0:l.hasWebhook)===!0;return e.jsxs("div",{className:"pub-wrap",children:[de,q==="loading"&&e.jsx("div",{className:"panel",style:{marginTop:14},children:e.jsxs("div",{className:"search-loading",role:"status",style:{border:0},children:[e.jsx("span",{className:"spinner","aria-hidden":"true"}),t("Loading your destinations…")]})}),q==="error"&&e.jsx("div",{className:"panel pub-gate",style:{marginTop:14},children:e.jsx("p",{className:"pub-msg pub-msg-err",role:"alert",children:t("Your destinations couldn’t be loaded — please reload the page and try again.")})}),l!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"panel pub-panel","aria-busy":u||void 0,"aria-label":t("Email"),children:[e.jsxs("div",{className:"pub-panel-head",children:[e.jsx(at,{}),e.jsx("h2",{className:"pub-panel-title",children:t("Email")}),e.jsx(D,{kind:"connected"})]}),e.jsx("p",{className:"pub-panel-sub",children:t("Deliver notifications to your account email, your manager’s email and up to three custom addresses. No verification needed — turn each address on or off below.")}),O==="loading"&&e.jsxs("div",{className:"search-loading",role:"status",style:{border:0},children:[e.jsx("span",{className:"spinner","aria-hidden":"true"}),t("Loading email addresses…")]}),O==="error"&&e.jsx("p",{className:"pub-msg pub-msg-err",role:"alert",children:t("Your email addresses couldn’t be loaded — please reload the page.")}),O==="ready"&&g!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pub-email-list",children:[e.jsxs("div",{className:"pub-email-row",children:[e.jsxs("label",{className:"pub-check",children:[e.jsx("input",{type:"checkbox",checked:V,onChange:s=>Z(s.target.checked),disabled:u}),e.jsx("span",{children:t("Account email")})]}),e.jsx("span",{className:"pub-email-addr",children:g.accountEmail})]}),g.managerEmail!==null&&e.jsxs("div",{className:"pub-email-row",children:[e.jsxs("label",{className:"pub-check",children:[e.jsx("input",{type:"checkbox",checked:K,onChange:s=>Q(s.target.checked),disabled:u}),e.jsx("span",{children:t("Manager’s email")})]}),e.jsx("span",{className:"pub-email-addr",children:g.managerEmail})]}),g.secondaryManagerEmail!==null&&e.jsxs("div",{className:"pub-email-row",children:[e.jsxs("label",{className:"pub-check",children:[e.jsx("input",{type:"checkbox",checked:ee,onChange:s=>te(s.target.checked),disabled:u}),e.jsx("span",{children:t("Secondary manager’s email")})]}),e.jsx("span",{className:"pub-email-addr",children:g.secondaryManagerEmail})]}),d.map(s=>{const n=s.email!==""&&!fe.test(s.email.trim());return e.jsxs("div",{className:"pub-email-row pub-email-custom",children:[e.jsx("label",{className:"pub-email-custom-label",htmlFor:`pub-${s.slot}`,children:t("Custom email")}),e.jsx("input",{id:`pub-${s.slot}`,className:"field pub-email-input",type:"email",autoComplete:"email",placeholder:"[email protected]",value:s.email,onChange:o=>Be(s.slot,o.target.value),disabled:u,"aria-invalid":n||void 0}),e.jsx("button",{type:"button",className:"btn btn-outline btn-sm",onClick:()=>Fe(s.slot),disabled:u,children:t("Remove")})]},s.slot)})]}),e.jsxs("div",{className:"pub-actions",children:[e.jsx("button",{type:"button",className:"btn btn-outline btn-sm",onClick:De,disabled:u||d.length>=3,children:t("Add another email")}),e.jsx("button",{type:"button",className:"btn btn-cta",onClick:Pe,disabled:u,children:u?t("Saving…"):t("Save emails")})]}),e.jsx(T,{fb:ke})]})]}),e.jsxs("section",{className:"panel pub-panel","aria-busy":w||void 0,"aria-label":t("Discord"),
1children:[e.jsxs("div",{className:"pub-panel-head",children:[e.jsx("img",{className:"pub-icon",src:"/images/sliders/images_discord.svg",alt:"",width:26,height:26}),e.jsx("h2",{className:"pub-panel-title",children:t("Discord")}),e.jsx(D,{kind:ue?"connected":"notconnected"})]}),ue?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("Achievements are posted to your Discord channel.")}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-outline",onClick:Me,disabled:w,children:w?t("Disconnecting…"):t("Disconnect")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("How to connect:")}),e.jsxs("ol",{className:"pub-steps",children:[e.jsx("li",{children:t("In your Discord server, open Server Settings.")}),e.jsx("li",{children:t("Go to Integrations, then Webhooks.")}),e.jsx("li",{children:t("Create a New Webhook and pick the channel to post to.")}),e.jsx("li",{children:t("Copy the webhook URL and paste it below.")})]}),e.jsxs("div",{className:"pub-field-row",children:[e.jsx("label",{className:"pub-label",htmlFor:"pub-discord-url",children:t("Webhook URL")}),e.jsx("input",{id:"pub-discord-url",className:"field",type:"url",inputMode:"url",placeholder:"https://discord.com/api/webhooks/...",value:ne,onChange:s=>ae(s.target.value),disabled:w})]}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-cta",onClick:Le,disabled:w,children:w?t("Connecting…"):t("Connect")})})]}),e.jsx(T,{fb:ve})]}),e.jsxs("section",{className:"panel pub-panel","aria-busy":S||void 0,"aria-label":t("Telegram"),children:[e.jsxs("div",{className:"pub-panel-head",children:[e.jsx("img",{className:"pub-icon",src:"/images/sliders/images_telegram.svg",alt:"",width:26,height:26}),e.jsx("h2",{className:"pub-panel-title",children:t("Telegram")}),e.jsx(D,{kind:he?me?"connected":"notconnected":"unavailable"})]}),he?me?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("Achievements are sent to your Telegram chat.")}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-outline",onClick:Re,disabled:S,children:S?t("Disconnecting…"):t("Disconnect")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("How to connect:")}),e.jsxs("ol",{className:"pub-steps",children:[e.jsx("li",{children:t("Click Connect — the SharkScope bot opens in a new tab.")}),e.jsx("li",{children:t("Tap Start in Telegram to link your chat.")}),e.jsx("li",{children:t("Come back here — this page updates automatically once linked.")})]}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-cta",onClick:Ae,disabled:S,children:S?t("Opening…"):t("Connect")})})]}):e.jsx("p",{className:"pub-panel-sub",children:t("Telegram notifications aren’t available at the moment — the bot isn’t configured.")}),e.jsx(T,{fb:Ne})]}),e.jsxs("section",{className:"panel pub-panel","aria-busy":k||void 0,"aria-label":t("Bluesky"),children:[e.jsxs("div",{className:"pub-panel-head",children:[e.jsx("img",{className:"pub-icon",src:"/images/sliders/images_bluesky.svg",alt:"",width:26,height:26}),e.jsx("h2",{className:"pub-panel-title",children:t("Bluesky")}),e.jsx(D,{kind:be?pe?"connected":"notconnected":"unavailable"})]}),be?pe?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("Achievements are posted to your Bluesky account.")}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-outline",onClick:Ie,disabled:k,children:k?t("Disconnecting…"):t("Disconnect")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("How to connect:")}),e.jsxs("ol",{className:"pub-steps",children:[e.jsx("li",{children:t("In Bluesky, open Settings, then Privacy and security.")}),e.jsx("li",{children:t("Create an App password — it’s revocable and scoped, so your main password stays private.")}),e.jsx("li",{children:t("Enter your handle and the app password below.")})]}),e.jsxs("div",{className:"pub-field-row",children:[e.jsx("label",{className:"pub-label",htmlFor:"pub-bsky-handle",children:t("Handle")}
1),e.jsx("input",{id:"pub-bsky-handle",className:"field",type:"text",autoComplete:"off",placeholder:"yourname.bsky.social",value:le,onChange:s=>Ce(s.target.value),disabled:k})]}),e.jsxs("div",{className:"pub-field-row",children:[e.jsx("label",{className:"pub-label",htmlFor:"pub-bsky-pw",children:t("App password")}),e.jsx("input",{id:"pub-bsky-pw",className:"field",type:"password",autoComplete:"off",placeholder:"abcd-efgh-ijkl-mnop",value:oe,onChange:s=>ce(s.target.value),disabled:k})]}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-cta",onClick:_e,disabled:k,children:k?t("Connecting…"):t("Connect")})})]}):e.jsx("p",{className:"pub-panel-sub",children:t("Bluesky posting isn’t available at the moment — server encryption isn’t configured.")}),e.jsx(T,{fb:Se})]}),e.jsxs("section",{className:"panel pub-panel","aria-busy":j||void 0,"aria-label":t("Custom webhook"),children:[e.jsxs("div",{className:"pub-panel-head",children:[e.jsx("img",{className:"pub-icon",src:"/images/sliders/images_webhook.svg",alt:"",width:26,height:26}),e.jsx("h2",{className:"pub-panel-title",children:t("Custom webhook")}),e.jsx(D,{kind:xe?"connected":"notconnected"})]}),xe?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("Notifications are POSTed to your endpoint. Endpoints that respond 401, 403, 404 or 410 are treated as revoked and disconnected automatically.")}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-outline",onClick:Ue,disabled:j,children:j?t("Disconnecting…"):t("Disconnect")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"pub-panel-sub",children:t("POST a notification body to any http(s) endpoint — Zapier, IFTTT, n8n or your own backend.")}),e.jsxs("div",{className:"pub-field-row",children:[e.jsx("label",{className:"pub-label",htmlFor:"pub-webhook-url",children:t("Endpoint URL")}),e.jsx("input",{id:"pub-webhook-url",className:"field",type:"url",inputMode:"url",placeholder:"https://example.com/your-endpoint",value:ie,onChange:s=>Ee(s.target.value),disabled:j})]}),e.jsxs("fieldset",{className:"pub-format",children:[e.jsx("legend",{className:"pub-label",children:t("Body format")}),e.jsxs("label",{className:"pub-radio",children:[e.jsx("input",{type:"radio",name:"pub-webhook-format",value:"json",checked:G==="json",onChange:()=>re("json"),disabled:j}),e.jsx("span",{children:t("JSON")})]}),e.jsxs("label",{className:"pub-radio",children:[e.jsx("input",{type:"radio",name:"pub-webhook-format",value:"xml",checked:G==="xml",onChange:()=>re("xml"),disabled:j}),e.jsx("span",{children:t("XML")})]})]}),e.jsx("div",{className:"pub-actions",children:e.jsx("button",{type:"button",className:"btn btn-cta",onClick:We,disabled:j,children:j?t("Connecting…"):t("Connect")})})]}),e.jsxs("details",{className:"pub-details",children:[e.jsx("summary",{children:t("Example payload")}),e.jsxs("p",{className:"pub-panel-sub",children:[t("Each event is POSTed as a JSON object with these fields (the XML format mirrors them under a root")," ",e.jsx("code",{children:"<TimelineEvent>"})," element):"]}),e.jsx("pre",{className:"pub-code",children:lt}),e.jsxs("ul",{className:"pub-fieldlist",children:[e.jsxs("li",{children:[e.jsx("code",{children:"title"})," ",t("— short headline for the event.")]}),e.jsxs("li",{children:[e.jsx("code",{children:"content"})," ",t("— plain-text body of the notification.")]}),e.jsxs("li",{children:[e.jsx("code",{children:"contentHtml"})," ",t("— the same body as HTML.")]}),e.jsxs("li",{children:[e.jsx("code",{children:"timestamp"})," ",t("— Unix epoch time in seconds.")]}),e.jsxs("li",{children:[e.jsx("code",{children:"parameters"})," ",t("— event details; the keys vary by")," ",e.jsx("code",{children:"parameters.Type"})," ",t("(Achievement, Prize or Leaderboard).")]}),e.jsxs("li",{children:[e.jsx("code",{children:"translations"})," ",t("— localized")," ",e.jsx("code",{children:"title"}),"/",e.jsx("code",{children:"content"}),", keyed by language code (de, fr, it, es, pt, ru)."]})]})]}),e.jsx(T,{fb:Te})]})]})]})}const lt=`{
2  "title": "New achievement",
3  "content": "HeroPlayer finished 1st of 1,200 in the $109 Sunday Major.",
4  "contentHtml": "<b>HeroPlayer</b> finished 1st of 1,200 …",
5  "timestamp": 1737590400,
6  "parameters": {
7    "Type": "Achievement",
8    "Network": "PokerStars",
9    "Player": "HeroPlayer"
10  },
11  "translations": {
12    "de": { "title": "Neuer Erfolg", "content": "HeroPlayer wurde 1. …" },
13    "fr": { "title": "Nouveau succès", "content": "HeroPlayer a terminé 1er …" }
14  }
15}`;export{it as default};

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.