index-73536709.js (20299B)
1 var L=Object.defineProperty;var R=(n,t,s)=>t in n?L(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var h=(n,t,s)=>(R(n,typeof t!="symbol"?t+"":t,s),s);import{r as x,u as _,j as e,L as j,B as O,P as U,l,a,M,b as z,R as Y,c as S,O as F,o as W,d as q,i as V,e as X,f as G,g as $,h as J,k as K,m as Q}from"./vendor-10daaadc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function s(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(i){if(i.ep)return;i.ep=!0;const r=s(i);fetch(i.href,r)}})();const Z="modulepreload",ee=function(n){return"/pr-281/"+n},T={},E=function(t,s,o){if(!s||s.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(s.map(r=>{if(r=ee(r),r in T)return;T[r]=!0;const c=r.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!o)for(let u=i.length-1;u>=0;u--){const p=i[u];if(p.href===r&&(!c||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${d}`))return;const m=document.createElement("link");if(m.rel=c?"stylesheet":Z,c||(m.as="script",m.crossOrigin=""),m.href=r,document.head.appendChild(m),c)return new Promise((u,p)=>{m.addEventListener("load",u),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},H=x.createContext(void 0),te="/pr-281/assets/Logo_colored-d78b4c05.svg";function P(){const n=x.useContext(H),{t}=_();return e.jsxs("div",{className:"m-12 flex flex-col lg:flex-row items-center justify-between",children:[e.jsx(j,{to:"/",children:e.jsx("img",{alt:"Matrix Art",src:te})}),e.jsxs("div",{className:"flex items-center mt-8 lg:mt-0 flex-col sm:flex-row",children:[e.jsxs("div",{className:"flex items-center lg:justify-between w-80 max-w-80 mx-6 ease-in-out hover:scale-105 transform transition-transform duration-300",children:[e.jsx("div",{className:"absolute ml-4",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[e.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]})}),e.jsx("input",{className:"search-bg shadow rounded-2xl border-0 py-3 px-4 pl-12 text-data",placeholder:t("Search")})]}),n!=null&&n.isLoggedIn()?e.jsx(j,{to:"/",className:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:t("Post")}):e.jsx(j,{to:"/join",className:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:t("Join")})]})]})}function ie(n){let t="pending",s;const o=n().then(i=>{t="success",s=i},i=>{t="error",s=i});return{read(){switch(t){case"pending":throw o;case"error":throw s;case"success":return s}}}}const A=new Map;function se(n){let t=A.get(n);return t||(t=ie(()=>new Promise((s,o)=>{const i=new window.Image;i.src=n,i.addEventListener("load",()=>s(n)),i.addEventListener("error",()=>o(new Error(`Failed to load image ${n}`)))})),A.set(n,t),t)}function re(n){return se(n.src).read(),e.jsx("img",{...n})}function f({user:n,post:t}){return e.jsx(x.Suspense,{fallback:e.jsx("div",{className:"flex flex-col w-full",children:e.jsx(O,{color:"#FEA500"})}),children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx(j,{"aria-label":`Open post by ${n.display_name}`,to:`/post/${t.event_id}`,className:"w-full",children:e.jsx(re,{className:"rounded-3xl shadow object-cover transform transition-transform ease-in-out duration-300 hover:scale-105",src:t.content.file.url})}),e.jsxs("div",{className:"flex items-center justify-between py-4",children:[e.jsxs(j,{className:"flex items-center",to:`/profile/${n.mxid}`,children:[e.jsx("img",{className:"w-11 h-11 rounded-full mr-4 border-2 border-[#AAB3CF] hover:border-indigo-300 ease-in-out duration-150",src:n.avatar_url}),e.jsx("p",{className:"text-data text-lg font-medium",children:n.display_name})]}),e.jsxs("div",{className:"flex text-data text-lg items-center",children:[e.jsxs("a",{className:"mr-4 flex items-center",href:"#",children:[e.jsx("span",{className:"mr-2 hover:fill-red-600 fill-[#AAB3CF] ease-in-out duration-150",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",children:[e.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e.jsx("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"})]})}),e.jsx("span",{children:"5"})]}),e.jsxs("a",{className:"flex items-center",href:"#",children:[e.jsx("span",{className:"mr-2 fill-[#AAB3CF] ease-in-out duration-150 hover:fill-orange-400",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",children:[e.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"})]})}),e.jsx("span",{children:"11"})]})]})]})]})})}class g{constructor(t,s,o){h(this,"mxid");h(this,"display_name");h(this,"avatar_url");this.mxid=t,this.display_name=s,this.avatar_url=o}}class y{constructor(t,s){h(this,"event_id");h(this,"content");this.event_id=t,this.content=s}}const ne=[{size:500,columns:1},{size:800,columns:2},{size:1400,columns:3},{size:1401,columns:4}];function oe(){const{t:n}=_();return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("header",{children:e.jsx(P,{})}),e.jsxs("main",{className:"m-12 mt-6",children:[e.jsx("h1",{className:"text-3xl font-bold mb-4 text-white",children:n("Explore")}),e.jsx("div",{className:"flex justify-center",id:"gallery",children:e.jsxs(U,{gap:"24px",breakpoints:ne,children:[e.jsx(f,{user:new g("a","Person A","https://images.unsplash.com/photo-1519699047748-de8e457a634e?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3NzYyNA&ixlib=rb-4.0.3&q=80&w=922"),post:new y("a",{file:{url:"https://images.unsplash.com/photo-1648773009733-1eab564f3330?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3Nzk0MA&ixlib=rb-4.0.3&q=80&w=614"}})}),e.jsx(f,{user:new g("b","Person B","https://images.unsplash.com/photo-1485893086445-ed75865251e0?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=80&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3Nzc2Ng&ixlib=rb-4.0.3&q=80&w=80"),post:new y("b",{file:{url:"https://images.unsplash.com/photo-1648775933902-f633de370964?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODE1OQ&ixlib=rb-4.0.3&q=80&w=1383"}})}),e.jsx(f,{user:new g("c","Person C","https://images.unsplash.com/photo-1584997159889-8bb96d0a2217?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=80&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODAxNw&ixlib=rb-4.0.3&q=80&w=80"),post:new y("c",{file:{url:"https://images.unsplash.com/photo-1648793633175-f3635585014b?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODIwNA&ixlib=rb-4.0.3&q=80&w=614"}})}),e.jsx(f,{user:new g("d","Person D","https://images.unsplash.com/photo-1543123820-ac4a5f77da38?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=80&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODA0Ng&ixlib=rb-4.0.3&q=80&w=80"),post:new y("d",{file:{url:"https://images.unsplash.com/photo-1648775170273-dcbe48fb12a0?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODI1Ng&ixlib=rb-4.0.3&q=80&w=1229"}})}),e.jsx(f,{user:new g("e","Person E","https://images.unsplash.com/photo-1595687825617-10c4d36566e7?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=80&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODA3Mw&ixlib=rb-4.0.3&q=80&w=80"),post:new y("e",{file:{url:"https://images.unsplash.com/photo-1648769244858-6e20b5999a6b?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=922&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODI5Nw&ixlib=rb-4.0.3&q=80&w=651"}})}),e.jsx(f,{user:new g("f","Person E","https://images.unsplash.com/photo-1609010586352-ce4e725aa565?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=80&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODA5Mg&ixlib=rb-4.0.3&q=80&w=80"),post:new y("f",{file:{url:"https://images.unsplash.com/photo-1648750690732-f6eb85984ff8?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=921&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY3Mjc3ODM1NQ&ixlib=rb-4.0.3&q=80&w=614"}})})]})})]})]})}const b=new l.UnstableValue("m.image","org.matrix.msc1767.image"),B=new l.UnstableValue("m.file","org.matrix.msc1767.file"),C=new l.UnstableValue("m.thumbnail","org.matrix.msc1767.thumbnail"),N=new l.UnstableValue("blurhash","xyz.amorgan.blurhash"),ae=new l.NamespacedValue("matrixart.description"),le=new l.NamespacedValue("matrixart.tags"),ce=new l.NamespacedValue("matrixart.nsfw"),de=new l.NamespacedValue("matrixart.license");class me extends l.ExtensibleEvent{constructor(s){super(s);h(this,"image");h(this,"text");h(this,"thumbnails");h(this,"blurhash");h(this,"file");h(this,"description");h(this,"tags");h(this,"nsfw",!1);h(this,"license");const o=b.findIn(this.wireContent),i=l.M_TEXT.findIn(this.wireContent),r=B.findIn(this.wireContent),c=C.findIn(this.wireContent),d=N.findIn(this.wireContent),w=ae.findIn(this.wireContent),m=le.findIn(this.wireContent),u=ce.findIn(this.wireContent),p=de.findIn(this.wireContent);if(l.isProvided(o)){if(!o)throw new l.InvalidEventError("m.image is required to be present");this.image=o}if(l.isProvided(r)){if(!r)throw new l.InvalidEventError("m.file is required to be present");this.file=r}if(l.isOptionalAString(i)){if(!o)throw new l.InvalidEventError("m.text is required to be present");this.text=i}if(l.isProvided(c)){if(!Array.isArray(c))throw new l.InvalidEventError("m.thumbnail contents must be an array");this.thumbnails=c}if(l.isOptionalAString(d)&&(this.blurhash=d),l.isOptionalAString(w)&&(this.description=w),l.isProvided(m)){if(!Array.isArray(m))throw new l.InvalidEventError("matrixart.tags contents must be an array");this.tags=m}if(l.isProvided(u)){if(typeof u!="boolean")throw new l.InvalidEventError("matrixart.tags contents must be an boolean");this.nsfw=u}l.isOptionalAString(p)&&(this.license=p)}isEquivalentTo(s){return l.isEventTypeSame(s,b)}serialize(){return{type:"m.image",content:{[l.M_TEXT.name]:this.text,[B.name]:this.file,[b.name]:this.image,[C.name]:this.thumbnails,[N.name]:this.blurhash,["matrixart.description"]:this.description,["matrixart.tags"]:this.tags,["matrixart.nsfw"]:this.nsfw,["matrixart.license"]:this.license}}}}function he(n){const t=n;return new me(t)}l.ExtensibleEvents.registerInterpreter(b,he);l.ExtensibleEvents.unknownInterpretOrder.push(b);function v(){return new Worker("/pr-281/assets/indexeddb.worker-d9606cee.js")}class D{constructor(t){h(this,"events",[]);h(this,"currentUserDirectory");h(this,"rootDirectory");this.client=t}static async new(){global.Olm||console.error("global.Olm does not seem to be present. Did you forget to add olm in the out directory?");let t;if(window.localStorage.getItem("server")!==null?t=window.localStorage.getItem("server"):t="https://matrix.art.midnightthoughts.space",!t)throw new Error("No matrix server URL defined");let s;if(window.localStorage.getItem("mxid_guest")!==null){const i=window.localStorage.getItem("mxid_guest")??void 0,r=window.localStorage.getItem("access_token_guest")??void 0,c=window.localStorage.getItem("device_id_guest")??void 0;s=a.createClient({useAuthorizationHeader:!0,baseUrl:t,userId:i,accessToken:r,deviceId:c,store:new a.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new v}),cryptoStore:new a.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),s.setGuest(!0)}{const i=a.createClient({baseUrl:"https://matrix.art.midnightthoughts.space"}),{user_id:r,device_id:c,access_token:d}=await i.registerGuest();s=a.createClient({useAuthorizationHeader:!0,baseUrl:t,userId:r,accessToken:d,deviceId:c,store:new a.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new v}),cryptoStore:new a.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),s.setGuest(!0),window.localStorage.setItem("mxid_guest",r),window.localStorage.setItem("access_token_guest",d),window.localStorage.setItem("device_id_guest",c),window.localStorage.setItem("server",t)}let o;if(window.localStorage.getItem("mxid")!==null){const i=window.localStorage.getItem("mxid")??void 0,r=window.localStorage.getItem("access_token")??void 0,c=window.localStorage.getItem("device_id")??void 0;o=a.createClient({useAuthorizationHeader:!0,baseUrl:t,userId:i,accessToken:r,deviceId:c,store:new a.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new v}),cryptoStore:new a.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),o.setGuest(!1)}return new D(o??s)}isLoggedIn(){return this.client.isLoggedIn()&&!this.client.isGuest()}async start(){this.client.on(a.MatrixEventEvent.Decrypted,(s,o)=>{const i=s.unstableExtensibleEvent;i!=null&&i.isEquivalentTo(b)&&this.events.push(s)}),console.log("start"),await this.client.store.startup(),await this.client.initCrypto(),await this.client.startClient();const t=await this.client.joinRoom("");await k(1e3),this.rootDirectory=new M.MSC3089TreeSpace(this.client,t.roomId),console.log("started")}async register(t="https://matrix.art.midnightthoughts.space",s,o,i=!1){var r,c;if(this.client.stopClient(),this.client=a.createClient({useAuthorizationHeader:!0,baseUrl:t,userId:s,deviceId:"Matrix Art",store:new a.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new v}),cryptoStore:new a.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.register(s,o,null,{type:"m.login.dummy"}),window.localStorage.setItem("server",t),window.localStorage.setItem("mxid",s),window.localStorage.setItem("access_token",this.client.getAccessToken()??"unknown"),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),i){const d=(r=this.rootDirectory)==null?void 0:r.getDirectories(),w=(c=this.client.getUserId())==null?void 0:c.replace(":","_");d!=null&&d.some(m=>m.room.name===w)?this.rootDirectory=d==null?void 0:d.find(m=>m.room.name===w):await this.createProfileFolder()}}async login(t,s,o,i=!1){var r,c;if(this.client.stopClient(),this.client=a.createClient({useAuthorizationHeader:!0,baseUrl:t,userId:s,deviceId:"Matrix Art",store:new a.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new v}),cryptoStore:new a.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.loginWithPassword(s,o),window.localStorage.setItem("server",t),window.localStorage.setItem("mxid",s),window.localStorage.setItem("access_token",this.client.getAccessToken()??"unknown"),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),i){const d=(r=this.rootDirectory)==null?void 0:r.getDirectories();console.log(d);const w=(c=this.client.getUserId())==null?void 0:c.replace(":","_");d!=null&&d.some(m=>m.room.name===w)?this.rootDirectory=d==null?void 0:d.find(m=>m.room.name===w):await this.createProfileFolder()}}async createProfileFolder(){var o;if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const t=await this.client.joinRoom("");await k(1e3),this.rootDirectory=new M.MSC3089TreeSpace(this.client,t.roomId);const s=(o=this.client.getUserId())==null?void 0:o.replace(":","_");this.currentUserDirectory=await this.createPublicSubDirectory(this.rootDirectory,s??"unknown"),await this.createPublicSubDirectory(this.currentUserDirectory,"Timeline")}async createPublicFileTree(t){var r;if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const{room_id:s}=await this.client.createRoom({name:t,preset:a.Preset.PublicChat,power_level_content_override:{...M.DEFAULT_TREE_POWER_LEVELS_TEMPLATE,users:{["@administrator:art.midnightthoughts.space"]:100,[this.client.getUserId()??"broken"]:100}},invite:["@administrator:art.midnightthoughts.space"],creation_content:{[a.RoomCreateTypeField]:a.RoomType.Space},initial_state:[{type:a.UNSTABLE_MSC3088_PURPOSE.name,state_key:a.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[a.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:a.EventType.RoomEncryption,state_key:"",content:{algorithm:z}},{type:a.EventType.RoomGuestAccess,state_key:"",content:{guest_access:"can_join"}},{type:a.EventType.RoomHistoryVisibility,state_key:"",content:{history_visibility:"world_readable"}}]}),o=this.client.getRoom(s),i=(r=o==null?void 0:o.getLiveTimeline().getState(a.EventTimeline.FORWARDS))==null?void 0:r.getStateEvents(a.EventType.RoomPowerLevels,"");if(!i)throw new Error("Failed to find PL event");return await this.client.setPowerLevel(s,this.client.getUserId()??"unknown",50,i),new M.MSC3089TreeSpace(this.client,s)}async createPublicSubDirectory(t,s){const o=await this.createPublicFileTree(s);return await this.client.sendStateEvent(t.roomId,a.EventType.SpaceChild,{via:[this.client.getDomain()]},o.roomId),await this.client.sendStateEvent(o.roomId,a.EventType.SpaceParent,{via:[this.client.getDomain()]},t.roomId),o}}function k(n){return new Promise(t=>setTimeout(t,n))}const xe=x.lazy(()=>E(()=>import("./Join-77493242.js"),["assets/Join-77493242.js","assets/vendor-10daaadc.js"])),we=x.lazy(()=>E(()=>import("./Post-e85a1e0b.js"),["assets/Post-e85a1e0b.js","assets/vendor-10daaadc.js"])),ue=x.lazy(()=>E(()=>import("./Profile-531b2f45.js"),["assets/Profile-531b2f45.js","assets/vendor-10daaadc.js"]));function pe(){const[n,t]=x.useState(void 0),s=()=>F.init({locateFile:()=>W}).then(()=>{console.log("Using WebAssembly Olm")}).catch(i=>(console.log("Failed to load Olm: trying legacy version",i),new Promise((r,c)=>{const d=document.createElement("script");d.src=q,d.onload=r,d.onerror=c,document.body.appendChild(d)}).then(()=>window.Olm.init()).then(()=>{console.log("Using legacy Olm")}).catch(r=>{console.log("Both WebAssembly and asm.js Olm failed!",r)}))),o=async()=>{let i=await D.new();t(i),console.log("Client loaded"),await(i==null?void 0:i.start()),console.log("Client started")};return x.useEffect(()=>{async function i(){try{await s(),console.log("Olm loaded")}catch{console.log("Olm not loaded")}await o()}n==null&&i()},[]),e.jsx(H.Provider,{value:n,children:e.jsxs(Y,{children:[e.jsx(S,{path:"/",element:e.jsx(oe,{})}),e.jsx(S,{path:"join",element:e.jsx(x.Suspense,{fallback:e.jsx(I,{}),children:e.jsx(xe,{})})}),e.jsx(S,{path:"/post/:postId",element:e.jsx(x.Suspense,{fallback:e.jsx(I,{}),children:e.jsx(we,{})})}),e.jsx(S,{path:"/profile/:userId",element:e.jsx(x.Suspense,{fallback:e.jsx(I,{}),children:e.jsx(ue,{})})})]})})}function I(){const{t:n}=_();return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("header",{children:e.jsx(P,{})}),e.jsx("main",{className:"m-12 mt-6 flex items-center justify-center",children:e.jsx("p",{className:"text-lg text-data font-bold",children:n("Loading…")})})]})}V.use(X).use(G).use($).init({fallbackLng:"en",debug:!0,interpolation:{escapeValue:!1}});J.createRoot(document.querySelector("#app")).render(e.jsx(K.StrictMode,{children:e.jsx(Q,{basename:"/pr-281/",children:e.jsx(pe,{})})}));export{H as C,P as H};