PageSourceSearch

https://www.sharkscope.com/v7/assets/SharedSearchesView-DautRmzq.js

js sharkscope.com collected 2026-09-25 18:21:20 UTC 7,983 bytes, 1 lines download raw bytes

1import{I as re,a6 as le,x as t,gW as oe,t as s,gX as ce,bZ as W,gY as ie,w as e,au as he,U as I,R as q,bN as j,dT as de}from"./core-BUqNdL3P.js";import{E as ue}from"./EmptyState-DLCa68Y1.js";import{E as me}from"./ErrorNote-BuifazWM.js";import{H as pe}from"./HelpTip-DRvyniqs.js";import{T as U}from"./ColumnTip-Bp6Mja1X.js";import"./App-C4aeWWTZ.js";const S=20,u=25;function X(r,c){return r.recipient.localeCompare(c.recipient)}function ye(r){const[c,N,w]=r.split("-").map(Number);return de(new Date(c,N-1,w).getTime()/1e3)}function xe(r){return r.usedToday===0?"num ss-used-none":r.usedToday>=r.quota?"num ss-used-full":"num"}const be="Serving generated demo data — add ?provider=real or clear localStorage ss_v7_provider";function ve(){const r=re(),c=r==="demo",{user:N,openLogin:w}=le(),m=r==="real"&&N===null,[i,v]=t.useState([]),[T,C]=t.useState(null),[_,E]=t.useState(!m),[k,M]=t.useState(null),[B,J]=t.useState(0),[L,F]=t.useState(""),[R,O]=t.useState(""),[p,H]=t.useState(!1),[h,l]=t.useState(null),[Q,y]=t.useState(null),[Y,G]=t.useState(null),[K,Z]=t.useState(null),[x,z]=t.useState(""),[$,b]=t.useState(1),P=t.useMemo(()=>[...i].sort(X),[i]),A=x.trim().toLowerCase(),D=t.useMemo(()=>A?P.filter(a=>a.recipient.toLowerCase().includes(A)):P,[P,A]),g=Math.max(1,Math.ceil(D.length/u)),o=Math.min($,g),ee=D.slice((o-1)*u,o*u),se=i.length>u||x!==""&&i.length>0;t.useEffect(()=>{if(m){E(!1);return}let a=!0;return E(!0),oe().then(n=>{a&&(v(n.shares),C(n.monthStart),M(null))}).catch(n=>{a&&M(n)}).finally(()=>{a&&E(!1)}),()=>{a=!1}},[m,B]);const ae=t.useCallback(async a=>{a.preventDefault();const n=L.trim(),f=Number(R);if(!n){l(s("Enter the recipient account email."));return}if(!Number.isFinite(f)||f<S){l(s("Share at least {0} searches per day.",S));return}H(!0),l(null),y(null);try{const d=await ce(n,f);v(d.shares),C(d.monthStart),M(null);const V=[...d.shares].sort(X).findIndex(ne=>ne.recipient.toLowerCase()===n.toLowerCase());V>=0&&(z(""),b(Math.floor(V/u)+1)),F(""),O(""),y(s("Now sharing {0} searches/day with {1}.",f,n))}catch(d){l(W(d))}finally{H(!1)}},[L,R]),te=t.useCallback(async a=>{G(a),l(null),y(null),Z(null);try{const n=await ie(a);v(n.shares),C(n.monthStart),y(s("Stopped sharing with {0}.",a))}catch(n){Z(W(n))}finally{G(null)}},[]);return e.jsxs("section",{id:"view-shared-searches",className:"view","aria-labelledby":"ss-h1",children:[e.jsx("h1",{className:"page-title",id:"ss-h1",children:s("Share Searches")}),e.jsxs("p",{className:"page-sub",children:[s("Share some of your daily searches with other SharkScope accounts.")," ",he("{0} subscribers can share with one account, and {1} subscribers with any number.",e.jsx(I,{to:q.pricing,children:s("Platinum")}),e.jsx(I,{to:q.pricing,children:s("Pro")}))]}),m?e.jsxs("div",{className:"panel panel-pad ss-login",role:"note",children:[e.jsx("p",{children:s("Log in to share your searches with other accounts.")}),e.jsx("button",{type:"button",className:"btn btn-cta",onClick:w,children:s("Log in")})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"panel panel-pad",children:[e.jsxs("div",{className:"ss-panel-head",children:[e.jsx("h2",{className:"ss-panel-title",children:s("Share with an account")}
1),c&&e.jsx("span",{className:"chip",title:be,children:s("demo data")})]}),e.jsxs("form",{className:"ss-add-form",onSubmit:ae,children:[e.jsx("label",{className:"visually-hidden",htmlFor:"ss-email",children:s("Recipient account email")}),e.jsx("input",{id:"ss-email",className:"field ss-email",type:"email",autoComplete:"off",placeholder:s("SharkScope account email"),value:L,disabled:p,"aria-invalid":h!==null,onChange:a=>{F(a.target.value),h&&l(null)}}),e.jsx("label",{className:"visually-hidden",htmlFor:"ss-quota",children:s("Daily searches to share")}),e.jsx("input",{id:"ss-quota",className:"field ss-quota",type:"number",min:S,placeholder:"# of searches",value:R,disabled:p,onChange:a=>{O(a.target.value),h&&l(null)}}),e.jsx("button",{type:"submit",className:"btn btn-cta",disabled:p,children:p?s("Sharing…"):s("Share")})]}),e.jsx("p",{className:"ss-note",children:s("Minimum {0} searches per day, up to your own daily search allowance.",S)}),e.jsxs("p",{className:"ss-note",children:[s("The accounts you share with can also see any player group you set to “Accounts I share searches with”.")," ",e.jsx(I,{to:q.groups,children:s("Open Player Groups")})]}),h&&e.jsx("p",{className:"ss-err",role:"alert",children:h}),Q&&e.jsx("p",{className:"ss-status",role:"status",children:Q})]}),e.jsxs("div",{className:"panel panel-pad",children:[e.jsxs("div",{className:"ss-panel-head ss-list-head",children:[e.jsxs("h2",{className:"ss-panel-title",children:[s("Accounts you share with"),e.jsxs(pe,{label:s("About sharing searches"),children:[e.jsx("p",{children:s("Each account you add draws from your own daily search allowance — you choose how many searches per day it may spend.")}),e.jsx("p",{children:s("The account you share with does not need its own subscription to use those searches. Remove it at any time and the allowance returns to you.")})]})]}),se&&!_&&k===null&&e.jsx("input",{className:"field ss-search",type:"search",value:x,placeholder:s("Search accounts…"),"aria-label":s("Search accounts"),autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,onChange:a=>{z(a.target.value),b(1)}})]}),K&&e.jsx("p",{className:"ss-err",role:"alert",children:K}),_?e.jsx("p",{className:"ss-muted",role:"status",children:s("Loading your shared searches…")}):k!==null?e.jsx(me,{bare:!0,error:k,onRetry:()=>J(a=>a+1)}):i.length===0?e.jsx(ue,{bare:!0,icon:"share",title:s("You aren’t sharing searches with anyone yet"),body:s("Sharing hands part of your daily search allowance to another SharkScope account — useful for a coach and their students, or a staking group working from one subscription."),learnMore:s("Your own allowance is reduced by whatever you give away, and you can take it back at any time.")}):D.length===0?e.jsx("p",{className:"ss-muted ss-nomatch",children:s("No accounts match “{0}”.",x.trim())}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ss-table-wrap",children:e.jsxs("table",{className:"ss-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:s("Account")}),e.jsx(U,{className:"num",name:s("Daily searches"),description:s("The most this account may spend from your allowance each day."),children:s("Daily searches")}),e.jsx(U,{className:"num",name:s("Used today"),description:s("Searches this account has spent from your allowance today. The count starts again at midnight Pacific time."),children:s("Used today")}),T!==null&&e.jsx(U,{className:"num",name:s("This month"),description:s("Searches this account has spent from your allowance since {0}, when your Pro plan’s current month began.",ye(T)),children:s("This month")}),e.jsx("th",{scope:"col",children:e.jsx("span",{className:"visually-hidden",children:s("Actions")})})]})}),e.jsx("tbody",{children:ee.map(a=>e.jsxs("tr",{children:[e.jsx("td",{className:"ss-cell-acct",children:a.recipient}),e.jsx("td",{className:"num",children:a.quota.toLocaleString("en-US")}),e.jsx("td",{className:xe(a),children:j(a.usedToday)}),T!==null&&e.jsx("td",{className:a.usedThisMonth?"num":"num ss-used-none",children:j(a.usedThisMonth??0)}),e.jsx("td",{className:"ss-cell-act",children:e.jsx("button",{type:"button",className:"btn btn-outline btn-sm",disabled:Y===a.recipient,onClick:()=>void te(a.recipient),children:Y===a.recipient?s("Removing…"):s("Remove")})})]},a.recipient))})]})}),g>1&&e.jsxs("div",{className:"ss-pager",role:"navigation","aria-label":s("Shared account pages"),children:[e.jsx("button",{type:"button",className:"btn btn-outline btn-sm",disabled:o<=1,onClick:()=>b(o-1),children:s("‹ Prev")}),e.jsx("span",{className:"ss-pageinfo",children:s("Page {0} of {1}",j(o),j(g))}),e.jsx("button",{type:"button",className:"btn btn-outline btn-sm",disabled:o>=g,onClick:()=>b(o+1),children:s("Next ›")})]})]})]})]})]})}export{ve 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.