9remote 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var Se,L,sn,$,pt,an,cn,Ae,ye,fe,un,st,tt,nt,we={},Ne=[],Sn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ee=Array.isArray;function W(e,t){for(var r in t)e[r]=t[r];return e}function at(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function En(e,t,r){var i,n,o,l={};for(o in t)o=="key"?i=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?Se.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return ve(e,l,i,n,null)}function ve(e,t,r,i,n){var o={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++sn,__i:-1,__u:0};return n==null&&L.vnode!=null&&L.vnode(o),o}function ee(e){return e.children}function be(e,t){this.props=e,this.context=t}function le(e,t){if(t==null)return e.__?le(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?le(e):null}function Tn(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],o=W({},t);o.__v=t.__v+1,L.vnode&&L.vnode(o),ct(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,r??le(t),!!(32&t.__u),n),o.__v=t.__v,o.__.__k[o.__i]=o,mn(i,o,n),t.__e=t.__=null,o.__e!=r&&dn(o)}}function dn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),dn(e)}function _t(e){(!e.__d&&(e.__d=!0)&&$.push(e)&&!Ce.__r++||pt!=L.debounceRendering)&&((pt=L.debounceRendering)||an)(Ce)}function Ce(){try{for(var e,t=1;$.length;)$.length>t&&$.sort(cn),e=$.shift(),t=$.length,Tn(e)}finally{$.length=Ce.__r=0}}function fn(e,t,r,i,n,o,l,s,c,u,m){var d,h,f,v,C,B,p,y=i&&i.__k||Ne,w=t.length;for(c=An(r,t,y,c,w),d=0;d<w;d++)(f=r.__k[d])!=null&&(h=f.__i!=-1&&y[f.__i]||we,f.__i=d,B=ct(e,f,h,n,o,l,s,c,u,m),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ut(h.ref,null,f),m.push(f.ref,f.__c||v,f)),C==null&&v!=null&&(C=v),(p=!!(4&f.__u))||h.__k===f.__k?(c=hn(f,c,e,p),p&&h.__e&&(h.__e=null)):typeof f.type=="function"&&B!==void 0?c=B:v&&(c=v.nextSibling),f.__u&=-7);return r.__e=C,c}function An(e,t,r,i,n){var o,l,s,c,u,m=r.length,d=m,h=0;for(e.__k=new Array(n),o=0;o<n;o++)(l=t[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[o]=ve(null,l,null,null,null):Ee(l)?l=e.__k[o]=ve(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[o]=ve(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,c=o+h,l.__=e,l.__b=e.__b+1,s=null,(u=l.__i=Rn(l,r,c,d))!=-1&&(d--,(s=r[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(n>m?h--:n<m&&h++),typeof l.type!="function"&&(l.__u|=4)):u!=c&&(u==c-1?h--:u==c+1?h++:(u>c?h--:h++,l.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<m;o++)(s=r[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=le(s)),_n(s,s));return i}function hn(e,t,r,i){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=hn(n[o],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=le(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Rn(e,t,r,i){var n,o,l,s=e.key,c=e.type,u=t[r],m=u!=null&&(2&u.__u)==0;if(u===null&&s==null||m&&s==u.key&&c==u.type)return r;if(i>(m?1:0)){for(n=r-1,o=r+1;n>=0||o<t.length;)if((u=t[l=n>=0?n--:o++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return l}return-1}function gt(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Sn.test(t)?r:r+"px"}function pe(e,t,r,i,n){var o,l;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||gt(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||gt(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(un,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?i?r[fe]=i[fe]:(r[fe]=st,e.addEventListener(t,o?nt:tt,o)):e.removeEventListener(t,o?nt:tt,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function yt(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[ye]==null)t[ye]=st++;else if(t[ye]<r[fe])return;return r(L.event?L.event(t):t)}}}function ct(e,t,r,i,n,o,l,s,c,u){var m,d,h,f,v,C,B,p,y,w,N,M,b,k,x,_=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),o=[s=t.__e=r.__e]),(m=L.__b)&&m(t);e:if(typeof _=="function")try{if(p=t.props,y=_.prototype&&_.prototype.render,w=(m=_.contextType)&&i[m.__c],N=m?w?w.props.value:m.__:i,r.__c?B=(d=t.__c=r.__c).__=d.__E:(y?t.__c=d=new _(p,N):(t.__c=d=new be(p,N),d.constructor=_,d.render=In),w&&w.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&_.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=W({},d.__s)),W(d.__s,_.getDerivedStateFromProps(p,d.__s))),f=d.props,v=d.state,d.__v=t,h)y&&_.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&_.getDerivedStateFromProps==null&&p!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(p,N),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(p,d.__s,N)===!1){t.__v!=r.__v&&(d.props=p,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(S){S&&(S.__=t)}),Ne.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&l.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(p,d.__s,N),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,v,C)})}if(d.context=N,d.props=p,d.__P=e,d.__e=!1,M=L.__r,b=0,y)d.state=d.__s,d.__d=!1,M&&M(t),m=d.render(d.props,d.state,d.context),Ne.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,M&&M(t),m=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++b<25);d.state=d.__s,d.getChildContext!=null&&(i=W(W({},i),d.getChildContext())),y&&!h&&d.getSnapshotBeforeUpdate!=null&&(C=d.getSnapshotBeforeUpdate(f,v)),k=m!=null&&m.type===ee&&m.key==null?pn(m.props.children):m,s=fn(e,Ee(k)?k:[k],t,r,i,n,o,l,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),B&&(d.__E=d.__=null)}catch(S){if(t.__v=null,c||o!=null)if(S.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(x=o.length;x--;)at(o[x]);rt(t)}else t.__e=r.__e,t.__k=r.__k,S.then||rt(t);L.__e(S,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Pn(r.__e,t,r,i,n,o,l,c,u);return(m=L.diffed)&&m(t),128&t.__u?void 0:s}function rt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(rt))}function mn(e,t,r){for(var i=0;i<r.length;i++)ut(r[i],r[++i],r[++i]);L.__c&&L.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){L.__e(o,n.__v)}})}function pn(e){return typeof e!="object"||e==null||e.__b>0?e:Ee(e)?e.map(pn):W({},e)}function Pn(e,t,r,i,n,o,l,s,c){var u,m,d,h,f,v,C,B=r.props||we,p=t.props,y=t.type;if(y=="svg"?n="http://www.w3.org/2000/svg":y=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,o[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(p);e=document.createElementNS(n,y,p.is&&p),s&&(L.__m&&L.__m(t,o),s=!1),o=null}if(y==null)B===p||s&&e.data==p||(e.data=p);else{if(o=o&&Se.call(e.childNodes),!s&&o!=null)for(B={},u=0;u<e.attributes.length;u++)B[(f=e.attributes[u]).name]=f.value;for(u in B)f=B[u],u=="dangerouslySetInnerHTML"?d=f:u=="children"||u in p||u=="value"&&"defaultValue"in p||u=="checked"&&"defaultChecked"in p||pe(e,u,null,f,n);for(u in p)f=p[u],u=="children"?h=f:u=="dangerouslySetInnerHTML"?m=f:u=="value"?v=f:u=="checked"?C=f:s&&typeof f!="function"||B[u]===f||pe(e,u,f,B[u],n);if(m)s||d&&(m.__html==d.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(d&&(e.innerHTML=""),fn(t.type=="template"?e.content:e,Ee(h)?h:[h],t,r,i,y=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:r.__k&&le(r,0),s,c),o!=null)for(u=o.length;u--;)at(o[u]);s||(u="value",y=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[u]||y=="progress"&&!v||y=="option"&&v!=B[u])&&pe(e,u,v,B[u],n),u="checked",C!=null&&C!=e[u]&&pe(e,u,C,B[u],n))}return e}function ut(e,t,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(n){L.__e(n,r)}}function _n(e,t,r){var i,n;if(L.unmount&&L.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ut(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){L.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&_n(i[n],t,r||typeof e.type!="function");r||at(e.__e),e.__c=e.__=e.__e=void 0}function In(e,t,r){return this.constructor(e,r)}function Bn(e,t,r){var i,n,o,l;t==document&&(t=document.documentElement),L.__&&L.__(e,t),n=(i=!1)?null:t.__k,o=[],l=[],ct(t,e=t.__k=En(ee,null,[e]),n||we,we,t.namespaceURI,n?null:t.firstChild?Se.call(t.childNodes):null,o,n?n.__e:t.firstChild,i,l),mn(o,e,l)}Se=Ne.slice,L={__e:function(e,t,r,i){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),l=n.__d),l)return n.__E=n}catch(s){e=s}throw e}},sn=0,be.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},r),this.props)),e&&W(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_t(this))},be.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_t(this))},be.prototype.render=ee,$=[],an=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cn=function(e,t){return e.__v.__b-t.__v.__b},Ce.__r=0,Ae=Math.random().toString(8),ye="__d"+Ae,fe="__a"+Ae,un=/(PointerCapture)$|Capture$/i,st=0,tt=yt(!1),nt=yt(!0);var Mn=0;function a(e,t,r,i,n,o){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var u={type:e,props:c,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mn,__i:-1,__u:0,__source:n,__self:o};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return L.vnode&&L.vnode(u),u}var me,q,Re,vt,ke=0,gn=[],j=L,bt=j.__b,xt=j.__r,wt=j.diffed,Nt=j.__c,Ct=j.unmount,kt=j.__;function dt(e,t){j.__h&&j.__h(q,e,ke||t),ke=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return ke=1,Dn(vn,e)}function Dn(e,t,r){var i=dt(me++,2);if(i.t=e,!i.__c&&(i.__=[vn(void 0,t),function(s){var c=i.__N?i.__N[0]:i.__[0],u=i.t(c,s);c!==u&&(i.__N=[u,i.__[1]],i.__c.setState({}))}],i.__c=q,!q.__f)){var n=function(s,c,u){if(!i.__c.__H)return!0;var m=i.__c.__H.__.filter(function(h){return h.__c});if(m.every(function(h){return!h.__N}))return!o||o.call(this,s,c,u);var d=i.__c.props!==s;return m.some(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),o&&o.call(this,s,c,u)||d};q.__f=!0;var o=q.shouldComponentUpdate,l=q.componentWillUpdate;q.componentWillUpdate=function(s,c,u){if(this.__e){var m=o;o=void 0,n(s,c,u),o=m}l&&l.call(this,s,c,u)},q.shouldComponentUpdate=n}return i.__N||i.__}function ie(e,t){var r=dt(me++,3);!j.__s&&yn(r.__H,t)&&(r.__=e,r.u=t,q.__H.__h.push(r))}function ft(e){return ke=5,Ln(function(){return{current:e}},[])}function Ln(e,t){var r=dt(me++,7);return yn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Un(){for(var e;e=gn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xe),t.__h.some(ot),t.__h=[]}catch(r){t.__h=[],j.__e(r,e.__v)}}}j.__b=function(e){q=null,bt&&bt(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kt&&kt(e,t)},j.__r=function(e){xt&&xt(e),me=0;var t=(q=e.__c).__H;t&&(Re===q?(t.__h=[],q.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(xe),t.__h.some(ot),t.__h=[],me=0)),Re=q},j.diffed=function(e){wt&&wt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(gn.push(t)!==1&&vt===j.requestAnimationFrame||((vt=j.requestAnimationFrame)||qn)(Un)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Re=q=null},j.__c=function(e,t){t.some(function(r){try{r.__h.some(xe),r.__h=r.__h.filter(function(i){return!i.__||ot(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],j.__e(i,r.__v)}}),Nt&&Nt(e,t)},j.unmount=function(e){Ct&&Ct(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(i){try{xe(i)}catch(n){t=n}}),r.__H=void 0,t&&j.__e(t,r.__v))};var St=typeof requestAnimationFrame=="function";function qn(e){var t,r=function(){clearTimeout(i),St&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);St&&(t=requestAnimationFrame(r))}function xe(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function ot(e){var t=q;e.__c=e.__(),q=t}function yn(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function vn(e,t){return typeof t=="function"?t(e):t}const jn=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"verified",label:"Verifying",desc:"Health check"},{icon:"check_circle",label:"Ready",desc:"Connected"}],Fn=3;function On({currentStep:e,activeDesc:t="",healthCheck:r}){var o;const i=e-1,n=(o=r==null?void 0:r.logs)!=null&&o.length?r.logs[r.logs.length-1]:null;return a("div",{className:"glass-card p-5 flex flex-col gap-4",children:[a("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Setting up connection"}),a("div",{className:"flex flex-col gap-3",children:jn.map((l,s)=>{const c=s<i,u=s===i,m=u&&s===Fn;let d=u&&t?t:l.desc,h="var(--text-muted)";if(m&&n){const f=/^\d{3}$/.test(String(n.status));d=`#${n.attempt} → ${n.status}`,h=n.ok||n.waiting?"#22c55e":f?"#eab308":"#ef4444"}return a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:c?"var(--brand-500)":u?"rgba(255,87,10,0.15)":"var(--glass-bg)",border:u?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:c?a("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):u?a("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(f=>a("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${f*.18}s`}},f))}):a("span",{className:"material-symbols-outlined",style:{fontSize:16,color:"var(--text-muted)",opacity:.3},children:l.icon})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-medium",style:{color:c?"var(--text-muted)":u?"var(--text-main)":"var(--text-muted)",opacity:c||u?1:.4},children:l.label}),a("p",{className:"text-xs mt-0.5 truncate",style:{color:h,opacity:u?m&&n?.95:.7:.4,fontFamily:m&&n?"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace":void 0},children:d})]}),c&&a("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:"Done"}),u&&a("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},s)})})]})}function Hn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe={},Pe,Et;function zn(){return Et||(Et=1,Pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Pe}var Ie={},Z={},Tt;function te(){if(Tt)return Z;Tt=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Z.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},Z.getSymbolTotalCodewords=function(i){return t[i]},Z.getBCHDigit=function(r){let i=0;for(;r!==0;)i++,r>>>=1;return i},Z.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');e=i},Z.isKanjiModeEnabled=function(){return typeof e<"u"},Z.toSJIS=function(i){return e(i)},Z}var Be={},At;function ht(){return At||(At=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,n){if(e.isValid(i))return i;try{return t(i)}catch{return n}}})(Be)),Be}var Me,Rt;function Kn(){if(Rt)return Me;Rt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let i=0;i<r;i++)this.putBit((t>>>r-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Me=e,Me}var De,Pt;function Vn(){if(Pt)return De;Pt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,i,n){const o=t*this.size+r;this.data[o]=i,n&&(this.reservedBit[o]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,i){this.data[t*this.size+r]^=i},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},De=e,De}var Le={},It;function Jn(){return It||(It=1,(function(e){const t=te().getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,o=t(i),l=o===145?26:Math.ceil((o-13)/(2*n-2))*2,s=[o-7];for(let c=1;c<n-1;c++)s[c]=s[c-1]-l;return s.push(6),s.reverse()},e.getPositions=function(i){const n=[],o=e.getRowColCoords(i),l=o.length;for(let s=0;s<l;s++)for(let c=0;c<l;c++)s===0&&c===0||s===0&&c===l-1||s===l-1&&c===0||n.push([o[s],o[c]]);return n}})(Le)),Le}var Ue={},Bt;function Yn(){if(Bt)return Ue;Bt=1;const e=te().getSymbolSize,t=7;return Ue.getPositions=function(i){const n=e(i);return[[0,0],[n-t,0],[0,n-t]]},Ue}var qe={},Mt;function Gn(){return Mt||(Mt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let l=0,s=0,c=0,u=null,m=null;for(let d=0;d<o;d++){s=c=0,u=m=null;for(let h=0;h<o;h++){let f=n.get(d,h);f===u?s++:(s>=5&&(l+=t.N1+(s-5)),u=f,s=1),f=n.get(h,d),f===m?c++:(c>=5&&(l+=t.N1+(c-5)),m=f,c=1)}s>=5&&(l+=t.N1+(s-5)),c>=5&&(l+=t.N1+(c-5))}return l},e.getPenaltyN2=function(n){const o=n.size;let l=0;for(let s=0;s<o-1;s++)for(let c=0;c<o-1;c++){const u=n.get(s,c)+n.get(s,c+1)+n.get(s+1,c)+n.get(s+1,c+1);(u===4||u===0)&&l++}return l*t.N2},e.getPenaltyN3=function(n){const o=n.size;let l=0,s=0,c=0;for(let u=0;u<o;u++){s=c=0;for(let m=0;m<o;m++)s=s<<1&2047|n.get(u,m),m>=10&&(s===1488||s===93)&&l++,c=c<<1&2047|n.get(m,u),m>=10&&(c===1488||c===93)&&l++}return l*t.N3},e.getPenaltyN4=function(n){let o=0;const l=n.data.length;for(let c=0;c<l;c++)o+=n.data[c];return Math.abs(Math.ceil(o*100/l/5)-10)*t.N4};function r(i,n,o){switch(i){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}e.applyMask=function(n,o){const l=o.size;for(let s=0;s<l;s++)for(let c=0;c<l;c++)o.isReserved(c,s)||o.xor(c,s,r(n,c,s))},e.getBestMask=function(n,o){const l=Object.keys(e.Patterns).length;let s=0,c=1/0;for(let u=0;u<l;u++){o(u),e.applyMask(u,n);const m=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(u,n),m<c&&(c=m,s=u)}return s}})(qe)),qe}var _e={},Dt;function bn(){if(Dt)return _e;Dt=1;const e=ht(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return _e.getBlocksCount=function(n,o){switch(o){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},_e.getTotalCodewordsCount=function(n,o){switch(o){case e.L:return r[(n-1)*4+0];case e.M:return r[(n-1)*4+1];case e.Q:return r[(n-1)*4+2];case e.H:return r[(n-1)*4+3];default:return}},_e}var je={},de={},Lt;function Qn(){if(Lt)return de;Lt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let i=1;for(let n=0;n<255;n++)e[n]=i,t[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),de.log=function(i){if(i<1)throw new Error("log("+i+")");return t[i]},de.exp=function(i){return e[i]},de.mul=function(i,n){return i===0||n===0?0:e[t[i]+t[n]]},de}var Ut;function Wn(){return Ut||(Ut=1,(function(e){const t=Qn();e.mul=function(i,n){const o=new Uint8Array(i.length+n.length-1);for(let l=0;l<i.length;l++)for(let s=0;s<n.length;s++)o[l+s]^=t.mul(i[l],n[s]);return o},e.mod=function(i,n){let o=new Uint8Array(i);for(;o.length-n.length>=0;){const l=o[0];for(let c=0;c<n.length;c++)o[c]^=t.mul(n[c],l);let s=0;for(;s<o.length&&o[s]===0;)s++;o=o.slice(s)}return o},e.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let o=0;o<i;o++)n=e.mul(n,new Uint8Array([1,t.exp(o)]));return n}})(je)),je}var Fe,qt;function Xn(){if(qt)return Fe;qt=1;const e=Wn();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(i){this.degree=i,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(i.length+this.degree);n.set(i);const o=e.mod(n,this.genPoly),l=this.degree-o.length;if(l>0){const s=new Uint8Array(this.degree);return s.set(o,l),s}return o},Fe=t,Fe}var Oe={},He={},ze={},jt;function xn(){return jt||(jt=1,ze.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),ze}var Y={},Ft;function wn(){if(Ft)return Y;Ft=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
2
|
-
]))+`;Y.KANJI=new RegExp(r,"g"),Y.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Y.BYTE=new RegExp(i,"g"),Y.NUMERIC=new RegExp(e,"g"),Y.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+r+"$"),o=new RegExp("^"+e+"$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Y.testKanji=function(c){return n.test(c)},Y.testNumeric=function(c){return o.test(c)},Y.testAlphanumeric=function(c){return l.test(c)},Y}var
|
|
3
|
-
Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),i.put(o,13)}},
|
|
4
|
-
Suggested mode is: `+t.toString(N));switch(w===t.KANJI&&!s.isKanjiModeEnabled()&&(w=t.BYTE),w){case t.NUMERIC:return new r(
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var Ee,L,an,$,_t,cn,un,Re,ve,fe,dn,at,nt,rt,Ne={},Ce=[],En=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Te=Array.isArray;function W(e,t){for(var r in t)e[r]=t[r];return e}function ct(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Tn(e,t,r){var i,n,o,l={};for(o in t)o=="key"?i=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?Ee.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return be(e,l,i,n,null)}function be(e,t,r,i,n){var o={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++an,__i:-1,__u:0};return n==null&&L.vnode!=null&&L.vnode(o),o}function ee(e){return e.children}function xe(e,t){this.props=e,this.context=t}function le(e,t){if(t==null)return e.__?le(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?le(e):null}function An(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],o=W({},t);o.__v=t.__v+1,L.vnode&&L.vnode(o),ut(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,r??le(t),!!(32&t.__u),n),o.__v=t.__v,o.__.__k[o.__i]=o,pn(i,o,n),t.__e=t.__=null,o.__e!=r&&fn(o)}}function fn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),fn(e)}function gt(e){(!e.__d&&(e.__d=!0)&&$.push(e)&&!ke.__r++||_t!=L.debounceRendering)&&((_t=L.debounceRendering)||cn)(ke)}function ke(){try{for(var e,t=1;$.length;)$.length>t&&$.sort(un),e=$.shift(),t=$.length,An(e)}finally{$.length=ke.__r=0}}function hn(e,t,r,i,n,o,l,s,c,u,m){var d,h,f,v,C,B,_,y=i&&i.__k||Ce,w=t.length;for(c=Rn(r,t,y,c,w),d=0;d<w;d++)(f=r.__k[d])!=null&&(h=f.__i!=-1&&y[f.__i]||Ne,f.__i=d,B=ut(e,f,h,n,o,l,s,c,u,m),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&dt(h.ref,null,f),m.push(f.ref,f.__c||v,f)),C==null&&v!=null&&(C=v),(_=!!(4&f.__u))||h.__k===f.__k?(c=mn(f,c,e,_),_&&h.__e&&(h.__e=null)):typeof f.type=="function"&&B!==void 0?c=B:v&&(c=v.nextSibling),f.__u&=-7);return r.__e=C,c}function Rn(e,t,r,i,n){var o,l,s,c,u,m=r.length,d=m,h=0;for(e.__k=new Array(n),o=0;o<n;o++)(l=t[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[o]=be(null,l,null,null,null):Te(l)?l=e.__k[o]=be(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[o]=be(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,c=o+h,l.__=e,l.__b=e.__b+1,s=null,(u=l.__i=In(l,r,c,d))!=-1&&(d--,(s=r[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(n>m?h--:n<m&&h++),typeof l.type!="function"&&(l.__u|=4)):u!=c&&(u==c-1?h--:u==c+1?h++:(u>c?h--:h++,l.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<m;o++)(s=r[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=le(s)),gn(s,s));return i}function mn(e,t,r,i){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=mn(n[o],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=le(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function In(e,t,r,i){var n,o,l,s=e.key,c=e.type,u=t[r],m=u!=null&&(2&u.__u)==0;if(u===null&&s==null||m&&s==u.key&&c==u.type)return r;if(i>(m?1:0)){for(n=r-1,o=r+1;n>=0||o<t.length;)if((u=t[l=n>=0?n--:o++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return l}return-1}function yt(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||En.test(t)?r:r+"px"}function pe(e,t,r,i,n){var o,l;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||yt(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||yt(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(dn,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?i?r[fe]=i[fe]:(r[fe]=at,e.addEventListener(t,o?rt:nt,o)):e.removeEventListener(t,o?rt:nt,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function vt(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[ve]==null)t[ve]=at++;else if(t[ve]<r[fe])return;return r(L.event?L.event(t):t)}}}function ut(e,t,r,i,n,o,l,s,c,u){var m,d,h,f,v,C,B,_,y,w,N,M,b,k,x,g=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),o=[s=t.__e=r.__e]),(m=L.__b)&&m(t);e:if(typeof g=="function")try{if(_=t.props,y=g.prototype&&g.prototype.render,w=(m=g.contextType)&&i[m.__c],N=m?w?w.props.value:m.__:i,r.__c?B=(d=t.__c=r.__c).__=d.__E:(y?t.__c=d=new g(_,N):(t.__c=d=new xe(_,N),d.constructor=g,d.render=Bn),w&&w.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&g.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=W({},d.__s)),W(d.__s,g.getDerivedStateFromProps(_,d.__s))),f=d.props,v=d.state,d.__v=t,h)y&&g.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&g.getDerivedStateFromProps==null&&_!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,N),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(_,d.__s,N)===!1){t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(S){S&&(S.__=t)}),Ce.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&l.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,N),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,v,C)})}if(d.context=N,d.props=_,d.__P=e,d.__e=!1,M=L.__r,b=0,y)d.state=d.__s,d.__d=!1,M&&M(t),m=d.render(d.props,d.state,d.context),Ce.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,M&&M(t),m=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++b<25);d.state=d.__s,d.getChildContext!=null&&(i=W(W({},i),d.getChildContext())),y&&!h&&d.getSnapshotBeforeUpdate!=null&&(C=d.getSnapshotBeforeUpdate(f,v)),k=m!=null&&m.type===ee&&m.key==null?_n(m.props.children):m,s=hn(e,Te(k)?k:[k],t,r,i,n,o,l,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),B&&(d.__E=d.__=null)}catch(S){if(t.__v=null,c||o!=null)if(S.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(x=o.length;x--;)ct(o[x]);ot(t)}else t.__e=r.__e,t.__k=r.__k,S.then||ot(t);L.__e(S,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Pn(r.__e,t,r,i,n,o,l,c,u);return(m=L.diffed)&&m(t),128&t.__u?void 0:s}function ot(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ot))}function pn(e,t,r){for(var i=0;i<r.length;i++)dt(r[i],r[++i],r[++i]);L.__c&&L.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){L.__e(o,n.__v)}})}function _n(e){return typeof e!="object"||e==null||e.__b>0?e:Te(e)?e.map(_n):W({},e)}function Pn(e,t,r,i,n,o,l,s,c){var u,m,d,h,f,v,C,B=r.props||Ne,_=t.props,y=t.type;if(y=="svg"?n="http://www.w3.org/2000/svg":y=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,o[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(_);e=document.createElementNS(n,y,_.is&&_),s&&(L.__m&&L.__m(t,o),s=!1),o=null}if(y==null)B===_||s&&e.data==_||(e.data=_);else{if(o=o&&Ee.call(e.childNodes),!s&&o!=null)for(B={},u=0;u<e.attributes.length;u++)B[(f=e.attributes[u]).name]=f.value;for(u in B)f=B[u],u=="dangerouslySetInnerHTML"?d=f:u=="children"||u in _||u=="value"&&"defaultValue"in _||u=="checked"&&"defaultChecked"in _||pe(e,u,null,f,n);for(u in _)f=_[u],u=="children"?h=f:u=="dangerouslySetInnerHTML"?m=f:u=="value"?v=f:u=="checked"?C=f:s&&typeof f!="function"||B[u]===f||pe(e,u,f,B[u],n);if(m)s||d&&(m.__html==d.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(d&&(e.innerHTML=""),hn(t.type=="template"?e.content:e,Te(h)?h:[h],t,r,i,y=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:r.__k&&le(r,0),s,c),o!=null)for(u=o.length;u--;)ct(o[u]);s||(u="value",y=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[u]||y=="progress"&&!v||y=="option"&&v!=B[u])&&pe(e,u,v,B[u],n),u="checked",C!=null&&C!=e[u]&&pe(e,u,C,B[u],n))}return e}function dt(e,t,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(n){L.__e(n,r)}}function gn(e,t,r){var i,n;if(L.unmount&&L.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||dt(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){L.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&gn(i[n],t,r||typeof e.type!="function");r||ct(e.__e),e.__c=e.__=e.__e=void 0}function Bn(e,t,r){return this.constructor(e,r)}function Mn(e,t,r){var i,n,o,l;t==document&&(t=document.documentElement),L.__&&L.__(e,t),n=(i=!1)?null:t.__k,o=[],l=[],ut(t,e=t.__k=Tn(ee,null,[e]),n||Ne,Ne,t.namespaceURI,n?null:t.firstChild?Ee.call(t.childNodes):null,o,n?n.__e:t.firstChild,i,l),pn(o,e,l)}Ee=Ce.slice,L={__e:function(e,t,r,i){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),l=n.__d),l)return n.__E=n}catch(s){e=s}throw e}},an=0,xe.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},r),this.props)),e&&W(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),gt(this))},xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gt(this))},xe.prototype.render=ee,$=[],cn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,un=function(e,t){return e.__v.__b-t.__v.__b},ke.__r=0,Re=Math.random().toString(8),ve="__d"+Re,fe="__a"+Re,dn=/(PointerCapture)$|Capture$/i,at=0,nt=vt(!1),rt=vt(!0);var Dn=0;function a(e,t,r,i,n,o){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var u={type:e,props:c,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Dn,__i:-1,__u:0,__source:n,__self:o};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return L.vnode&&L.vnode(u),u}var me,q,Ie,bt,Se=0,yn=[],j=L,xt=j.__b,wt=j.__r,Nt=j.diffed,Ct=j.__c,kt=j.unmount,St=j.__;function ft(e,t){j.__h&&j.__h(q,e,Se||t),Se=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return Se=1,Ln(bn,e)}function Ln(e,t,r){var i=ft(me++,2);if(i.t=e,!i.__c&&(i.__=[bn(void 0,t),function(s){var c=i.__N?i.__N[0]:i.__[0],u=i.t(c,s);c!==u&&(i.__N=[u,i.__[1]],i.__c.setState({}))}],i.__c=q,!q.__f)){var n=function(s,c,u){if(!i.__c.__H)return!0;var m=i.__c.__H.__.filter(function(h){return h.__c});if(m.every(function(h){return!h.__N}))return!o||o.call(this,s,c,u);var d=i.__c.props!==s;return m.some(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),o&&o.call(this,s,c,u)||d};q.__f=!0;var o=q.shouldComponentUpdate,l=q.componentWillUpdate;q.componentWillUpdate=function(s,c,u){if(this.__e){var m=o;o=void 0,n(s,c,u),o=m}l&&l.call(this,s,c,u)},q.shouldComponentUpdate=n}return i.__N||i.__}function ie(e,t){var r=ft(me++,3);!j.__s&&vn(r.__H,t)&&(r.__=e,r.u=t,q.__H.__h.push(r))}function ht(e){return Se=5,Un(function(){return{current:e}},[])}function Un(e,t){var r=ft(me++,7);return vn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function qn(){for(var e;e=yn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(we),t.__h.some(it),t.__h=[]}catch(r){t.__h=[],j.__e(r,e.__v)}}}j.__b=function(e){q=null,xt&&xt(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),St&&St(e,t)},j.__r=function(e){wt&&wt(e),me=0;var t=(q=e.__c).__H;t&&(Ie===q?(t.__h=[],q.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(we),t.__h.some(it),t.__h=[],me=0)),Ie=q},j.diffed=function(e){Nt&&Nt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(yn.push(t)!==1&&bt===j.requestAnimationFrame||((bt=j.requestAnimationFrame)||jn)(qn)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ie=q=null},j.__c=function(e,t){t.some(function(r){try{r.__h.some(we),r.__h=r.__h.filter(function(i){return!i.__||it(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],j.__e(i,r.__v)}}),Ct&&Ct(e,t)},j.unmount=function(e){kt&&kt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(i){try{we(i)}catch(n){t=n}}),r.__H=void 0,t&&j.__e(t,r.__v))};var Et=typeof requestAnimationFrame=="function";function jn(e){var t,r=function(){clearTimeout(i),Et&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Et&&(t=requestAnimationFrame(r))}function we(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function it(e){var t=q;e.__c=e.__(),q=t}function vn(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function bn(e,t){return typeof t=="function"?t(e):t}const Fn=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"verified",label:"Verifying",desc:"Health check"},{icon:"check_circle",label:"Ready",desc:"Connected"}],On=3;function Hn({currentStep:e,activeDesc:t="",healthCheck:r}){var o;const i=e-1,n=(o=r==null?void 0:r.logs)!=null&&o.length?r.logs[r.logs.length-1]:null;return a("div",{className:"glass-card p-5 flex flex-col gap-4",children:[a("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Setting up connection"}),a("div",{className:"flex flex-col gap-3",children:Fn.map((l,s)=>{const c=s<i,u=s===i,m=u&&s===On;let d=u&&t?t:l.desc,h="var(--text-muted)";if(m&&n){const f=/^\d{3}$/.test(String(n.status));d=`#${n.attempt} → ${n.status}`,h=n.ok||n.waiting?"#22c55e":f?"#eab308":"#ef4444"}return a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:c?"var(--brand-500)":u?"rgba(255,87,10,0.15)":"var(--glass-bg)",border:u?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:c?a("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):u?a("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(f=>a("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${f*.18}s`}},f))}):a("span",{className:"material-symbols-outlined",style:{fontSize:16,color:"var(--text-muted)",opacity:.3},children:l.icon})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-medium",style:{color:c?"var(--text-muted)":u?"var(--text-main)":"var(--text-muted)",opacity:c||u?1:.4},children:l.label}),a("p",{className:"text-xs mt-0.5 truncate",style:{color:h,opacity:u?m&&n?.95:.7:.4,fontFamily:m&&n?"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace":void 0},children:d})]}),c&&a("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:"Done"}),u&&a("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},s)})})]})}function zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe={},Pe,Tt;function Kn(){return Tt||(Tt=1,Pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Pe}var Be={},Z={},At;function te(){if(At)return Z;At=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Z.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},Z.getSymbolTotalCodewords=function(i){return t[i]},Z.getBCHDigit=function(r){let i=0;for(;r!==0;)i++,r>>>=1;return i},Z.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');e=i},Z.isKanjiModeEnabled=function(){return typeof e<"u"},Z.toSJIS=function(i){return e(i)},Z}var Me={},Rt;function mt(){return Rt||(Rt=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,n){if(e.isValid(i))return i;try{return t(i)}catch{return n}}})(Me)),Me}var De,It;function Vn(){if(It)return De;It=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let i=0;i<r;i++)this.putBit((t>>>r-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},De=e,De}var Le,Pt;function Jn(){if(Pt)return Le;Pt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,i,n){const o=t*this.size+r;this.data[o]=i,n&&(this.reservedBit[o]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,i){this.data[t*this.size+r]^=i},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},Le=e,Le}var Ue={},Bt;function Yn(){return Bt||(Bt=1,(function(e){const t=te().getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,o=t(i),l=o===145?26:Math.ceil((o-13)/(2*n-2))*2,s=[o-7];for(let c=1;c<n-1;c++)s[c]=s[c-1]-l;return s.push(6),s.reverse()},e.getPositions=function(i){const n=[],o=e.getRowColCoords(i),l=o.length;for(let s=0;s<l;s++)for(let c=0;c<l;c++)s===0&&c===0||s===0&&c===l-1||s===l-1&&c===0||n.push([o[s],o[c]]);return n}})(Ue)),Ue}var qe={},Mt;function Gn(){if(Mt)return qe;Mt=1;const e=te().getSymbolSize,t=7;return qe.getPositions=function(i){const n=e(i);return[[0,0],[n-t,0],[0,n-t]]},qe}var je={},Dt;function Qn(){return Dt||(Dt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let l=0,s=0,c=0,u=null,m=null;for(let d=0;d<o;d++){s=c=0,u=m=null;for(let h=0;h<o;h++){let f=n.get(d,h);f===u?s++:(s>=5&&(l+=t.N1+(s-5)),u=f,s=1),f=n.get(h,d),f===m?c++:(c>=5&&(l+=t.N1+(c-5)),m=f,c=1)}s>=5&&(l+=t.N1+(s-5)),c>=5&&(l+=t.N1+(c-5))}return l},e.getPenaltyN2=function(n){const o=n.size;let l=0;for(let s=0;s<o-1;s++)for(let c=0;c<o-1;c++){const u=n.get(s,c)+n.get(s,c+1)+n.get(s+1,c)+n.get(s+1,c+1);(u===4||u===0)&&l++}return l*t.N2},e.getPenaltyN3=function(n){const o=n.size;let l=0,s=0,c=0;for(let u=0;u<o;u++){s=c=0;for(let m=0;m<o;m++)s=s<<1&2047|n.get(u,m),m>=10&&(s===1488||s===93)&&l++,c=c<<1&2047|n.get(m,u),m>=10&&(c===1488||c===93)&&l++}return l*t.N3},e.getPenaltyN4=function(n){let o=0;const l=n.data.length;for(let c=0;c<l;c++)o+=n.data[c];return Math.abs(Math.ceil(o*100/l/5)-10)*t.N4};function r(i,n,o){switch(i){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}e.applyMask=function(n,o){const l=o.size;for(let s=0;s<l;s++)for(let c=0;c<l;c++)o.isReserved(c,s)||o.xor(c,s,r(n,c,s))},e.getBestMask=function(n,o){const l=Object.keys(e.Patterns).length;let s=0,c=1/0;for(let u=0;u<l;u++){o(u),e.applyMask(u,n);const m=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(u,n),m<c&&(c=m,s=u)}return s}})(je)),je}var _e={},Lt;function xn(){if(Lt)return _e;Lt=1;const e=mt(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return _e.getBlocksCount=function(n,o){switch(o){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},_e.getTotalCodewordsCount=function(n,o){switch(o){case e.L:return r[(n-1)*4+0];case e.M:return r[(n-1)*4+1];case e.Q:return r[(n-1)*4+2];case e.H:return r[(n-1)*4+3];default:return}},_e}var Fe={},de={},Ut;function Wn(){if(Ut)return de;Ut=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let i=1;for(let n=0;n<255;n++)e[n]=i,t[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),de.log=function(i){if(i<1)throw new Error("log("+i+")");return t[i]},de.exp=function(i){return e[i]},de.mul=function(i,n){return i===0||n===0?0:e[t[i]+t[n]]},de}var qt;function Xn(){return qt||(qt=1,(function(e){const t=Wn();e.mul=function(i,n){const o=new Uint8Array(i.length+n.length-1);for(let l=0;l<i.length;l++)for(let s=0;s<n.length;s++)o[l+s]^=t.mul(i[l],n[s]);return o},e.mod=function(i,n){let o=new Uint8Array(i);for(;o.length-n.length>=0;){const l=o[0];for(let c=0;c<n.length;c++)o[c]^=t.mul(n[c],l);let s=0;for(;s<o.length&&o[s]===0;)s++;o=o.slice(s)}return o},e.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let o=0;o<i;o++)n=e.mul(n,new Uint8Array([1,t.exp(o)]));return n}})(Fe)),Fe}var Oe,jt;function Zn(){if(jt)return Oe;jt=1;const e=Xn();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(i){this.degree=i,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(i.length+this.degree);n.set(i);const o=e.mod(n,this.genPoly),l=this.degree-o.length;if(l>0){const s=new Uint8Array(this.degree);return s.set(o,l),s}return o},Oe=t,Oe}var He={},ze={},Ke={},Ft;function wn(){return Ft||(Ft=1,Ke.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Ke}var Y={},Ot;function Nn(){if(Ot)return Y;Ot=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
2
|
+
]))+`;Y.KANJI=new RegExp(r,"g"),Y.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Y.BYTE=new RegExp(i,"g"),Y.NUMERIC=new RegExp(e,"g"),Y.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+r+"$"),o=new RegExp("^"+e+"$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Y.testKanji=function(c){return n.test(c)},Y.testNumeric=function(c){return o.test(c)},Y.testAlphanumeric=function(c){return l.test(c)},Y}var Ht;function ne(){return Ht||(Ht=1,(function(e){const t=wn(),r=Nn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,l){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?o.ccBits[0]:l<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return r.testNumeric(o)?e.NUMERIC:r.testAlphanumeric(o)?e.ALPHANUMERIC:r.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(o,l){if(e.isValid(o))return o;try{return i(o)}catch{return l}}})(ze)),ze}var zt;function $n(){return zt||(zt=1,(function(e){const t=te(),r=xn(),i=mt(),n=ne(),o=wn(),l=7973,s=t.getBCHDigit(l);function c(h,f,v){for(let C=1;C<=40;C++)if(f<=e.getCapacity(C,v,h))return C}function u(h,f){return n.getCharCountIndicator(h,f)+4}function m(h,f){let v=0;return h.forEach(function(C){const B=u(C.mode,f);v+=B+C.getBitsLength()}),v}function d(h,f){for(let v=1;v<=40;v++)if(m(h,v)<=e.getCapacity(v,f,n.MIXED))return v}e.from=function(f,v){return o.isValid(f)?parseInt(f,10):v},e.getCapacity=function(f,v,C){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=n.BYTE);const B=t.getSymbolTotalCodewords(f),_=r.getTotalCodewordsCount(f,v),y=(B-_)*8;if(C===n.MIXED)return y;const w=y-u(C,f);switch(C){case n.NUMERIC:return Math.floor(w/10*3);case n.ALPHANUMERIC:return Math.floor(w/11*2);case n.KANJI:return Math.floor(w/13);case n.BYTE:default:return Math.floor(w/8)}},e.getBestVersionForData=function(f,v){let C;const B=i.from(v,i.M);if(Array.isArray(f)){if(f.length>1)return d(f,B);if(f.length===0)return 1;C=f[0]}else C=f;return c(C.mode,C.getLength(),B)},e.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let v=f<<12;for(;t.getBCHDigit(v)-s>=0;)v^=l<<t.getBCHDigit(v)-s;return f<<12|v}})(He)),He}var Ve={},Kt;function er(){if(Kt)return Ve;Kt=1;const e=te(),t=1335,r=21522,i=e.getBCHDigit(t);return Ve.getEncodedBits=function(o,l){const s=o.bit<<3|l;let c=s<<10;for(;e.getBCHDigit(c)-i>=0;)c^=t<<e.getBCHDigit(c)-i;return(s<<10|c)^r},Ve}var Je={},Ye,Vt;function tr(){if(Vt)return Ye;Vt=1;const e=ne();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let n,o,l;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),l=parseInt(o,10),i.put(l,10);const s=this.data.length-n;s>0&&(o=this.data.substr(n),l=parseInt(o,10),i.put(l,s*3+1))},Ye=t,Ye}var Ge,Jt;function nr(){if(Jt)return Ge;Jt=1;const e=ne(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(i){this.mode=e.ALPHANUMERIC,this.data=i}return r.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o+2<=this.data.length;o+=2){let l=t.indexOf(this.data[o])*45;l+=t.indexOf(this.data[o+1]),n.put(l,11)}this.data.length%2&&n.put(t.indexOf(this.data[o]),6)},Ge=r,Ge}var Qe,Yt;function rr(){if(Yt)return Qe;Yt=1;const e=ne();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(i){return i*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let i=0,n=this.data.length;i<n;i++)r.put(this.data[i],8)},Qe=t,Qe}var We,Gt;function or(){if(Gt)return We;Gt=1;const e=ne(),t=te();function r(i){this.mode=e.KANJI,this.data=i}return r.getBitsLength=function(n){return n*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let n;for(n=0;n<this.data.length;n++){let o=t.toSJIS(this.data[n]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
|
|
3
|
+
Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),i.put(o,13)}},We=r,We}var Xe={exports:{}},Qt;function ir(){return Qt||(Qt=1,(function(e){var t={single_source_shortest_paths:function(r,i,n){var o={},l={};l[i]=0;var s=t.PriorityQueue.make();s.push(i,0);for(var c,u,m,d,h,f,v,C,B;!s.empty();){c=s.pop(),u=c.value,d=c.cost,h=r[u]||{};for(m in h)h.hasOwnProperty(m)&&(f=h[m],v=d+f,C=l[m],B=typeof l[m]>"u",(B||C>v)&&(l[m]=v,s.push(m,v),o[m]=u))}if(typeof n<"u"&&typeof l[n]>"u"){var _=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(_)}return o},extract_shortest_path_from_predecessor_list:function(r,i){for(var n=[],o=i;o;)n.push(o),r[o],o=r[o];return n.reverse(),n},find_path:function(r,i,n){var o=t.single_source_shortest_paths(r,i,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(r){var i=t.PriorityQueue,n={},o;r=r||{};for(o in i)i.hasOwnProperty(o)&&(n[o]=i[o]);return n.queue=[],n.sorter=r.sorter||i.default_sorter,n},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var n={value:r,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Xe)),Xe.exports}var Wt;function lr(){return Wt||(Wt=1,(function(e){const t=ne(),r=tr(),i=nr(),n=rr(),o=or(),l=Nn(),s=te(),c=ir();function u(_){return unescape(encodeURIComponent(_)).length}function m(_,y,w){const N=[];let M;for(;(M=_.exec(w))!==null;)N.push({data:M[0],index:M.index,mode:y,length:M[0].length});return N}function d(_){const y=m(l.NUMERIC,t.NUMERIC,_),w=m(l.ALPHANUMERIC,t.ALPHANUMERIC,_);let N,M;return s.isKanjiModeEnabled()?(N=m(l.BYTE,t.BYTE,_),M=m(l.KANJI,t.KANJI,_)):(N=m(l.BYTE_KANJI,t.BYTE,_),M=[]),y.concat(w,N,M).sort(function(k,x){return k.index-x.index}).map(function(k){return{data:k.data,mode:k.mode,length:k.length}})}function h(_,y){switch(y){case t.NUMERIC:return r.getBitsLength(_);case t.ALPHANUMERIC:return i.getBitsLength(_);case t.KANJI:return o.getBitsLength(_);case t.BYTE:return n.getBitsLength(_)}}function f(_){return _.reduce(function(y,w){const N=y.length-1>=0?y[y.length-1]:null;return N&&N.mode===w.mode?(y[y.length-1].data+=w.data,y):(y.push(w),y)},[])}function v(_){const y=[];for(let w=0;w<_.length;w++){const N=_[w];switch(N.mode){case t.NUMERIC:y.push([N,{data:N.data,mode:t.ALPHANUMERIC,length:N.length},{data:N.data,mode:t.BYTE,length:N.length}]);break;case t.ALPHANUMERIC:y.push([N,{data:N.data,mode:t.BYTE,length:N.length}]);break;case t.KANJI:y.push([N,{data:N.data,mode:t.BYTE,length:u(N.data)}]);break;case t.BYTE:y.push([{data:N.data,mode:t.BYTE,length:u(N.data)}])}}return y}function C(_,y){const w={},N={start:{}};let M=["start"];for(let b=0;b<_.length;b++){const k=_[b],x=[];for(let g=0;g<k.length;g++){const S=k[g],E=""+b+g;x.push(E),w[E]={node:S,lastCount:0},N[E]={};for(let A=0;A<M.length;A++){const T=M[A];w[T]&&w[T].node.mode===S.mode?(N[T][E]=h(w[T].lastCount+S.length,S.mode)-h(w[T].lastCount,S.mode),w[T].lastCount+=S.length):(w[T]&&(w[T].lastCount=S.length),N[T][E]=h(S.length,S.mode)+4+t.getCharCountIndicator(S.mode,y))}}M=x}for(let b=0;b<M.length;b++)N[M[b]].end=0;return{map:N,table:w}}function B(_,y){let w;const N=t.getBestModeForData(_);if(w=t.from(y,N),w!==t.BYTE&&w.bit<N.bit)throw new Error('"'+_+'" cannot be encoded with mode '+t.toString(w)+`.
|
|
4
|
+
Suggested mode is: `+t.toString(N));switch(w===t.KANJI&&!s.isKanjiModeEnabled()&&(w=t.BYTE),w){case t.NUMERIC:return new r(_);case t.ALPHANUMERIC:return new i(_);case t.KANJI:return new o(_);case t.BYTE:return new n(_)}}e.fromArray=function(y){return y.reduce(function(w,N){return typeof N=="string"?w.push(B(N,null)):N.data&&w.push(B(N.data,N.mode)),w},[])},e.fromString=function(y,w){const N=d(y,s.isKanjiModeEnabled()),M=v(N),b=C(M,w),k=c.find_path(b.map,"start","end"),x=[];for(let g=1;g<k.length-1;g++)x.push(b.table[k[g]].node);return e.fromArray(f(x))},e.rawSplit=function(y){return e.fromArray(d(y,s.isKanjiModeEnabled()))}})(Je)),Je}var Xt;function sr(){if(Xt)return Be;Xt=1;const e=te(),t=mt(),r=Vn(),i=Jn(),n=Yn(),o=Gn(),l=Qn(),s=xn(),c=Zn(),u=$n(),m=er(),d=ne(),h=lr();function f(b,k){const x=b.size,g=o.getPositions(k);for(let S=0;S<g.length;S++){const E=g[S][0],A=g[S][1];for(let T=-1;T<=7;T++)if(!(E+T<=-1||x<=E+T))for(let I=-1;I<=7;I++)A+I<=-1||x<=A+I||(T>=0&&T<=6&&(I===0||I===6)||I>=0&&I<=6&&(T===0||T===6)||T>=2&&T<=4&&I>=2&&I<=4?b.set(E+T,A+I,!0,!0):b.set(E+T,A+I,!1,!0))}}function v(b){const k=b.size;for(let x=8;x<k-8;x++){const g=x%2===0;b.set(x,6,g,!0),b.set(6,x,g,!0)}}function C(b,k){const x=n.getPositions(k);for(let g=0;g<x.length;g++){const S=x[g][0],E=x[g][1];for(let A=-2;A<=2;A++)for(let T=-2;T<=2;T++)A===-2||A===2||T===-2||T===2||A===0&&T===0?b.set(S+A,E+T,!0,!0):b.set(S+A,E+T,!1,!0)}}function B(b,k){const x=b.size,g=u.getEncodedBits(k);let S,E,A;for(let T=0;T<18;T++)S=Math.floor(T/3),E=T%3+x-8-3,A=(g>>T&1)===1,b.set(S,E,A,!0),b.set(E,S,A,!0)}function _(b,k,x){const g=b.size,S=m.getEncodedBits(k,x);let E,A;for(E=0;E<15;E++)A=(S>>E&1)===1,E<6?b.set(E,8,A,!0):E<8?b.set(E+1,8,A,!0):b.set(g-15+E,8,A,!0),E<8?b.set(8,g-E-1,A,!0):E<9?b.set(8,15-E-1+1,A,!0):b.set(8,15-E-1,A,!0);b.set(g-8,8,1,!0)}function y(b,k){const x=b.size;let g=-1,S=x-1,E=7,A=0;for(let T=x-1;T>0;T-=2)for(T===6&&T--;;){for(let I=0;I<2;I++)if(!b.isReserved(S,T-I)){let F=!1;A<k.length&&(F=(k[A]>>>E&1)===1),b.set(S,T-I,F),E--,E===-1&&(A++,E=7)}if(S+=g,S<0||x<=S){S-=g,g=-g;break}}}function w(b,k,x){const g=new r;x.forEach(function(I){g.put(I.mode.bit,4),g.put(I.getLength(),d.getCharCountIndicator(I.mode,b)),I.write(g)});const S=e.getSymbolTotalCodewords(b),E=s.getTotalCodewordsCount(b,k),A=(S-E)*8;for(g.getLengthInBits()+4<=A&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const T=(A-g.getLengthInBits())/8;for(let I=0;I<T;I++)g.put(I%2?17:236,8);return N(g,b,k)}function N(b,k,x){const g=e.getSymbolTotalCodewords(k),S=s.getTotalCodewordsCount(k,x),E=g-S,A=s.getBlocksCount(k,x),T=g%A,I=A-T,F=Math.floor(g/A),O=Math.floor(E/A),se=O+1,V=F-O,ae=new c(V);let z=0;const X=new Array(A),re=new Array(A);let G=0;const ce=new Uint8Array(b.buffer);for(let P=0;P<A;P++){const K=P<I?O:se;X[P]=ce.slice(z,z+K),re[P]=ae.encode(X[P]),z+=K,G=Math.max(G,K)}const Q=new Uint8Array(g);let R=0,D,p;for(D=0;D<G;D++)for(p=0;p<A;p++)D<X[p].length&&(Q[R++]=X[p][D]);for(D=0;D<V;D++)for(p=0;p<A;p++)Q[R++]=re[p][D];return Q}function M(b,k,x,g){let S;if(Array.isArray(b))S=h.fromArray(b);else if(typeof b=="string"){let F=k;if(!F){const O=h.rawSplit(b);F=u.getBestVersionForData(O,x)}S=h.fromString(b,F||40)}else throw new Error("Invalid data");const E=u.getBestVersionForData(S,x);if(!E)throw new Error("The amount of data is too big to be stored in a QR Code");if(!k)k=E;else if(k<E)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
6
|
Minimum version required to store current data is: `+E+`.
|
|
7
|
-
`);const A=w(k,x,S),T=e.getSymbolSize(k),
|
|
8
|
-
`;return typeof s=="function"&&s(null,B),B},$e}var en;function cr(){if(en)return oe;en=1;const e=zn(),t=lr(),r=sr(),i=ar();function n(o,l,s,c,u){const m=[].slice.call(arguments,1),d=m.length,h=typeof m[d-1]=="function";if(!h&&!e())throw new Error("Callback required as last argument");if(h){if(d<2)throw new Error("Too few arguments provided");d===2?(u=s,s=l,l=c=void 0):d===3&&(l.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=s,s=l,l=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(s=l,l=c=void 0):d===2&&!l.getContext&&(c=s,s=l,l=void 0),new Promise(function(f,v){try{const C=t.create(s,c);f(o(C,l,c))}catch(C){v(C)}})}try{const f=t.create(s,c);u(null,o(f,l,c))}catch(f){u(f)}}return oe.create=t.create,oe.toCanvas=n.bind(null,r.render),oe.toDataURL=n.bind(null,r.renderToDataURL),oe.toString=n.bind(null,function(o,l,s){return i.render(o,s)}),oe}var ur=cr();const dr=Hn(ur);function he({message:e,confirmLabel:t="Confirm",confirmDanger:r=!1,onConfirm:i,onCancel:n}){return a("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:a("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[a("p",{className:"text-sm text-center",style:{color:"var(--text-main)"},children:e}),a("div",{className:"flex gap-2",children:[a("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm",style:{color:"var(--text-muted)"},children:"Cancel"}),a("button",{onClick:i,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:r?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const tn="9remote.cc";function fr(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),r=Math.floor(t/60),i=t%60;return`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function ge({icon:e,onClick:t,title:r,danger:i}){return a("button",{onClick:t,title:r,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0",style:i?{color:"rgba(255,100,100,0.7)"}:{color:"var(--text-muted)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function nn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:r,permanentKey:i,onGenerateOneTimeKey:n,onRegenerateKey:o}){const l=ft(null),[s,c]=U(null),[u,m]=U(null),[d,h]=U(null);ie(()=>{!e||!l.current||dr.toCanvas(l.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ie(()=>{if(!r){c(null);return}const v=()=>c(r-Date.now());v();const C=setInterval(v,1e3);return()=>clearInterval(C)},[r]);const f=(v,C)=>{navigator.clipboard.writeText(v).catch(()=>{}),m(C),setTimeout(()=>m(null),2e3)};return a(ee,{children:[d==="oneTime"&&a(he,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{h(null),n==null||n()},onCancel:()=>h(null)}),d==="regen"&&a(he,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{h(null),o==null||o()},onCancel:()=>h(null)}),a("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[a("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?a("canvas",{ref:l}):a("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),a("div",{className:"flex flex-col items-center gap-1",children:[a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Scan QR or open link to sign in"}),a("a",{href:`https://${tn}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:underline transition-opacity",children:[a("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),a("span",{className:"text-sm font-bold",style:{color:"var(--brand-500)"},children:[tn,"/login"]}),a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:14,color:"var(--brand-500)"},children:"open_in_new"})]})]}),a("div",{className:"w-full h-px",style:{background:"var(--border)"}}),a("div",{className:"w-full flex flex-col gap-1.5",children:[a("div",{className:"flex items-center justify-between px-0.5",children:[a("span",{className:"text-xs font-medium",style:{color:"var(--text-muted)"},children:"One-Time Key"}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Single use · expires"})]}),a("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"timer"}),a("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"var(--border)"},children:t||"• • • • • •"}),s!==null&&a("span",{className:`text-xs font-mono flex-shrink-0 ${s<=0?"text-red-400":""}`,style:s>0?{color:"var(--text-muted)"}:{},children:fr(s)}),t&&a(ge,{icon:u==="oneTime"?"check":"content_copy",onClick:()=>f(t,"oneTime"),title:"Copy one-time key"}),a(ge,{icon:"refresh",onClick:()=>h("oneTime"),title:"New one-time key"})]})]}),a("div",{className:"w-full flex flex-col gap-1.5",children:[a("div",{className:"flex items-center justify-between px-0.5",children:[a("span",{className:"text-xs font-medium",style:{color:"var(--text-muted)"},children:"Permanent Key"}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Reusable · no expiry"})]}),a("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"key"}),a("span",{className:"flex-1 font-mono text-xs truncate",style:{color:"var(--text-muted)"},children:i||"— not set —"}),i&&a(ge,{icon:u==="permanent"?"check":"content_copy",onClick:()=>f(i,"permanent"),title:"Copy permanent key"}),a(ge,{icon:"autorenew",onClick:()=>h("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const hr="https://docs.9remote.cc/",Cn={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function mr({type:e,granted:t,onRequest:r}){const i=Cn[e]||{label:e,desc:""};return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":""}`,style:{fontSize:18,color:t?void 0:"var(--text-muted)"},children:t?"check_circle":"cancel"}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:t?"var(--text-main)":"var(--text-muted)"},children:i.label}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:i.desc})]}),!t&&a("button",{onClick:()=>r(e),title:"Click to grant permission",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]})}function pr({icon:e,label:t,desc:r,value:i,onToggle:n,activeColor:o="var(--brand-500)"}){return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:i?"var(--brand-400)":"var(--text-muted)"},children:e}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:"var(--text-main)"},children:t}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:r})]}),a("button",{onClick:n,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:i?o:"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:i?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]})}function _r({desktopEnabled:e,onDesktopToggle:t,permissions:r,onRequestPermission:i,autoStart:n,onAutoStartToggle:o}){const l=Object.entries(Cn),c=!l.every(([u])=>!!(r!=null&&r[u]))&&!e;return a("div",{className:"glass-card p-4 flex flex-col gap-3",children:[a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"Remote Terminal"}),a("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Full shell access · always on"})]}),a("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),a("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]}),a("div",{className:"w-full h-px",style:{background:"var(--border)"}}),a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"var(--glass-bg)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"var(--text-muted)"},children:"desktop_windows"})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"Remote Desktop"}),a("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Control screen, mouse & keyboard"})]}),a("button",{onClick:c?void 0:t,disabled:c,title:c?"Grant all permissions below to enable":"",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"var(--border)",opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),a("div",{className:"flex flex-col border-t pt-2",style:{borderColor:"var(--border)"},children:[a("p",{className:"text-[10px] uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"System Permissions"}),l.map(([u])=>a(mr,{type:u,granted:(r==null?void 0:r[u])??!1,onRequest:i},u))]}),a("div",{className:"flex flex-col border-t pt-2",style:{borderColor:"var(--border)"},children:[a("p",{className:"text-[10px] uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"Startup"}),a(pr,{icon:"power_settings_new",label:"Launch on system startup",desc:n?"Runs in background when you log in":"Disabled — start manually",value:!!n,onToggle:o})]})]})}function gr({version:e}){return e?a("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[a("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),a("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),a("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const yr=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],vr=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function br({onStart:e}){const[t,r]=U(!1),i=()=>{r(!0),e()};return a("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[a("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[a("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:a("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),a("h1",{className:"text-lg font-bold tracking-tight",style:{color:"var(--text-main)"},children:"9Remote"}),a("p",{className:"text-xs leading-5 max-w-[220px]",style:{color:"var(--text-muted)"},children:"Access your terminal, desktop & files from anywhere"})]}),a("div",{className:"flex gap-2 w-full mt-5",children:yr.map(n=>a("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[a("span",{className:"material-symbols-outlined",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),a("p",{className:"text-xs font-semibold",style:{color:"var(--text-main)"},children:n.label}),a("p",{className:"text-[10px] text-center leading-4",style:{color:"var(--text-muted)"},children:n.desc})]},n.label))}),a("div",{className:"flex flex-col gap-2 w-full mt-4",children:vr.map(n=>a("div",{className:"flex items-center gap-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:n.text})]},n.text))}),a("button",{onClick:t?void 0:i,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?a(ee,{children:[a("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>a("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):a(ee,{children:[a("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function xr(e,t,r=[]){const i=new Map;for(const s of t){if(!s.deviceId)continue;const c=i.get(s.deviceId);(!c||s.connectedAt&&s.connectedAt<c.connectedAt)&&i.set(s.deviceId,s)}const n=e.map(s=>{const c=i.get(s.deviceId);return{deviceId:s.deviceId,status:c?"online":"offline",ip:(c==null?void 0:c.ip)||null,connectedAt:(c==null?void 0:c.connectedAt)||null,approvedAt:s.approvedAt||null}}),o=r.map(s=>({deviceId:s.deviceId,status:"pending",ip:s.ip||null,connectedAt:null,approvedAt:null,rejectedAt:s.rejectedAt||null})),l={online:0,pending:1,offline:2};return[...n,...o].sort((s,c)=>l[s.status]-l[c.status])}const rn={online:{color:"#4ade80",icon:"wifi",title:"Online"},offline:{color:"var(--text-muted)",icon:"wifi_off",title:"Offline"},pending:{color:"#f59e0b",icon:"hourglass_top",title:"Pending approval"}};function wr({client:e,onRemove:t,onApprove:r}){const i=`${e.deviceId.slice(0,8)}...`,n=rn[e.status]||rn.offline,o=e.status==="online"?`Connected · ${e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""}`:e.status==="pending"?"Pending · waiting for approval":e.approvedAt?`Offline · approved ${new Date(e.approvedAt).toLocaleDateString()}`:"Offline",l=e.status==="online"?"Disconnect":"Remove";return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:n.color},title:n.title,children:n.icon}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium font-mono truncate",style:{color:"var(--text-main)"},children:[i,e.ip?` · ${e.ip}`:""]}),a("p",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:o})]}),e.status==="pending"&&a("button",{onClick:()=>r==null?void 0:r(e),className:"flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium",style:{background:"rgba(74,222,128,0.15)",color:"#4ade80"},title:"Approve this device",children:"Approve"}),a("button",{onClick:()=>t(e),className:"flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium",style:{background:"rgba(220,53,69,0.15)",color:"#dc3545"},title:"Disconnect and remove this device",children:l})]})}const on={healthy:{color:"#4ade80",label:"Healthy",dot:"bg-green-400"},unreachable:{color:"#dc3545",label:"Offline",dot:"bg-red-500"},unknown:{color:"var(--text-muted)",label:"Checking...",dot:"bg-gray-400"}};function Nr({tunnelHealth:e}){const t=on[e==null?void 0:e.status]||on.unknown,r=e!=null&&e.checkedAt?new Date(e.checkedAt).toLocaleTimeString():"--:--:--";return a("div",{className:"flex items-center gap-1.5 px-2 h-7 rounded-full glass-btn",title:`Tunnel ${t.label} · last check ${r}`,children:[a("span",{className:`w-1.5 h-1.5 rounded-full ${t.dot}`}),a("span",{className:"text-[11px] font-medium",style:{color:t.color},children:t.label})]})}function Cr({step:e,stepDesc:t="",healthCheck:r,tunnelHealth:i,tunnelUrl:n,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,qrUrl:c,permissions:u,desktopEnabled:m,updateVersion:d,connections:h=[],version:f="",onRequestPermission:v,onDesktopToggle:C,onStop:B,onStart:p,onShutdown:y,onGenerateOneTimeKey:w,onRegenerateKey:N,logs:M=[],theme:b,onToggleTheme:k,pendingDevice:x,onDeviceApprove:_,onDeviceReject:S,approvedDevices:E=[],rejectedDevices:A=[],onDeviceRemove:T,onFetchDevices:P,onDeviceApproveRejected:F,autoApprove:O=!1,onAutoApproveToggle:se,autoStart:V=!1,onAutoStartToggle:ae}){var mt;const[z,X]=U("connect"),[re,G]=U(!1),[ce,Q]=U(!1),[R,D]=U(null),g=ft(null),I=e===5,K=e===0,J=e>0&&e<5;ie(()=>{var H;z==="log"&&((H=g.current)==null||H.scrollIntoView({behavior:"smooth"})),z==="connect"&&(P==null||P())},[M,z,h.length]);const ue=xr(E,h,A),kn=ue.filter(H=>H.status==="online").length;return a("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"var(--bg-body)"},children:[a("div",{className:"flex-1 flex flex-col w-full min-h-0 dot-grid-bg overflow-hidden md:max-w-5xl p-3",style:{margin:"0 auto"},children:[a("div",{className:"flex items-center justify-between px-5 py-4",style:{boxShadow:"var(--header-shadow)",backdropFilter:"blur(10px)"},children:[a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:a("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),a("div",{className:"flex flex-col leading-tight",children:[a("span",{className:"brand-text text-xs",children:"9Remote"}),f&&a("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:["v",f]})]})]}),a("div",{className:"flex items-center gap-2",children:[I&&a(Nr,{tunnelHealth:i}),a("button",{onClick:k,className:"glass-btn w-7 h-7 flex items-center justify-center",style:{color:"var(--text-muted)"},title:b==="dark"?"Switch to light mode":"Switch to dark mode",children:a("span",{className:"material-symbols-outlined text-sm",children:b==="dark"?"light_mode":"dark_mode"})}),a("button",{onClick:()=>window.open(hr,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!K&&a("button",{onClick:()=>G(!0),className:"btn-danger px-3 h-7 flex items-center gap-1.5 text-xs font-medium",children:[a("span",{className:"material-symbols-outlined text-sm",children:"stop_circle"}),"Disconnect"]}),a("button",{onClick:()=>Q(!0),className:"glass-btn w-7 h-7 flex items-center justify-center",style:{color:"var(--text-muted)"},title:"Shutdown 9Remote (stop server, tunnel and quit)",children:a("span",{className:"material-symbols-outlined text-sm",children:"power_settings_new"})})]})]}),a(gr,{version:d}),K?a(br,{onStart:p,connecting:!1}):J?a("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4 max-w-2xl mx-auto w-full",children:a(On,{currentStep:e,activeDesc:t,healthCheck:r})}):a("div",{className:"flex-1 flex flex-col md:flex-row min-h-0",children:[a("div",{className:"hidden md:flex md:flex-col sidebar w-96 flex-shrink-0 overflow-y-auto p-5 gap-4",children:a(nn,{qrUrl:c,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,tunnelUrl:n,onGenerateOneTimeKey:w,onRegenerateKey:N})}),a("div",{className:"flex-1 flex flex-col min-h-0",children:[a("div",{className:"flex px-5 pt-3 gap-3",style:{borderColor:"var(--border)"},children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(H=>a("button",{onClick:()=>X(H.id),className:"py-2 text-xs font-medium border-b-2 transition-colors",style:z===H.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"var(--text-muted)"},children:H.label},H.id))}),a("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[z==="connect"&&a(ee,{children:[a("div",{className:"md:hidden",children:a(nn,{qrUrl:c,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,tunnelUrl:n,onGenerateOneTimeKey:w,onRegenerateKey:N})}),a(_r,{desktopEnabled:m,onDesktopToggle:C,permissions:u,onRequestPermission:v,autoStart:V,onAutoStartToggle:ae}),a("div",{className:"glass-card p-4 flex flex-col gap-1",children:[a("p",{className:"text-xs font-medium uppercase tracking-wider mb-2",style:{color:"var(--text-muted)"},children:["Clients",ue.length>0?` (${kn}/${ue.length} online)`:""]}),a("div",{className:"flex items-center gap-3 py-2 border-b",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:O?"var(--brand-400)":"var(--text-muted)"},children:O?"lock_open":"lock"}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:"var(--text-main)"},children:"Auto-approve new devices"}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:O?"Any new device connects without approval":"Require manual approval for new devices"})]}),a("button",{onClick:se,title:O?"Disable auto-approve":"Enable auto-approve",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:O?"var(--brand-500)":"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:O?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),ue.length===0?a("p",{className:"text-xs text-center py-3",style:{color:"var(--text-muted)"},children:"No clients yet"}):ue.map(H=>a(wr,{client:H,onRemove:D,onApprove:Te=>F==null?void 0:F(Te.deviceId)},H.deviceId))]})]}),z==="log"&&a("div",{className:"flex-1 flex flex-col",children:M.length===0?a("p",{className:"text-xs text-center mt-8",style:{color:"var(--text-muted)"},children:"No logs yet"}):a("div",{className:"flex flex-col gap-0.5",children:[M.map((H,Te)=>a("p",{className:"text-xs font-mono leading-5 break-all",style:{color:"var(--text-muted)"},children:H},Te)),a("div",{ref:g})]})})]})]})]})]}),re&&a(he,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{G(!1),B==null||B()},onCancel:()=>G(!1)}),ce&&a(he,{message:"Shutdown 9Remote completely? This will stop the server, close the tunnel and quit the app.",confirmLabel:"Shutdown",confirmDanger:!0,onConfirm:()=>{Q(!1),y==null||y()},onCancel:()=>Q(!1)}),R&&a(he,{message:R.status==="online"?`Disconnect and remove device ${R.deviceId.slice(0,8)}...? The client will be disconnected and need approval again next time.`:R.status==="pending"?`Remove pending device ${R.deviceId.slice(0,8)}...? It will need a fresh approval request to connect again.`:`Remove device ${R.deviceId.slice(0,8)}...? It will need approval again next time.`,confirmLabel:R.status==="online"?"Disconnect & Remove":"Remove",confirmDanger:!0,onConfirm:()=>{T==null||T(R),D(null)},onCancel:()=>D(null)}),x&&a("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:a("div",{className:"glass-card p-5 flex flex-col gap-4 w-80",children:[a("div",{className:"flex items-center gap-2",children:[a("span",{className:"material-symbols-outlined",style:{color:"var(--brand-500)",fontSize:24},children:"devices"}),a("span",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"New Device Connection"})]}),a("div",{className:"flex flex-col gap-1 text-xs",style:{color:"var(--text-muted)"},children:[a("span",{children:["Device: ",a("span",{style:{color:"var(--text-main)"},children:[(mt=x.deviceId)==null?void 0:mt.slice(0,8),"..."]})]}),a("span",{children:["IP: ",a("span",{style:{color:"var(--text-main)"},children:x.ip})]})]}),a("div",{className:"flex gap-2",children:[a("button",{onClick:S,className:"glass-btn flex-1 py-2 text-sm",style:{color:"var(--text-muted)"},children:"Reject"}),a("button",{onClick:_,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:"var(--brand-500)",color:"#fff"},children:"Approve"})]})]})})]})}const kr=3e3,it={running:!1,timeoutMs:0,startedAt:null,logs:[]},lt={status:"unknown",checkedAt:null},et={step:0,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:it,tunnelHealth:lt},Sr={screenRecording:!1,accessibility:!1},ln=200;function Er(){const[e,t]=U(et),[r,i]=U(Sr),[n,o]=U(!1),[l,s]=U([]),[c,u]=U(null),[m,d]=U([]),[h,f]=U(null),[v,C]=U([]),[B,p]=U([]),[y,w]=U(!1),[N,M]=U(!1),[b,k]=U(""),[x,_]=U(()=>localStorage.getItem("9remote-theme")||"dark");ie(()=>{document.documentElement.setAttribute("data-theme",x),localStorage.setItem("9remote-theme",x)},[x]);const S=()=>{_(R=>R==="dark"?"light":"dark")};ie(()=>{fetch("/api/version").then(g=>g.json()).then(g=>k(g.version??"")).catch(()=>{}),fetch("/api/ui/state").then(g=>g.json()).then(g=>{t({step:g.step??0,stepDesc:g.stepDesc??"",tunnelUrl:g.tunnelUrl??"",oneTimeKey:g.oneTimeKey??"",oneTimeKeyExpiresAt:g.oneTimeKeyExpiresAt??null,permanentKey:g.permanentKey??"",qrUrl:g.qrUrl??"",latency:g.latency??null,uptime:g.uptime??null,healthCheck:g.healthCheck??it,tunnelHealth:g.tunnelHealth??lt}),i({screenRecording:g.screenRecording??!1,accessibility:g.accessibility??!1}),g.desktopEnabled!==void 0&&o(g.desktopEnabled),g.theme&&(g.theme==="light"||g.theme==="dark")&&_(g.theme)}).catch(()=>{});const R=new EventSource("/api/ui/events");R.onmessage=g=>{try{const I=JSON.parse(g.data);I.type==="state"?t({step:I.step??0,stepDesc:I.stepDesc??"",tunnelUrl:I.tunnelUrl??"",oneTimeKey:I.oneTimeKey??"",oneTimeKeyExpiresAt:I.oneTimeKeyExpiresAt??null,permanentKey:I.permanentKey??"",qrUrl:I.qrUrl??"",latency:I.latency??null,uptime:I.uptime??null,healthCheck:I.healthCheck??it,tunnelHealth:I.tunnelHealth??lt}):I.type==="log"?s(K=>{const J=[...K,I.message];return J.length>ln?J.slice(-ln):J}):I.type==="updateAvailable"?u(I.version):I.type==="permissions"?(i({screenRecording:I.screenRecording,accessibility:I.accessibility}),I.desktopEnabled!==void 0&&o(I.desktopEnabled)):I.type==="connections"?d(I.connections??[]):I.type==="deviceApproval"&&I.action==="pending"?f({socketId:I.socketId,deviceId:I.deviceId,ip:I.ip}):I.type==="deviceApproval"&&I.action==="refresh"?V():I.type==="autostart"&&M(!!I.enabled)}catch{}},R.onerror=()=>{},fetch("/api/device/auto-approve").then(g=>g.json()).then(g=>{w(!!(g!=null&&g.enabled))}).catch(()=>{}),fetch("/api/autostart").then(g=>g.json()).then(g=>{M(!!(g!=null&&g.enabled))}).catch(()=>{});const D=setInterval(async()=>{var g;if(!E.current)try{const I=await fetch("/api/device/pending");if(!I.ok)return;const K=await I.json(),J=(g=K==null?void 0:K.pending)==null?void 0:g[0];J&&!E.current&&f({socketId:J.socketId,deviceId:J.deviceId,ip:J.ip})}catch{}},kr);return()=>{R.close(),clearInterval(D)}},[]);const E=ft(null);ie(()=>{E.current=h},[h]);const A=async R=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:R})}).catch(()=>{})},T=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(et)},P=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},F=()=>{fetch("/api/ui/shutdown",{method:"POST"}).catch(()=>{}),t(et)},O=async()=>{const R=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(R!=null&&R.ok))return;const D=await R.json().catch(()=>null);D!=null&&D.oneTimeKey&&t(g=>({...g,oneTimeKey:D.oneTimeKey,oneTimeKeyExpiresAt:D.expiresAt,qrUrl:D.qrUrl??g.qrUrl}))},se=async()=>{const R=!n;o(R),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})}).catch(()=>{})},V=async()=>{try{const[R,D]=await Promise.all([fetch("/api/device/approved"),fetch("/api/device/rejected")]);if(R.ok){const g=await R.json();C(g.devices||[])}if(D.ok){const g=await D.json();p(g.rejected||[])}}catch{}},ae=async R=>{const D=R.status==="pending"?"/api/device/clear-rejected":"/api/device/remove";await fetch(D,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:R.deviceId})}).catch(()=>{}),V()},z=async()=>{h&&(await fetch("/api/device/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({socketId:h.socketId})}).catch(()=>{}),f(null),V())},X=async()=>{h&&(await fetch("/api/device/reject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({socketId:h.socketId})}).catch(()=>{}),f(null),V())},re=async()=>{const R=!N;M(R);try{const g=await(await fetch("/api/autostart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})})).json().catch(()=>null);g&&typeof g.enabled=="boolean"&&M(g.enabled)}catch{M(!R)}},G=async()=>{const R=!y;w(R);try{const g=await(await fetch("/api/device/auto-approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})})).json().catch(()=>null);g&&typeof g.enabled=="boolean"&&w(g.enabled)}catch{w(!R)}},ce=async R=>{await fetch("/api/device/approve-rejected",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:R})}).catch(()=>{}),V()},Q=async()=>{const R=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(R!=null&&R.ok))return;const D=await R.json().catch(()=>null);D!=null&&D.permanentKey&&t(g=>({...g,permanentKey:D.permanentKey}))};return a(Cr,{step:e.step,stepDesc:e.stepDesc,healthCheck:e.healthCheck,tunnelHealth:e.tunnelHealth,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:r,desktopEnabled:n,updateVersion:c,connections:m,onRequestPermission:A,onDesktopToggle:se,onStop:T,onStart:P,onShutdown:F,onGenerateOneTimeKey:O,onRegenerateKey:Q,logs:l,version:b,theme:x,onToggleTheme:S,pendingDevice:h,onDeviceApprove:z,onDeviceReject:X,approvedDevices:v,rejectedDevices:B,onDeviceRemove:ae,onFetchDevices:V,onDeviceApproveRejected:ce,autoApprove:y,onAutoApproveToggle:G,autoStart:N,onAutoStartToggle:re})}Bn(a(Er,{}),document.getElementById("root"));
|
|
7
|
+
`);const A=w(k,x,S),T=e.getSymbolSize(k),I=new i(T);return f(I,k),v(I),C(I,k),_(I,x,0),k>=7&&B(I,k),y(I,A),isNaN(g)&&(g=l.getBestMask(I,_.bind(null,I,x))),l.applyMask(g,I),_(I,x,g),{modules:I,version:k,errorCorrectionLevel:x,maskPattern:g,segments:S}}return Be.create=function(k,x){if(typeof k>"u"||k==="")throw new Error("No input text");let g=t.M,S,E;return typeof x<"u"&&(g=t.from(x.errorCorrectionLevel,t.M),S=u.from(x.version),E=l.from(x.maskPattern),x.toSJISFunc&&e.setToSJISFunction(x.toSJISFunc)),M(k,S,g,E)},Be}var Ze={},$e={},Zt;function Cn(){return Zt||(Zt=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(o){return[o,o]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,o=i.width&&i.width>=21?i.width:void 0,l=i.scale||4;return{width:o,scale:o?4:l,margin:n,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},e.getImageWidth=function(i,n){const o=e.getScale(i,n);return Math.floor((i+n.margin*2)*o)},e.qrToImageData=function(i,n,o){const l=n.modules.size,s=n.modules.data,c=e.getScale(l,o),u=Math.floor((l+o.margin*2)*c),m=o.margin*c,d=[o.color.light,o.color.dark];for(let h=0;h<u;h++)for(let f=0;f<u;f++){let v=(h*u+f)*4,C=o.color.light;if(h>=m&&f>=m&&h<u-m&&f<u-m){const B=Math.floor((h-m)/c),_=Math.floor((f-m)/c);C=d[s[B*l+_]?1:0]}i[v++]=C.r,i[v++]=C.g,i[v++]=C.b,i[v]=C.a}}})($e)),$e}var $t;function ar(){return $t||($t=1,(function(e){const t=Cn();function r(n,o,l){n.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=l,o.width=l,o.style.height=l+"px",o.style.width=l+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,l,s){let c=s,u=l;typeof c>"u"&&(!l||!l.getContext)&&(c=l,l=void 0),l||(u=i()),c=t.getOptions(c);const m=t.getImageWidth(o.modules.size,c),d=u.getContext("2d"),h=d.createImageData(m,m);return t.qrToImageData(h.data,o,c),r(d,u,m),d.putImageData(h,0,0),u},e.renderToDataURL=function(o,l,s){let c=s;typeof c>"u"&&(!l||!l.getContext)&&(c=l,l=void 0),c||(c={});const u=e.render(o,l,c),m=c.type||"image/png",d=c.rendererOpts||{};return u.toDataURL(m,d.quality)}})(Ze)),Ze}var et={},en;function cr(){if(en)return et;en=1;const e=Cn();function t(n,o){const l=n.a/255,s=o+'="'+n.hex+'"';return l<1?s+" "+o+'-opacity="'+l.toFixed(2).slice(1)+'"':s}function r(n,o,l){let s=n+o;return typeof l<"u"&&(s+=" "+l),s}function i(n,o,l){let s="",c=0,u=!1,m=0;for(let d=0;d<n.length;d++){const h=Math.floor(d%o),f=Math.floor(d/o);!h&&!u&&(u=!0),n[d]?(m++,d>0&&h>0&&n[d-1]||(s+=u?r("M",h+l,.5+f+l):r("m",c,0),c=0,u=!1),h+1<o&&n[d+1]||(s+=r("h",m),m=0)):c++}return s}return et.render=function(o,l,s){const c=e.getOptions(l),u=o.modules.size,m=o.modules.data,d=u+c.margin*2,h=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",f="<path "+t(c.color.dark,"stroke")+' d="'+i(m,u,c.margin)+'"/>',v='viewBox="0 0 '+d+" "+d+'"',B='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+v+' shape-rendering="crispEdges">'+h+f+`</svg>
|
|
8
|
+
`;return typeof s=="function"&&s(null,B),B},et}var tn;function ur(){if(tn)return oe;tn=1;const e=Kn(),t=sr(),r=ar(),i=cr();function n(o,l,s,c,u){const m=[].slice.call(arguments,1),d=m.length,h=typeof m[d-1]=="function";if(!h&&!e())throw new Error("Callback required as last argument");if(h){if(d<2)throw new Error("Too few arguments provided");d===2?(u=s,s=l,l=c=void 0):d===3&&(l.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=s,s=l,l=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(s=l,l=c=void 0):d===2&&!l.getContext&&(c=s,s=l,l=void 0),new Promise(function(f,v){try{const C=t.create(s,c);f(o(C,l,c))}catch(C){v(C)}})}try{const f=t.create(s,c);u(null,o(f,l,c))}catch(f){u(f)}}return oe.create=t.create,oe.toCanvas=n.bind(null,r.render),oe.toDataURL=n.bind(null,r.renderToDataURL),oe.toString=n.bind(null,function(o,l,s){return i.render(o,s)}),oe}var dr=ur();const fr=zn(dr);function he({message:e,confirmLabel:t="Confirm",confirmDanger:r=!1,onConfirm:i,onCancel:n}){return a("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:a("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[a("p",{className:"text-sm text-center",style:{color:"var(--text-main)"},children:e}),a("div",{className:"flex gap-2",children:[a("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm",style:{color:"var(--text-muted)"},children:"Cancel"}),a("button",{onClick:i,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:r?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const nn="9remote.cc";function hr(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),r=Math.floor(t/60),i=t%60;return`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function ge({icon:e,onClick:t,title:r,danger:i}){return a("button",{onClick:t,title:r,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0",style:i?{color:"rgba(255,100,100,0.7)"}:{color:"var(--text-muted)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function rn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:r,permanentKey:i,onGenerateOneTimeKey:n,onRegenerateKey:o}){const l=ht(null),[s,c]=U(null),[u,m]=U(null),[d,h]=U(null);ie(()=>{!e||!l.current||fr.toCanvas(l.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ie(()=>{if(!r){c(null);return}const v=()=>c(r-Date.now());v();const C=setInterval(v,1e3);return()=>clearInterval(C)},[r]);const f=(v,C)=>{navigator.clipboard.writeText(v).catch(()=>{}),m(C),setTimeout(()=>m(null),2e3)};return a(ee,{children:[d==="oneTime"&&a(he,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{h(null),n==null||n()},onCancel:()=>h(null)}),d==="regen"&&a(he,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{h(null),o==null||o()},onCancel:()=>h(null)}),a("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[a("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?a("canvas",{ref:l}):a("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),a("div",{className:"flex flex-col items-center gap-1",children:[a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Scan QR or open link to sign in"}),a("a",{href:`https://${nn}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:underline transition-opacity",children:[a("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),a("span",{className:"text-sm font-bold",style:{color:"var(--brand-500)"},children:[nn,"/login"]}),a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:14,color:"var(--brand-500)"},children:"open_in_new"})]})]}),a("div",{className:"w-full h-px",style:{background:"var(--border)"}}),a("div",{className:"w-full flex flex-col gap-1.5",children:[a("div",{className:"flex items-center justify-between px-0.5",children:[a("span",{className:"text-xs font-medium",style:{color:"var(--text-muted)"},children:"One-Time Key"}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Single use · expires"})]}),a("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"timer"}),a("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"var(--border)"},children:t||"• • • • • •"}),s!==null&&a("span",{className:`text-xs font-mono flex-shrink-0 ${s<=0?"text-red-400":""}`,style:s>0?{color:"var(--text-muted)"}:{},children:hr(s)}),t&&a(ge,{icon:u==="oneTime"?"check":"content_copy",onClick:()=>f(t,"oneTime"),title:"Copy one-time key"}),a(ge,{icon:"refresh",onClick:()=>h("oneTime"),title:"New one-time key"})]})]}),a("div",{className:"w-full flex flex-col gap-1.5",children:[a("div",{className:"flex items-center justify-between px-0.5",children:[a("span",{className:"text-xs font-medium",style:{color:"var(--text-muted)"},children:"Permanent Key"}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Reusable · no expiry"})]}),a("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"key"}),a("span",{className:"flex-1 font-mono text-xs truncate",style:{color:"var(--text-muted)"},children:i||"— not set —"}),i&&a(ge,{icon:u==="permanent"?"check":"content_copy",onClick:()=>f(i,"permanent"),title:"Copy permanent key"}),a(ge,{icon:"autorenew",onClick:()=>h("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const mr="https://docs.9remote.cc/",kn={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function pr({type:e,granted:t,onRequest:r}){const i=kn[e]||{label:e,desc:""};return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":""}`,style:{fontSize:18,color:t?void 0:"var(--text-muted)"},children:t?"check_circle":"cancel"}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:t?"var(--text-main)":"var(--text-muted)"},children:i.label}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:i.desc})]}),!t&&a("button",{onClick:()=>r(e),title:"Click to grant permission",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]})}function _r({icon:e,label:t,desc:r,value:i,onToggle:n,activeColor:o="var(--brand-500)"}){return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:i?"var(--brand-400)":"var(--text-muted)"},children:e}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:"var(--text-main)"},children:t}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:r})]}),a("button",{onClick:n,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:i?o:"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:i?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]})}function gr({desktopEnabled:e,onDesktopToggle:t,permissions:r,onRequestPermission:i,autoStart:n,onAutoStartToggle:o}){const l=Object.entries(kn),c=!l.every(([u])=>!!(r!=null&&r[u]))&&!e;return a("div",{className:"glass-card p-4 flex flex-col gap-3",children:[a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"Remote Terminal"}),a("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Full shell access · always on"})]}),a("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),a("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]}),a("div",{className:"w-full h-px",style:{background:"var(--border)"}}),a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"var(--glass-bg)"},children:a("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"var(--text-muted)"},children:"desktop_windows"})}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"Remote Desktop"}),a("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Control screen, mouse & keyboard"})]}),a("button",{onClick:c?void 0:t,disabled:c,title:c?"Grant all permissions below to enable":"",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"var(--border)",opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),a("div",{className:"flex flex-col border-t pt-2",style:{borderColor:"var(--border)"},children:[a("p",{className:"text-[10px] uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"System Permissions"}),l.map(([u])=>a(pr,{type:u,granted:(r==null?void 0:r[u])??!1,onRequest:i},u))]}),a("div",{className:"flex flex-col border-t pt-2",style:{borderColor:"var(--border)"},children:[a("p",{className:"text-[10px] uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"Startup"}),a(_r,{icon:"power_settings_new",label:"Launch on system startup",desc:n?"Runs in background when you log in":"Disabled — start manually",value:!!n,onToggle:o})]})]})}function yr({version:e}){return e?a("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[a("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),a("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),a("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const vr=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],br=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function xr({onStart:e}){const[t,r]=U(!1),i=()=>{r(!0),e()};return a("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[a("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[a("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:a("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),a("h1",{className:"text-lg font-bold tracking-tight",style:{color:"var(--text-main)"},children:"9Remote"}),a("p",{className:"text-xs leading-5 max-w-[220px]",style:{color:"var(--text-muted)"},children:"Access your terminal, desktop & files from anywhere"})]}),a("div",{className:"flex gap-2 w-full mt-5",children:vr.map(n=>a("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[a("span",{className:"material-symbols-outlined",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),a("p",{className:"text-xs font-semibold",style:{color:"var(--text-main)"},children:n.label}),a("p",{className:"text-[10px] text-center leading-4",style:{color:"var(--text-muted)"},children:n.desc})]},n.label))}),a("div",{className:"flex flex-col gap-2 w-full mt-4",children:br.map(n=>a("div",{className:"flex items-center gap-2.5",children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),a("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:n.text})]},n.text))}),a("button",{onClick:t?void 0:i,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?a(ee,{children:[a("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>a("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):a(ee,{children:[a("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function wr(e,t,r=[]){const i=new Map;for(const s of t){if(!s.deviceId)continue;const c=i.get(s.deviceId);(!c||s.connectedAt&&s.connectedAt<c.connectedAt)&&i.set(s.deviceId,s)}const n=e.map(s=>{const c=i.get(s.deviceId);return{deviceId:s.deviceId,status:c?"online":"offline",ip:(c==null?void 0:c.ip)||null,connectedAt:(c==null?void 0:c.connectedAt)||null,approvedAt:s.approvedAt||null}}),o=r.map(s=>({deviceId:s.deviceId,status:"pending",ip:s.ip||null,connectedAt:null,approvedAt:null,rejectedAt:s.rejectedAt||null})),l={online:0,pending:1,offline:2};return[...n,...o].sort((s,c)=>l[s.status]-l[c.status])}const on={online:{color:"#4ade80",icon:"wifi",title:"Online"},offline:{color:"var(--text-muted)",icon:"wifi_off",title:"Offline"},pending:{color:"#f59e0b",icon:"hourglass_top",title:"Pending approval"}};function Nr({client:e,onRemove:t,onApprove:r}){const i=`${e.deviceId.slice(0,8)}...`,n=on[e.status]||on.offline,o=e.status==="online"?`Connected · ${e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""}`:e.status==="pending"?"Pending · waiting for approval":e.approvedAt?`Offline · approved ${new Date(e.approvedAt).toLocaleDateString()}`:"Offline",l=e.status==="online"?"Disconnect":"Remove";return a("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:n.color},title:n.title,children:n.icon}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium font-mono truncate",style:{color:"var(--text-main)"},children:[i,e.ip?` · ${e.ip}`:""]}),a("p",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:o})]}),e.status==="pending"&&a("button",{onClick:()=>r==null?void 0:r(e),className:"flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium",style:{background:"rgba(74,222,128,0.15)",color:"#4ade80"},title:"Approve this device",children:"Approve"}),a("button",{onClick:()=>t(e),className:"flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium",style:{background:"rgba(220,53,69,0.15)",color:"#dc3545"},title:"Disconnect and remove this device",children:l})]})}const ln={healthy:{color:"#4ade80",label:"Healthy",dot:"bg-green-400"},unreachable:{color:"#dc3545",label:"Offline",dot:"bg-red-500"},unknown:{color:"var(--text-muted)",label:"Checking...",dot:"bg-gray-400"}};function ye({icon:e,title:t,danger:r,onClick:i}){return a("button",{onClick:i,title:t,className:r?"btn-danger w-7 h-7 flex items-center justify-center":"glass-btn w-7 h-7 flex items-center justify-center",style:r?void 0:{color:"var(--text-muted)"},children:a("span",{className:"material-symbols-outlined text-sm",children:e})})}function Cr({tunnelHealth:e}){const t=ln[e==null?void 0:e.status]||ln.unknown,r=e!=null&&e.checkedAt?new Date(e.checkedAt).toLocaleTimeString():"--:--:--";return a("div",{className:"flex items-center gap-1.5 px-2 h-7 rounded-full glass-btn",title:`Tunnel ${t.label} · last check ${r}`,children:[a("span",{className:`w-1.5 h-1.5 rounded-full ${t.dot}`}),a("span",{className:"text-[11px] font-medium",style:{color:t.color},children:t.label})]})}function kr({step:e,stepDesc:t="",healthCheck:r,tunnelHealth:i,tunnelUrl:n,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,qrUrl:c,permissions:u,desktopEnabled:m,updateVersion:d,connections:h=[],version:f="",onRequestPermission:v,onDesktopToggle:C,onStop:B,onStart:_,onShutdown:y,onGenerateOneTimeKey:w,onRegenerateKey:N,logs:M=[],theme:b,onToggleTheme:k,pendingDevice:x,onDeviceApprove:g,onDeviceReject:S,approvedDevices:E=[],rejectedDevices:A=[],onDeviceRemove:T,onFetchDevices:I,onDeviceApproveRejected:F,autoApprove:O=!1,onAutoApproveToggle:se,autoStart:V=!1,onAutoStartToggle:ae}){var pt;const[z,X]=U("connect"),[re,G]=U(!1),[ce,Q]=U(!1),[R,D]=U(null),p=ht(null),P=e===5,K=e===0,J=e>0&&e<5;ie(()=>{var H;z==="log"&&((H=p.current)==null||H.scrollIntoView({behavior:"smooth"})),z==="connect"&&(I==null||I())},[M,z,h.length]);const ue=wr(E,h,A),Sn=ue.filter(H=>H.status==="online").length;return a("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"var(--bg-body)"},children:[a("div",{className:"flex-1 flex flex-col w-full min-h-0 dot-grid-bg overflow-hidden md:max-w-5xl p-3",style:{margin:"0 auto"},children:[a("div",{className:"flex items-center justify-between px-5 py-4",style:{boxShadow:"var(--header-shadow)",backdropFilter:"blur(10px)"},children:[a("div",{className:"flex items-center gap-3",children:[a("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:a("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),a("div",{className:"flex flex-col leading-tight",children:[a("span",{className:"brand-text text-xs",children:"9Remote"}),f&&a("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:["v",f]})]})]}),a("div",{className:"flex items-center gap-2",children:[P&&a(Cr,{tunnelHealth:i}),a(ye,{icon:b==="dark"?"light_mode":"dark_mode",title:b==="dark"?"Switch to light mode":"Switch to dark mode",onClick:k}),a(ye,{icon:"help_outline",title:"Help & documentation",onClick:()=>window.open(mr,"_blank")}),!K&&a(ye,{icon:"stop_circle",title:"Stop the tunnel and disconnect clients",danger:!0,onClick:()=>G(!0)}),a(ye,{icon:"power_settings_new",title:"Shutdown 9Remote (stop server, tunnel and quit)",onClick:()=>Q(!0)})]})]}),a(yr,{version:d}),K?a(xr,{onStart:_,connecting:!1}):J?a("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4 max-w-2xl mx-auto w-full",children:a(Hn,{currentStep:e,activeDesc:t,healthCheck:r})}):a("div",{className:"flex-1 flex flex-col md:flex-row min-h-0",children:[a("div",{className:"hidden md:flex md:flex-col sidebar w-96 flex-shrink-0 overflow-y-auto p-5 gap-4",children:a(rn,{qrUrl:c,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,tunnelUrl:n,onGenerateOneTimeKey:w,onRegenerateKey:N})}),a("div",{className:"flex-1 flex flex-col min-h-0",children:[a("div",{className:"flex px-5 pt-3 gap-3",style:{borderColor:"var(--border)"},children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(H=>a("button",{onClick:()=>X(H.id),className:"py-2 text-xs font-medium border-b-2 transition-colors",style:z===H.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"var(--text-muted)"},children:H.label},H.id))}),a("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[z==="connect"&&a(ee,{children:[a("div",{className:"md:hidden",children:a(rn,{qrUrl:c,oneTimeKey:o,oneTimeKeyExpiresAt:l,permanentKey:s,tunnelUrl:n,onGenerateOneTimeKey:w,onRegenerateKey:N})}),a(gr,{desktopEnabled:m,onDesktopToggle:C,permissions:u,onRequestPermission:v,autoStart:V,onAutoStartToggle:ae}),a("div",{className:"glass-card p-4 flex flex-col gap-1",children:[a("p",{className:"text-xs font-medium uppercase tracking-wider mb-2",style:{color:"var(--text-muted)"},children:["Clients",ue.length>0?` (${Sn}/${ue.length} online)`:""]}),a("div",{className:"flex items-center gap-3 py-2 border-b",style:{borderColor:"var(--border)"},children:[a("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:18,color:O?"var(--brand-400)":"var(--text-muted)"},children:O?"lock_open":"lock"}),a("div",{className:"flex-1 min-w-0",children:[a("p",{className:"text-xs font-medium",style:{color:"var(--text-main)"},children:"Auto-approve new devices"}),a("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:O?"Any new device connects without approval":"Require manual approval for new devices"})]}),a("button",{onClick:se,title:O?"Disable auto-approve":"Enable auto-approve",className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:O?"var(--brand-500)":"var(--border)",cursor:"pointer"},children:a("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:O?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),ue.length===0?a("p",{className:"text-xs text-center py-3",style:{color:"var(--text-muted)"},children:"No clients yet"}):ue.map(H=>a(Nr,{client:H,onRemove:D,onApprove:Ae=>F==null?void 0:F(Ae.deviceId)},H.deviceId))]})]}),z==="log"&&a("div",{className:"flex-1 flex flex-col",children:M.length===0?a("p",{className:"text-xs text-center mt-8",style:{color:"var(--text-muted)"},children:"No logs yet"}):a("div",{className:"flex flex-col gap-0.5",children:[M.map((H,Ae)=>a("p",{className:"text-xs font-mono leading-5 break-all",style:{color:"var(--text-muted)"},children:H},Ae)),a("div",{ref:p})]})})]})]})]})]}),re&&a(he,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{G(!1),B==null||B()},onCancel:()=>G(!1)}),ce&&a(he,{message:"Shutdown 9Remote completely? This will stop the server, close the tunnel and quit the app.",confirmLabel:"Shutdown",confirmDanger:!0,onConfirm:()=>{Q(!1),y==null||y()},onCancel:()=>Q(!1)}),R&&a(he,{message:R.status==="online"?`Disconnect and remove device ${R.deviceId.slice(0,8)}...? The client will be disconnected and need approval again next time.`:R.status==="pending"?`Remove pending device ${R.deviceId.slice(0,8)}...? It will need a fresh approval request to connect again.`:`Remove device ${R.deviceId.slice(0,8)}...? It will need approval again next time.`,confirmLabel:R.status==="online"?"Disconnect & Remove":"Remove",confirmDanger:!0,onConfirm:()=>{T==null||T(R),D(null)},onCancel:()=>D(null)}),x&&a("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:a("div",{className:"glass-card p-5 flex flex-col gap-4 w-80",children:[a("div",{className:"flex items-center gap-2",children:[a("span",{className:"material-symbols-outlined",style:{color:"var(--brand-500)",fontSize:24},children:"devices"}),a("span",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"New Device Connection"})]}),a("div",{className:"flex flex-col gap-1 text-xs",style:{color:"var(--text-muted)"},children:[a("span",{children:["Device: ",a("span",{style:{color:"var(--text-main)"},children:[(pt=x.deviceId)==null?void 0:pt.slice(0,8),"..."]})]}),a("span",{children:["IP: ",a("span",{style:{color:"var(--text-main)"},children:x.ip})]})]}),a("div",{className:"flex gap-2",children:[a("button",{onClick:S,className:"glass-btn flex-1 py-2 text-sm",style:{color:"var(--text-muted)"},children:"Reject"}),a("button",{onClick:g,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:"var(--brand-500)",color:"#fff"},children:"Approve"})]})]})})]})}const Sr=3e3,lt={running:!1,timeoutMs:0,startedAt:null,logs:[]},st={status:"unknown",checkedAt:null},tt={step:0,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:lt,tunnelHealth:st},Er={screenRecording:!1,accessibility:!1},sn=200;function Tr(){const[e,t]=U(tt),[r,i]=U(Er),[n,o]=U(!1),[l,s]=U([]),[c,u]=U(null),[m,d]=U([]),[h,f]=U(null),[v,C]=U([]),[B,_]=U([]),[y,w]=U(!1),[N,M]=U(!1),[b,k]=U(""),[x,g]=U(()=>localStorage.getItem("9remote-theme")||"dark");ie(()=>{document.documentElement.setAttribute("data-theme",x),localStorage.setItem("9remote-theme",x)},[x]);const S=()=>{g(R=>R==="dark"?"light":"dark")};ie(()=>{fetch("/api/version").then(p=>p.json()).then(p=>k(p.version??"")).catch(()=>{}),fetch("/api/ui/state").then(p=>p.json()).then(p=>{t({step:p.step??0,stepDesc:p.stepDesc??"",tunnelUrl:p.tunnelUrl??"",oneTimeKey:p.oneTimeKey??"",oneTimeKeyExpiresAt:p.oneTimeKeyExpiresAt??null,permanentKey:p.permanentKey??"",qrUrl:p.qrUrl??"",latency:p.latency??null,uptime:p.uptime??null,healthCheck:p.healthCheck??lt,tunnelHealth:p.tunnelHealth??st}),i({screenRecording:p.screenRecording??!1,accessibility:p.accessibility??!1}),p.desktopEnabled!==void 0&&o(p.desktopEnabled),p.theme&&(p.theme==="light"||p.theme==="dark")&&g(p.theme)}).catch(()=>{}),fetch("/api/logs").then(p=>p.json()).then(p=>{Array.isArray(p==null?void 0:p.logs)&&s(p.logs)}).catch(()=>{});const R=new EventSource("/api/ui/events");R.onmessage=p=>{try{const P=JSON.parse(p.data);P.type==="state"?t({step:P.step??0,stepDesc:P.stepDesc??"",tunnelUrl:P.tunnelUrl??"",oneTimeKey:P.oneTimeKey??"",oneTimeKeyExpiresAt:P.oneTimeKeyExpiresAt??null,permanentKey:P.permanentKey??"",qrUrl:P.qrUrl??"",latency:P.latency??null,uptime:P.uptime??null,healthCheck:P.healthCheck??lt,tunnelHealth:P.tunnelHealth??st}):P.type==="log"?s(K=>{const J=[...K,P.message];return J.length>sn?J.slice(-sn):J}):P.type==="updateAvailable"?u(P.version):P.type==="permissions"?(i({screenRecording:P.screenRecording,accessibility:P.accessibility}),P.desktopEnabled!==void 0&&o(P.desktopEnabled)):P.type==="connections"?d(P.connections??[]):P.type==="deviceApproval"&&P.action==="pending"?f({socketId:P.socketId,deviceId:P.deviceId,ip:P.ip}):P.type==="deviceApproval"&&P.action==="refresh"?V():P.type==="autostart"&&M(!!P.enabled)}catch{}},R.onerror=()=>{},fetch("/api/device/auto-approve").then(p=>p.json()).then(p=>{w(!!(p!=null&&p.enabled))}).catch(()=>{}),fetch("/api/autostart").then(p=>p.json()).then(p=>{M(!!(p!=null&&p.enabled))}).catch(()=>{});const D=setInterval(async()=>{var p;if(!E.current)try{const P=await fetch("/api/device/pending");if(!P.ok)return;const K=await P.json(),J=(p=K==null?void 0:K.pending)==null?void 0:p[0];J&&!E.current&&f({socketId:J.socketId,deviceId:J.deviceId,ip:J.ip})}catch{}},Sr);return()=>{R.close(),clearInterval(D)}},[]);const E=ht(null);ie(()=>{E.current=h},[h]);const A=async R=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:R})}).catch(()=>{})},T=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(tt)},I=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},F=()=>{fetch("/api/ui/shutdown",{method:"POST"}).catch(()=>{}),t(tt)},O=async()=>{const R=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(R!=null&&R.ok))return;const D=await R.json().catch(()=>null);D!=null&&D.oneTimeKey&&t(p=>({...p,oneTimeKey:D.oneTimeKey,oneTimeKeyExpiresAt:D.expiresAt,qrUrl:D.qrUrl??p.qrUrl}))},se=async()=>{const R=!n;o(R),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})}).catch(()=>{})},V=async()=>{try{const[R,D]=await Promise.all([fetch("/api/device/approved"),fetch("/api/device/rejected")]);if(R.ok){const p=await R.json();C(p.devices||[])}if(D.ok){const p=await D.json();_(p.rejected||[])}}catch{}},ae=async R=>{const D=R.status==="pending"?"/api/device/clear-rejected":"/api/device/remove";await fetch(D,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:R.deviceId})}).catch(()=>{}),V()},z=async()=>{h&&(await fetch("/api/device/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({socketId:h.socketId})}).catch(()=>{}),f(null),V())},X=async()=>{h&&(await fetch("/api/device/reject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({socketId:h.socketId})}).catch(()=>{}),f(null),V())},re=async()=>{const R=!N;M(R);try{const p=await(await fetch("/api/autostart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})})).json().catch(()=>null);p&&typeof p.enabled=="boolean"&&M(p.enabled)}catch{M(!R)}},G=async()=>{const R=!y;w(R);try{const p=await(await fetch("/api/device/auto-approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:R})})).json().catch(()=>null);p&&typeof p.enabled=="boolean"&&w(p.enabled)}catch{w(!R)}},ce=async R=>{await fetch("/api/device/approve-rejected",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:R})}).catch(()=>{}),V()},Q=async()=>{const R=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(R!=null&&R.ok))return;const D=await R.json().catch(()=>null);D!=null&&D.permanentKey&&t(p=>({...p,permanentKey:D.permanentKey}))};return a(kr,{step:e.step,stepDesc:e.stepDesc,healthCheck:e.healthCheck,tunnelHealth:e.tunnelHealth,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:r,desktopEnabled:n,updateVersion:c,connections:m,onRequestPermission:A,onDesktopToggle:se,onStop:T,onStart:I,onShutdown:F,onGenerateOneTimeKey:O,onRegenerateKey:Q,logs:l,version:b,theme:x,onToggleTheme:S,pendingDevice:h,onDeviceApprove:z,onDeviceReject:X,approvedDevices:v,rejectedDevices:B,onDeviceRemove:ae,onFetchDevices:V,onDeviceApproveRejected:ce,autoApprove:y,onAutoApproveToggle:G,autoStart:N,onAutoStartToggle:re})}Mn(a(Tr,{}),document.getElementById("root"));
|
package/dist/ui/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
const savedTheme = localStorage.getItem("9remote-theme") || "dark";
|
|
15
15
|
document.documentElement.setAttribute("data-theme", savedTheme);
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-ByOFWOXH.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-BMHG73CL.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|