PageSourceSearch

https://kindredly.ai/js/adminsite.storeDFHoYU-A.js

js kindredly.ai collected 2026-10-02 01:11:38 UTC 3,736 bytes, 1 lines download raw bytes

1import{a_ as y,a$ as f,b0 as T,f as u,aq as m}from"./chunkReloadRecoveryrjuMb-b8.js";import{E,a1 as x}from"./vue-runtimeBHGad_ZB.js";const c=[];function P(n){c.push(n)}function $(n){const e=c.lastIndexOf(n);e>=0&&c.splice(e,1)}function _(){return c[c.length-1]}async function Y(n="Are you sure you want to do this?",e={title:"Confirm",okTitle:"OK",cancelTitle:"Cancel",okVariant:"danger",hideHeaderClose:!1},s=!1){return await M("msgBoxConfirm").show(n,e,s)}const w=50;function v(n,e){try{const s=window,t=s.__KINDREDLY_TOASTS__||(s.__KINDREDLY_TOASTS__=[]);t.push({message:n,type:e,at:Date.now()}),t.length>w&&t.splice(0,t.length-w)}catch{}}function b(n,e={}){(e==null?void 0:e.variant)=="danger"&&(e.variant="error");const s=(e==null?void 0:e.variant)||"success";if(typeof window<"u"&&window.__PLAYWRIGHT_TEST__){v(n,s);return}y(n,{...e,type:s})}function M(n){const e=E(),s=n==="msgBoxConfirm"?_():void 0;if(!e)return s;if(e.refs[n])return e.refs[n];let t=e.parent;for(;t;){if(t.refs[n])return t.refs[n];t=t.parent}return s}function q(n){const e=document.getElementById(n);if(e!==null){let s=!1;e!=null&&e.classList.contains("show")&&(s=!0),e!=null&&e.classList.contains("closing")&&(s=!1),s&&e.dispatchEvent(new Event("bv-toggle"))}}function G(){const n=document.querySelectorAll(".modal.show");for(const e of n)e.dispatchEvent(new Event("bv-toggle"))}function H(n){const e=document.getElementById(n);if(e!==null){let s=!1;e!=null&&e.classList.contains("show")&&(s=!0),e!=null&&e.classList.contains("closing")&&(s=!1),s||e.dispatchEvent(new Event("bv-toggle"))}}const d=T.admin.token,I=6*60*60*1e3,i=x({token:null,sessionExpired:!1,sessionExpiredMessage:null});let l=null;function L(n){var e;if(!n)return null;try{const s=n.split(".")[1];if(!s)return null;const t=atob(s.replace(/-/g,"+").replace(/_/g,"/")),o=(e=JSON.parse(t))==null?void 0:e.exp;return typeof o=="number"?o*1e3:null}catch{return null}}async function K(){return i.token||(i.token=await f.persistentGetString(d)),u("isLoggedIn",i.token),!!i.token}function j(){return!!i.token}async function p(){return i.token||(i.token=await f.persistentGetString(d)),i.token}function O(n){f.persistentSetString(d,n),i.token=n}function R(){return f.persistentClear(d),i.token=null}function S(n){i.sessionExpired||(R(),i.sessionExpired=!0,i.sessionExpiredMessage=n,b(n,{variant:"danger"}))}function B(){return l||(l=(async()=>{var e;const n=await p();if(n)try{const s=await fetch(`${m}/admin/refresh`,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${n}`}});if(s.status===401||s.status===403){S("Your admin session has expired. Please sign in again.");return}const t=await s.json().catch(()=>null),o=(e=t==null?void 0:t.results)==null?void 0:e.token;s.ok&&(t!=null&&t.success)&&o&&O(o)}catch(s){u("Admin token refresh failed",s)}})().finally(()=>{l=null}),l)}async function J(n,e=null,s={}){const t={"Content-Type":"application/json"},o=await p();o&&(t.authorization=`Bearer ${o}`),u("Sending request to",n,"with data",e,"and options",s);const k=e?JSON.stringify(e):null,r=await fetch(`${m}${n}`,{method:(s==null?void 0:s.method)||"POST",headers:t,body:k}),h=await r.text();let a=null;try{a=h?JSON.parse(h):null}catch{a=null}if(u("Response from",n,"with data ",a),r.status===401||r.status===403)return S("Your admin session has expired. Please sign in again."),{success:!1,message:"Your admin session has expired. Please sign in again."};if(r.ok&&(a!=null&&a.success)){const g=L(o);return g!==null&&g-Date.now()<I&&B(),{success:!0,result:a.results}}else return{success:!1,message:(a==null?void 0:a.message)||`Request failed (${r.status})`}}const z=i;export{H as a,b,q as c,z as d,Y as e,K as f,O as g,G as h,j as i,R as l,_ as m,P as r,J as s,$ as u};

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.