(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81572],{59768:function(e,t,s){Promise.resolve().then(s.bind(s,60178))},60178:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return L}});var l=s(57437),a=s(48594),r=s(19449),n=s(59494),i=s(30408),o=s(2265),c=s(18886),d=s(54145),u=e=>{let{from:t,setFrom:s,to:a,setTo:r,theme:n,setTheme:i,adjectives:o,setAdjectives:c,title:u,setTitle:x}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,l.jsxs)("div",{className:"flex  flex-col gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)(d.A,{className:"",label:"Story Title",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Story Title",type:"text",value:u,onChange:e=>x(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"From",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter From",type:"text",value:t,onChange:e=>s(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"To",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter To",type:"text",value:a,onChange:e=>r(e.target.value)})})]}),(0,l.jsxs)("div",{className:"flex  flex-col gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)(d.A,{className:"",label:"Letter Theme",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Theme",type:"text",value:n,onChange:e=>i(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"Receiver's Physical Traits",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Adjectives",type:"text",value:o,onChange:e=>c(e.target.value)})})]})]})})},x=s(94805);let m=(e,t,s)=>Math.min(Math.max(e,t),s),h=[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"},{value:6,label:"6"}];var p=e=>{let{title:t,setTitle:s,prompt:a,setPrompt:r,numPages:n,setNumPages:i}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,l.jsxs)("div",{className:"flex  flex-col gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)(d.A,{className:"",label:"Story Title",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Story Title",type:"text",value:t,onChange:e=>s(e.target.value)})}),i&&(0,l.jsx)(d.A,{className:"px-4",label:"Number of Pages",children:(0,l.jsx)(x.ZP,{id:"storyTitle",getAriaValueText:e=>"".concat(e),"aria-label":"Always visible",defaultValue:1,value:n,step:1,marks:h,max:6,min:1,onChange:e=>i(m(e.target.value,1,6)),style:{color:"#FD7E14"}})})]}),(0,l.jsx)(d.A,{className:"mb-4",label:"Prompt",children:(0,l.jsx)(d.I,{id:"storyPrompt",placeholder:"Enter Prompt",type:"text",value:a,onChange:e=>r(e.target.value)})})]})})},f=e=>{let{from:t,setFrom:s,to:a,setTo:r,theme:n,setTheme:i,adjectives:o,setAdjectives:c,title:u,setTitle:x}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,l.jsxs)("div",{className:"flex  flex-col gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)(d.A,{className:"",label:"Story Title",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Story Title",type:"text",value:u,onChange:e=>x(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"From",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter From",type:"text",value:t,onChange:e=>s(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"To",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter To",type:"text",value:a,onChange:e=>r(e.target.value)})})]}),(0,l.jsxs)("div",{className:"flex  flex-col gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)(d.A,{className:"",label:"Letter Theme",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Theme",type:"text",value:n,onChange:e=>i(e.target.value)})}),(0,l.jsx)(d.A,{className:"",label:"Receiver's Physical Traits",children:(0,l.jsx)(d.I,{id:"storyTitle",placeholder:"Enter Adjectives",type:"text",value:o,onChange:e=>c(e.target.value)})})]})]})})};function g(e){let{storyType:t,title:s,setTitle:a,prompt:r,setPrompt:n,numPages:i,setNumPages:o,to:c,setTo:d,from:x,setFrom:m,adjectives:h,setAdjectives:g,theme:v,setTheme:j}=e;return(0,l.jsxs)(l.Fragment,{children:[1==t&&(0,l.jsx)(p,{title:s,setTitle:a,prompt:r,setPrompt:n,numPages:i,setNumPages:o}),2==t&&(0,l.jsx)(p,{title:s,setTitle:a,prompt:r,setPrompt:n,numPages:1,setNumPages:void 0}),3==t&&(0,l.jsx)(u,{title:s,setTitle:a,to:c,setTo:d,from:x,setFrom:m,adjectives:h,setAdjectives:g,theme:v,setTheme:j}),5==t&&(0,l.jsx)(f,{title:s,setTitle:a,to:c,setTo:d,from:x,setFrom:m,adjectives:h,setAdjectives:g,theme:v,setTheme:j})]})}var v=s(11220),j=s(86189);function y(e){let{isLoading:t,createStory:s,theme:a,prompt:r}=e,n=(0,v.Mu)();return(0,l.jsxs)(l.Fragment,{children:[(null==n?void 0:n.address)&&!t&&(0,l.jsx)("button",{disabled:r.length<5&&a.length<5,className:"button buttonPrimary mb-8 mt-2 px-16 py-5",onClick:s,children:"Create Your Story"}),(null==n?void 0:n.address)&&t&&(0,l.jsx)("button",{disabled:!0,className:"button buttonPrimary mb-8 mt-10  px-16",children:(0,l.jsx)(j.Z,{})}),!(null==n?void 0:n.address)&&(0,l.jsx)("button",{disabled:!0,className:"button buttonPrimary mb-8 mt-10 px-16 py-5",children:"Please Connect to Create a Story"})]})}var b=s(99922),w=s(89671);function N(e){let{setStoryType:t,storyType:s,setModel:a,setStyle:r}=e;return(0,l.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,l.jsx)(b.Z,{title:"Story Type",items:w.Z.storyTypes,selectHandler:t}),5!=s&&(0,l.jsx)("div",{className:"flex w-full flex-wrap gap-4",children:(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(b.Z,{title:"Image AI Model",items:w.Z.models,selectHandler:a})})})]})}var S=s(39750),C=s(16463),T=s(7208),k=s(71640);s(33282);var E=s(26415),I=s(66648),A=function(e){let{path:t,width:s=225,height:a=300}=e;return(0,l.jsx)(E.Z,{highlight:!1,activeOffset:10,rotateTouch:!1,children:(0,l.jsx)("div",{className:"flex flex-row items-end justify-start rounded-[25px] bg-color p-[2px]",children:(0,l.jsx)(I.default,{className:"aspect-[3/4] w-[225px] overflow-hidden rounded-[20px] object-cover mix-blend-normal",src:t,alt:"Example Generation",width:s,height:a})})})},P=e=>{let{model:t=0,style:s=0,storyType:a=0}=e,r=e=>{if(a>4)return"/examples/".concat(a,"_").concat(e,".jpg");let l=t.toString()+s.toString()+e.toString();return"/examples/".concat(l,".jpg")};return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:"Example generations using selected Image AI model and style:"}),(0,l.jsx)("div",{className:"mb-12 flex justify-center",children:(0,l.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-center gap-6",children:[(0,l.jsx)(A,{path:r(1)}),(0,l.jsx)(A,{path:r(2)}),(0,l.jsx)(A,{path:r(3)})]})})]})})},Z=s(90850),F=s(28915),B=s(34309),_=s(96441),M=e=>{let{onClose:t,setSkipModal:s}=e,[a,r]=(0,o.useState)(!1),[n,i]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{s(n)},[n]),(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"font-font relative mt-16 box-border flex max-h-full w-[841px] max-w-full flex-col items-center justify-start gap-[21px] overflow-hidden rounded-[7.42px] bg-white/10 p-2.5 pt-12 text-left text-sm text-neutral-9o [backdrop-filter:blur(29.69px)] sm:p-10 sm:text-base",children:[(0,l.jsxs)("div",{className:"self-stretch text-left text-xs leading-[160%] sm:text-base",children:["Please ensure that the title and prompt you enter meet the following criteria:",(0,l.jsxs)("ul",{className:" ml-6 list-disc",children:[(0,l.jsx)("li",{children:"Check for typos, as AI may misinterpret your intended message."}),(0,l.jsx)("li",{children:"Your title and prompt should provide sufficient context or details to facilitate the creation of a story."}),(0,l.jsx)("li",{children:"Ensure that your prompt does not contain language or content that may offend individuals based on race, religion, ethnicity, or sex."}),(0,l.jsx)("li",{children:"Do not include any content that may infringe upon copyrights or licenses."})]}),(0,l.jsx)("b",{children:"Refund Policy:"})," Multiple AI models will review your submission. StoryChain may reject prompts that do not meet criteria. Refunds (excluding system costs) will be issued for rejected prompts."]}),(0,l.jsxs)("div",{className:"flex flex-row items-center justify-end self-stretch text-sm",children:[(0,l.jsx)("input",{className:"flex cursor-pointer flex-row items-start justify-start p-2",type:"checkbox",checked:n,onChange:()=>i(e=>!e)}),(0,l.jsx)("div",{className:"text-silver relative leading-[160%]",children:"Do not show this again"})]}),!a&&(0,l.jsx)("button",{className:"button absolute right-[6px] top-[6px] z-[5] my-0 flex size-10 shrink-0 cursor-pointer flex-row items-center justify-center overflow-hidden rounded-xl bg-transparent p-0 text-lg text-brand-button [border:none]",onClick:t,children:(0,l.jsx)("img",{src:"/icons/x-symbol.svg",className:"m-auto size-4",alt:""})})]})})},R=s(42126),L=()=>{let[e,t]=(0,o.useState)(w.Z.styles[0].id),[s,d]=(0,o.useState)(w.Z.models[0].id),u=(0,C.useRouter)(),[x,m]=(0,o.useState)(""),[h,p]=(0,o.useState)(""),[f,j]=(0,o.useState)(1),[b,E]=(0,o.useState)(w.Z.storyTypes[0].id),[I,A]=(0,o.useState)(),[L,z]=(0,o.useState)(),[O,H]=(0,o.useState)(),[D,U]=(0,o.useState)(),[W,Y]=(0,o.useState)(""),q=(0,v.Mu)(),[J,V]=(0,o.useState)(!1),[G,Q]=(0,o.useState)(!1),[K,X]=(0,o.useState)(!1),[$,ee]=(0,o.useState)(!1),[et,es]=(0,o.useState)(),[el,ea]=(0,o.useState)(),[er,en]=(0,o.useState)({open:!1,message:"",severity:""}),{contract:ei}=(0,_.Z)(),{mutateAsync:eo,data:ec}=(0,F.Q)(),{data:ed,error:eu}=(0,B.u)({contract:ei,method:"getFee"});(0,o.useEffect)(()=>{ex()},[]),(0,o.useEffect)(()=>{let e=async()=>{let e=await R.Z.get("".concat("https://api2.storychain.ai","/characters?address=").concat(null==q?void 0:q.address),{headers:{"Content-Type":"application/json"}});es(e.data),ea(e.data[0])};$&&e()},[$]),(0,o.useEffect)(()=>{ed&&z((0,S.d)(ed))},[ed]);let ex=()=>{"true"==localStorage.getItem("skipStoryModal")&&V(!0),Q(!1)};(0,o.useEffect)(()=>{6===b?ee(!0):ee(!1)},[b]);let em=async()=>{let t;if(!J)return Q(!0);let l=b;if(1==b&&1==f&&(l=2),3==l){if(W.length<5)return;let e={storyType:l,imageAIid:s.toString()};O&&(e.to=O),I&&(e.from=I),W&&(e.theme=W),D&&(e.adjectives=D),t=JSON.stringify(e)}else{let e={prompt:x,storyType:l,imageAIid:s.toString()};if(el&&(e.character=null==el?void 0:el._id),t=JSON.stringify(e),x.length<5)return}let a=new r.Z(null==ed?void 0:ed.toString()).multipliedBy(f).toString();n.ZP.event({category:"Create Story",action:null==q?void 0:q.address,label:t}),X(!0);try{en({open:!0,severity:"success",message:"Waiting for transaction confirmation"});let r=(0,i.A)({contract:ei,method:"function createStory(address token, string prompt, string title, uint64 storyType, uint64 imageAIid, uint64 imageStyleId, uint64 numPages)",params:["0x0000000000000000000000000000000000000000",t,h,l,s.toString(),e.toString(),1==b?f:1],value:a});await eo(r),u.push("/my-stories")}catch(e){e.message,en({open:!0,severity:"error",message:e.message.includes("exceeds the balance of the account")?"Not enough balance to create story":e.message.includes("rejected the request")?"User rejected the request":e.message.includes("rejected transaction")?"User rejected transaction":"User request failed"})}X(!1)};return(0,l.jsxs)("main",{className:"mt-32 flex min-h-screen w-full flex-col items-center px-4",children:[G&&(0,l.jsx)(Z.Z,{overlayColor:"rgba(0, 0, 0, 0.8)",placement:"Centered",onOutsideClick:ex,children:(0,l.jsx)(M,{onClose:ex,setSkipModal:e=>{localStorage.setItem("skipStoryModal",e),e&&V(!0)}})}),(0,l.jsx)(T.Z,{open:er.open,autoHideDuration:6e3,onClose:()=>en({...er,open:!1}),anchorOrigin:{vertical:"top",horizontal:"right"},children:(0,l.jsx)(k.Z,{onClose:()=>en({...er,open:!1}),severity:er.severity,variant:"filled",sx:{width:"100%"},children:er.message})}),(0,l.jsxs)("div",{className:"flex w-full max-w-3xl flex-col items-center justify-center gap-8",children:[(0,l.jsx)(N,{setStoryType:E,storyType:b,setModel:d,setStyle:t}),3!==b&&5!==b&&(0,l.jsxs)("div",{className:"w-full pl-8",children:[(0,l.jsx)(c.Z,{label:"Use Character",handleState:ee,currentState:$,disabled:6===b,className:"mb-8"}),$&&(0,l.jsx)(a.r,{characters:et,selectedCharacter:el,handleSelectCharacter:e=>{ea(e)}})]}),(0,l.jsx)(g,{storyType:b,title:h,setTitle:p,prompt:x,setPrompt:m,numPages:f,setNumPages:j,to:O,setTo:H,from:I,setFrom:A,adjectives:D,setAdjectives:U,theme:W,setTheme:Y}),(0,l.jsxs)("div",{className:"flex  w-full flex-col justify-between gap-8 md:flex-row md:gap-4",children:[(0,l.jsx)("a",{href:"https://storychain.medium.com/mastering-storychain-prompts-tips-for-crafting-compelling-stories-9ad7576cff1f",target:"_blank",className:" ml-8 self-start underline",children:"How to write a better prompt?"}),1===b&&(0,l.jsxs)("div",{className:"mr-8 self-end font-semibold",children:[f>1&&"Total ","Fee: ",(L*f).toFixed(2)," tBNB"]}),1!==b&&(0,l.jsxs)("div",{className:"mr-8 self-end font-semibold",children:["Fee: ",L," tBNB"]})]}),(0,l.jsx)(y,{isLoading:K,createStory:em,theme:W,prompt:x}),!$&&(0,l.jsx)(P,{model:s,style:e,storyType:b})]})]})}},54145:function(e,t,s){"use strict";s.d(t,{I:function(){return h},A:function(){return m}});var l=s(48646),a=s(57437),r=s(2265),n=s(53637),i=s(45282),o=s(82836),c=s(84924),d=s(38364);let u=r.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(d.f,{ref:t,className:(0,n.cn)("text-white leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...l})});function x(){let e=(0,l._)(["\n        radial-gradient(\n          "," circle at ","px ","px,\n          var(--orange-500),\n          transparent 80%\n        )\n      "]);return x=function(){return e},e}u.displayName=d.f.displayName;let m=e=>{let{label:t,children:s,className:l}=e;return(0,a.jsxs)("div",{className:(0,n.cn)("flex flex-col space-y-2 w-full",l),children:[(0,a.jsx)(u,{children:t}),s]})},h=r.forwardRef((e,t)=>{let{className:s,type:l,...d}=e,[u,m]=r.useState(!1),h=(0,i.c)(0),p=(0,i.c)(0);return(0,a.jsx)(o.E.div,{style:{background:(0,c.Y)(x(),u?"200px":"0px",h,p)},onMouseMove:function(e){let{currentTarget:t,clientX:s,clientY:l}=e,{left:a,top:r}=t.getBoundingClientRect();h.set(s-a),p.set(l-r)},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:"group/input rounded-full p-[3px] transition duration-300",children:(0,a.jsx)("input",{type:l,className:(0,n.cn)("border border-gray-200 flex h-10 w-full bg-zinc-800 text-white rounded-full px-8 py-4 file:border-0 file:bg-transparent \n          file:text-sm file:font-medium placeholder:text-neutral-600 \n          focus-visible:outline-none focus-visible:ring-[2px]  focus-visible:ring-neutral-600\n           disabled:cursor-not-allowed disabled:opacity-50\n           shadow-[0px_0px_1px_1px_var(--neutral-700)]\n           group-hover/input:shadow-none transition duration-400\n           ",s),ref:t,...d})})});h.displayName="Input"},99922:function(e,t,s){"use strict";var l=s(57437),a=s(2265),r=s(66648);t.Z=e=>{let{title:t,items:s,selectHandler:n,defaultSelection:i=null,className:o=""}=e,[c,d]=(0,a.useState)(!1),[u,x]=(0,a.useState)(i||s[0].id),m=(0,a.useRef)(null),h=e=>{m.current&&!m.current.contains(e.target)&&d(!1)};(0,a.useEffect)(()=>{null!=i&&i!==u&&x(i)},[i]),(0,a.useEffect)(()=>(document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}),[]);let p=e=>{d(!1),n(e),x(e)};return t.length>20&&t.substring(0,20),(0,l.jsxs)("div",{className:"dropdown relative min-w-56 ".concat(o),ref:m,children:[(0,l.jsx)("button",{className:"button buttonSecondary w-full px-3 py-4 text-[16px] sm:px-6",onClick:()=>d(!c),children:(0,l.jsxs)("span",{className:"flex items-center justify-between gap-1",children:[(0,l.jsxs)("span",{children:[t,": ",s.find(e=>e.id==u).title]}),c?(0,l.jsx)(r.default,{width:12,height:12,src:"/icons/down-chevron.svg",className:"rotate-180",alt:""}):(0,l.jsx)(r.default,{width:12,height:12,src:"/icons/down-chevron.svg",alt:""})]})}),c&&(0,l.jsx)("div",{className:"dropdown-menu buttonSecondary absolute left-0 z-50 mt-1 w-60 max-w-[50vw] overflow-hidden rounded-3xl rounded-bl-md bg-black/65 py-2 pr-2 backdrop-blur-lg duration-300",children:(0,l.jsx)("div",{className:"max-h-48 w-full overflow-y-auto",children:s.filter(e=>!e.hideOption).map(e=>(0,l.jsx)("div",{href:"#",className:"block cursor-pointer px-6 py-2 text-sm transition-colors duration-200 ease-in-out hover:bg-white/20 hover:bg-opacity-10",onClick:()=>{p(e.id)},children:(0,l.jsx)("span",{className:e.id===u?"text-brand-button":"",children:e.title})},e.id))})})]})}},86189:function(e,t,s){"use strict";var l=s(57437);s(2265),t.Z=function(e){let{className:t=""}=e;return(0,l.jsx)("span",{className:"loader "+t})}},18886:function(e,t,s){"use strict";var l=s(57437),a=s(2265);t.Z=e=>{let{label:t,handleState:s,currentState:r=null,disabled:n=!1,className:i=""}=e,[o,c]=(0,a.useState)(!1),d=()=>{c(!o),s(!o)};return(0,a.useEffect)(()=>{null!==r&&o!==r&&c(r)},[r]),(0,l.jsxs)("div",{className:"flex items-center justify-start "+(n?" opacity-50 pointer-events-none ":"")+i,children:[(0,l.jsx)("div",{className:"buttonSecondary relative inline-block h-8 w-14 rounded-3xl align-top transition duration-200 ease-linear ".concat(o?"bg-white":"bg-white/60"),role:"button",tabIndex:0,onClick:d,children:(0,l.jsx)("span",{className:"buttonSecondary inline-block size-10 -translate-y-1 cursor-pointer rounded-full shadow-md transition duration-100 ease-linear ".concat(o?"translate-x-6 bg-brand-button":"-translate-x-3 bg-brand-toggleSwitch ")})}),(0,l.jsx)("span",{className:"ml-6 cursor-pointer select-none text-white",onClick:d,children:t})]})}},48594:function(e,t,s){"use strict";s.d(t,{r:function(){return r}});var l=s(57437);s(2265),s(18886);var a=s(66648);function r(e){let{characters:t,selectedCharacter:s,handleSelectCharacter:r}=e;return(0,l.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsx)("h2",{className:"text-lg font-semibold sm:text-xl",children:"Choose Your Character"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)("div",{className:"flex h-fit w-full items-center gap-2 overflow-auto",children:t?t.map((e,t)=>(0,l.jsx)("div",{className:"overflow-hidden min-w-[100px] h-[100px] box-content "+(s&&s._id===e._id?"border-2 border-brand-button":""),children:(0,l.jsx)(a.default,{src:"".concat(e.regularPortrait,"?img-width=256"),alt:e.name,width:100,height:100,className:" cursor-pointer transition-transform duration-300 ease-in-out hover:scale-105",onClick:()=>{r(e)}})},t)):[,,,,,].fill(0).map((e,t)=>(0,l.jsx)("div",{className:"box-content h-[100px] min-w-[100px] animate-pulse overflow-hidden bg-[#27272A]"},t))}),(0,l.jsx)("div",{className:"flex-1",children:s&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("h2",{className:"text-lg sm:text-xl",children:[(0,l.jsx)("span",{className:"font-semibold ",children:"Character Name: "}),s.name]}),s.forceBackground&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:"Stories about this character will consider their background to keep the narrative consistent and believable."}),(0,l.jsxs)("p",{className:"",children:[(0,l.jsxs)("span",{className:"text-lg font-semibold sm:text-xl",children:["Character Background:"," "]}),s.characterBackground]})]})]})})]})]})}},90850:function(e,t,s){"use strict";var l=s(57437),a=s(2265),r=s(54887);let n=e=>{let{children:t,containerId:s="portals"}=e,l=document.getElementById(s);return l||((l=document.createElement("div")).setAttribute("id",s),document.body.appendChild(l)),(0,r.createPortal)(t,l)};t.Z=e=>{let{children:t,overlayColor:s,placement:r="Centered",onOutsideClick:i,zIndex:o=100,left:c=0,right:d=0,top:u=0,bottom:x=0,relativeLayerRef:m,pos:h="fixed"}=e,p=(0,a.useRef)(null),[f,g]=(0,a.useState)({opacity:0}),v=(0,a.useMemo)(()=>{let e={};if(e.zIndex=o,s&&(e.backgroundColor=s),!(null==m?void 0:m.current))switch(r){case"Centered":e.alignItems="center",e.justifyContent="center";break;case"Top left":e.alignItems="flex-start";break;case"Top center":e.alignItems="center";break;case"Top right":e.alignItems="flex-end";break;case"Bottom left":e.alignItems="flex-start",e.justifyContent="flex-end";break;case"Bottom center":e.alignItems="center",e.justifyContent="flex-end";break;case"Bottom right":e.alignItems="flex-end",e.justifyContent="flex-end"}return e.opacity=1,e},[r,s,o,m]),j=(0,a.useCallback)(()=>{var e,t;let s=null==m?void 0:null===(e=m.current)||void 0===e?void 0:e.getBoundingClientRect(),l=null==p?void 0:null===(t=p.current)||void 0===t?void 0:t.getBoundingClientRect(),a={opacity:1};if(s&&l){let{x:e,y:t,width:n,height:i}=s,{width:o,height:m}=l;switch(a.position="absolute",r){case"Top left":a.top=t-m-u,a.left=e+c;break;case"Top right":a.top=t-m-u,a.left=e+n-o-d;break;case"Bottom left":a.top=t+i+x,a.left=e+c;break;case"Bottom right":a.top=t+i+x,a.left=e+n-o-d}g(a)}else a.maxWidth="90%",a.maxHeight="90%",g(a)},[c,d,u,x,r,m,p]);(0,a.useEffect)(()=>(j(),window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}),[j]);let y=(0,a.useCallback)(e=>{i&&e.target.classList.contains("portalPopupOverlay")&&i(),e.stopPropagation()},[i]);return(0,l.jsx)(n,{children:(0,l.jsx)("div",{className:h+" flex flex-col inset-0 portalPopupOverlay",style:v,onClick:y,children:(0,l.jsx)("div",{ref:p,style:f,children:t})})})}},26415:function(e,t,s){"use strict";var l=s(57437),a=s(2265),r=s(4724),n=s(32804);let i=a.forwardRef(function(e,t){let{children:s,...a}=e;return(0,n.Z)("(max-width:768px)")?(0,l.jsx)("div",{className:e.className,onClick:e.onClick,children:s}):(0,l.jsx)(r.Z,{ref:t,...a,children:s})});i.displayName="AtroposWrapper",t.Z=i},53637:function(e,t,s){"use strict";s.d(t,{cn:function(){return r}});var l=s(44839),a=s(96164);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.m6)((0,l.W)(t))}}},function(e){e.O(0,[94969,9109,38173,42126,32573,14868,31176,3511,36579,60411,58207,51180,27353,96441,92971,47023,1744],function(){return e(e.s=59768)}),_N_E=e.O()}]);