PageSourceSearch

https://taskon.xyz/assets/useTwitterOauth-PT1-xTZG.js

js taskon.xyz collected 2026-09-24 10:08:45 UTC 2,404 bytes, 1 lines download raw bytes

1import{Et as e,H as t,K as n,b as r,dt as i}from"./vue.runtime.esm-bundler-BZJEAd2_.js";import{Fo as a,Pr as o,_a as s,ga as c,ia as l,is as u,ms as d,s as f,us as p,va as m,ya as h}from"./track-CV3zh0zK.js";import{H as g}from"./useDialogControl-B0r4COHK.js";import{t as _}from"./SnsType-BXrRIJby.js";import{c as v,s as y}from"./vue-router-B6c_zBdC.js";import{o as b}from"./social-CYPfOpN9.js";import{a as x,o as S,t as C}from"./useWhiteLabelPullOauthResult-CQb0Nlhb.js";var w=async(e,t)=>{let{result:n}=await o({url:`/v1/getTokenByState`,method:`POST`,data:e,...t});if(n===void 0)throw Error(`unexpected: result should exist when no error`);return n},T=async e=>{let{result:t}=await o({url:`/v1/requestTwitterAuthState`,method:`POST`,...e});if(t===void 0)throw Error(`unexpected: result should exist when no error`);return t},E=(o,E,D,O,k)=>{let A=y(),j=v(),M=p(),N=u(),P=e(),{triggerWhiteLabelOauth:F,isWhiteLabelOauthPulling:I}=C(o,`twitter`,e=>{E?.(e)},e=>{if(e.code===`access_denied`){let t=e.error||``;x(!0,t),D?.(t)}else{let e=a.global.t(`try_again_continue`);x(!1,e),D?.(e)}}),L=3e3,R=r(()=>!!N.value||I.value),z=async()=>{if(localStorage.setItem(d.OauthFrom,window.location.href),localStorage.setItem(d.TwitterOauthSourceId,o),l){S(_.Twitter,k);return}let e=await T();M.value=e,N.value=Date.now(),f(b(e))},B=async()=>{await j.replace({query:{...A.query,[h]:void 0,[m]:void 0,[c]:void 0,[s]:void 0}})},V=()=>{P.value&&clearTimeout(P.value)},H=()=>{if(V(),Date.now()-N.value>60*1e3){N.value=0;return}w({state:M.value}).then(e=>{if(e===`failed`){N.value=0,localStorage.setItem(d.OauthFrom,``),localStorage.setItem(d.TwitterOauthSourceId,``);let e=a.global.t(`try_again_continue`);x(!1,e),D?.(e)}else e?(N.value=0,localStorage.setItem(d.OauthFrom,``),localStorage.setItem(d.TwitterOauthSourceId,``),E?.(e)):P.value=setTimeout(()=>{H()},L);return``}).catch(()=>{P.value=setTimeout(()=>{H()},L)})};i(g(),e=>{O||(e?N.value&&localStorage.getItem(d.TwitterOauthSourceId)===o&&(V(),H()):V())},{immediate:!0});let U=async(e,t)=>
1{t?(x(t===`access_denied`,t),D&&await D(t)):e&&E&&await E(e),localStorage.removeItem(d.OauthFrom),localStorage.removeItem(d.TwitterOauthSourceId)};return n(async()=>{await j.isReady();let{[h]:e,[m]:t,[c]:n}=A.query;e===_.Twitter&&o===localStorage.getItem(d.TwitterOauthSourceId)&&(l&&await U(t,n),await B())}),t(()=>{V()}),{go2TwitterOauthAndPull:z,isPulling:R}};export{E as t};

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.