forked from kojibai/verify.kai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKaiVohModal-CRpJD1P8.js
More file actions
2 lines (2 loc) · 8.95 KB
/
KaiVohModal-CRpJD1P8.js
File metadata and controls
2 lines (2 loc) · 8.95 KB
1
2
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KaiVohApp-ShUUTiq2.js","assets/index-BlYU7j-M.js","assets/index-BmaJNTKf.css","assets/prop-types-BWhc8UTz.js","assets/VerifierFrame-a5dTHTgU.js","assets/VerifierFrame-D0e_dB-R.css","assets/SigilAuthContext-CIPXJp4C.js","assets/sigilRegistry-dB0OrrJi.js","assets/sigilRegistry-Cw7cMZ5l.css","assets/postSeal-ClZBwRbf.js","assets/KaiVohApp-Brroi08x.css","assets/KaiRealms-DO28buUy.js","assets/x-CaPcBV4E.js","assets/KaiRealms-BZJvSAmB.css"])))=>i.map(i=>d[i]);
import{t as e}from"./x-CaPcBV4E.js";import{Sn as t,Tn as n,jn as r,tn as i,wn as a}from"./index-BlYU7j-M.js";import{t as o}from"./SigilAuthContext-CIPXJp4C.js";import{t as s}from"./SigilAuthProvider-ea2w3ibF.js";var c=r(a(),1),l=r(n(),1),u=r(i(),1),d=class extends l.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[KaiVoh] render error:`,e,t)}render(){return this.state.error?(0,u.jsxs)(`div`,{style:{padding:`1rem`,textAlign:`center`},children:[(0,u.jsx)(`h2`,{style:{fontSize:18,fontWeight:600},children:`KaiVoh failed to load`}),(0,u.jsx)(`p`,{style:{opacity:.8,marginTop:8},children:this.state.error.message}),(0,u.jsxs)(`details`,{style:{opacity:.65,marginTop:12,textAlign:`left`},children:[(0,u.jsx)(`summary`,{children:`Details`}),(0,u.jsx)(`pre`,{style:{whiteSpace:`pre-wrap`},children:String(this.state.error.stack??``)})]})]}):this.props.children}};function f(){let e=(0,l.useContext)(o);if(!e)throw Error(`useSigilAuth must be used inside <SigilAuthProvider>`);return e}var p=(0,l.lazy)(()=>t(()=>import(`./KaiVohApp-ShUUTiq2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),m=(0,l.lazy)(()=>t(()=>import(`./KaiRealms-DO28buUy.js`),__vite__mapDeps([11,1,2,12,13]))),h=(1+Math.sqrt(5))/2,g=5.236,_=610,v=377;function y({className:e}){let t=(0,l.useId)();return(0,u.jsxs)(`svg`,{className:e,width:_,height:v,viewBox:`0 0 ${_} ${v}`,"aria-hidden":`true`,children:[(0,u.jsx)(`defs`,{children:(0,u.jsxs)(`linearGradient`,{id:t,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`currentColor`,stopOpacity:`0.0`}),(0,u.jsx)(`stop`,{offset:`40%`,stopColor:`currentColor`,stopOpacity:`0.5`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`currentColor`,stopOpacity:`0.0`})]})}),(0,u.jsxs)(`g`,{fill:`none`,stroke:`url(#${t})`,strokeWidth:`2`,children:[(0,u.jsx)(`path`,{d:`M377 0 A377 377 0 0 1 0 377`}),(0,u.jsx)(`path`,{d:`M233 0 A233 233 0 0 1 0 233`}),(0,u.jsx)(`path`,{d:`M144 0 A144 144 0 0 1 0 144`}),(0,u.jsx)(`path`,{d:`M89 0 A89 89 0 0 1 0 89`}),(0,u.jsx)(`path`,{d:`M55 0 A55 55 0 0 1 0 55`}),(0,u.jsx)(`path`,{d:`M34 0 A34 34 0 0 1 0 34`}),(0,u.jsx)(`path`,{d:`M21 0 A21 21 0 0 1 0 21`})]})]})}function b({className:e}){return(0,u.jsxs)(`div`,{className:`seal-emblem ${e??``}`,"aria-hidden":`true`,children:[(0,u.jsx)(`div`,{className:`seal-ring seal-ring--outer`}),(0,u.jsx)(`div`,{className:`seal-ring seal-ring--inner`}),(0,u.jsx)(`div`,{className:`seal-core`})]})}function x({className:e}){let{auth:t}=f(),n=t.meta;if(!n)return null;let r=[`Pulse: ${n.pulse}`,`Beat: ${n.beat}`,`Step: ${n.stepIndex}`,`Day: ${n.chakraDay}`];return n.sigilId&&r.push(`Sigil: ${n.sigilId}`),n.userPhiKey&&r.push(`PhiKey: ${n.userPhiKey}`),(0,u.jsxs)(`div`,{className:`sigil-auth-pill ${e??``}`,role:`status`,"aria-live":`polite`,title:r.join(` • `),style:{maxWidth:`100%`,overflowX:`auto`,whiteSpace:`nowrap`},children:[(0,u.jsx)(`span`,{className:`sigil-auth-pill__dot`,"aria-hidden":`true`}),(0,u.jsxs)(`span`,{className:`sigil-auth-pill__text mono`,children:[`Sealed • `,n.pulse,` • `,n.chakraDay,n.sigilId?` • ${n.sigilId}`:``]})]})}function S({open:t,onClose:n}){let r=(0,l.useRef)(null),i=(0,l.useRef)(null),a=(0,l.useRef)(0),[o,f]=(0,l.useState)(`voh`),[_,v]=(0,l.useState)(!1),S=(0,l.useCallback)(e=>{e===`realms`&&!_&&v(!0),f(e)},[_]);(0,l.useEffect)(()=>{if(!t)return;let e=document.body.style.overflow,n=document.documentElement.style.getPropertyValue(`overscroll-behavior`),o=document.body.style.getPropertyValue(`overscroll-behavior`),s=document.documentElement.style.overflow,c=document.body.style.height,l=document.documentElement.style.height,u=document.documentElement.style.touchAction,d=document.documentElement.style.getPropertyValue(`--kai-breath`),f=document.documentElement.style.getPropertyValue(`--kai-phi`);document.body.style.overflow=`hidden`,document.body.style.height=`100%`,document.documentElement.style.overflow=`hidden`,document.documentElement.style.height=`100%`,document.documentElement.style.setProperty(`overscroll-behavior`,`contain`),document.body.style.setProperty(`overscroll-behavior`,`contain`),document.documentElement.style.touchAction=`manipulation`,document.documentElement.style.setProperty(`--kai-breath`,`${g}s`),document.documentElement.style.setProperty(`--kai-phi`,`${h}`),r.current?.focus();let p=e=>{a.current=e.touches[0]?.clientY??0},m=e=>{if(e.touches.length!==1)return;let t=i.current;if(!t)return;let n=e.target;if(!(n&&t.contains(n))){e.preventDefault();return}let r=(e.touches[0]?.clientY??a.current)-a.current,o=t.scrollTop<=0,s=t.scrollTop+t.clientHeight>=t.scrollHeight;(o&&r>0||s&&r<0)&&e.preventDefault()};return window.addEventListener(`touchstart`,p,{passive:!0}),window.addEventListener(`touchmove`,m,{passive:!1}),()=>{window.removeEventListener(`touchstart`,p),window.removeEventListener(`touchmove`,m),document.body.style.overflow=e,document.body.style.height=c,n?document.documentElement.style.setProperty(`overscroll-behavior`,n):document.documentElement.style.removeProperty(`overscroll-behavior`),o?document.body.style.setProperty(`overscroll-behavior`,o):document.body.style.removeProperty(`overscroll-behavior`),document.documentElement.style.overflow=s,document.documentElement.style.height=l,document.documentElement.style.touchAction=u,d?document.documentElement.style.setProperty(`--kai-breath`,d):document.documentElement.style.removeProperty(`--kai-breath`),f?document.documentElement.style.setProperty(`--kai-phi`,f):document.documentElement.style.removeProperty(`--kai-phi`)}},[t,n]);let C=(0,l.useCallback)(e=>{e.stopPropagation(),n()},[n]),w=(0,l.useCallback)(e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),n())},[n]);return t?(0,c.createPortal)((0,u.jsxs)(`div`,{className:`kai-voh-modal-backdrop atlantean-veil`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`kaivoh-title`,"data-view":o,children:[(0,u.jsx)(`div`,{className:`atlantean-stars`,"aria-hidden":`true`}),(0,u.jsx)(`div`,{className:`atlantean-halo atlantean-halo--1`,"aria-hidden":`true`}),(0,u.jsx)(`div`,{className:`atlantean-halo atlantean-halo--2`,"aria-hidden":`true`}),(0,u.jsxs)(`div`,{className:`kai-voh-container kai-pulse-border glass-omni`,role:`document`,children:[(0,u.jsx)(`div`,{className:`breath-ring breath-ring--outer`,"aria-hidden":`true`}),(0,u.jsx)(`div`,{className:`breath-ring breath-ring--inner`,"aria-hidden":`true`}),(0,u.jsx)(`div`,{className:`phi-grid`,"aria-hidden":`true`}),(0,u.jsx)(y,{className:`phi-spiral phi-spiral--tl`}),(0,u.jsx)(y,{className:`phi-spiral phi-spiral--br`}),(0,u.jsxs)(s,{children:[o!==`realms`&&(0,u.jsx)(`button`,{ref:r,type:`button`,className:`kai-voh-close auric-btn`,"aria-label":`Close portal`,onPointerDown:C,onKeyDown:w,children:(0,u.jsx)(e,{size:22,"aria-hidden":`true`})}),o!==`realms`&&(0,u.jsx)(`div`,{className:`voh-top-orb`,"aria-hidden":`true`,children:(0,u.jsx)(b,{})}),(0,u.jsxs)(`div`,{className:`kai-voh-tabbar`,role:`tablist`,"aria-label":`Kai portal views`,children:[(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===`voh`,className:`kai-voh-tab auric-tab ${o===`voh`?`active`:``}`,onClick:()=>S(`voh`),children:[(0,u.jsx)(`span`,{className:`tab-glyph`,"aria-hidden":`true`,children:`🜂`}),` `,`Voh`]}),(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===`realms`,className:`kai-voh-tab auric-tab ${o===`realms`?`active`:``}`,onClick:()=>S(`realms`),children:[(0,u.jsx)(`span`,{className:`tab-glyph`,"aria-hidden":`true`,children:`⚚`}),` `,`Realms`]}),(0,u.jsx)(`div`,{className:`breath-meter`,"aria-hidden":`true`,children:(0,u.jsx)(`div`,{className:`breath-meter__dot`})}),(0,u.jsx)(x,{className:`sigil-auth-pill--tabbar`})]}),(0,u.jsxs)(`div`,{className:`kai-voh-body`,ref:i,children:[(0,u.jsx)(`h2`,{id:`kaivoh-title`,className:`sr-only`,children:`Kai Portal`}),(0,u.jsxs)(d,{children:[(0,u.jsx)(`section`,{className:`portal-pane`,style:{display:o===`voh`?`block`:`none`},"aria-hidden":o!==`voh`,children:(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(`div`,{className:`kai-voh-center`,children:[(0,u.jsx)(`div`,{className:`kai-voh-spinner`}),(0,u.jsx)(`div`,{children:`Summoning Voh…`})]}),children:(0,u.jsx)(p,{})})}),(0,u.jsx)(`section`,{className:`portal-pane`,style:{display:o===`realms`?`block`:`none`},"aria-hidden":o!==`realms`,children:_?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(`div`,{className:`kai-voh-center`,children:[(0,u.jsx)(`div`,{className:`kai-voh-spinner`}),(0,u.jsx)(`div`,{children:`Opening Kai Realms…`})]}),children:(0,u.jsx)(m,{onClose:()=>S(`voh`)})}):null})]})]})]})]})]}),document.body):null}export{S as default};