1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3609],{355:(e,s,t)=>{"use strict";t.d(s,{P:()=>n});var a=t(60150),l=t(5814),r=t(15398);let n=(0,a.vt)()((e,s)=>({tags:[],fetchTags:async()=>{let s=r.Y.getState().currentSite;if(!s)return[];let t=await (0,l.Q2)(s.id);t.success&&t.data&&e({tags:t.data})}}))},1345:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>eh});var a=t(95155),l=t(97067),r=t(96253);t(51686);var n=t(60629),i=t(12115),d=t(90080),o=t.n(d),c=t(6468),u=t.n(c),m=t(12221),x=t(39105),h=t(9643),g=t(61003),p=t(33889),f=t(29383),j=t(84173),b=t(19941),v=t(14647),w=t(93345),N=t(7785),y=t(92336),C=t(948),_=t(75261),k=t(73273),A=t(7409),S=t(14761),z=t(65797),L=t(8159),I=t(79567),T=t(66609),D=t(5458);class R extends I.zS{createNodeSpec(e,s){let{preferPastedTextContent:t}=this.options;return{inline:!0,draggable:!0,selectable:!1,...s,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},style:{default:"max-width: 100%"},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:s=>{if((0,L.hm)(s)){let a=function({element:e,parse:s}){let t,a,{width:l}=(t=e.getAttribute("width")||"",a=e.getAttribute("height")||"",e.style.width.endsWith("px")&&(t=e.style.width),e.style.height.endsWith("px")&&(a=e.style.height),{width:t,height:a});return{...s(e),style:"max-width: 100%;",alt:e.getAttribute("alt")??"",src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(l||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}({element:s,parse:e.parse});return!(t&&a.src?.startsWith("file:///"))&&a}return{}}},...s.parseDOM??[]],toDOM:s=>{let t=(0,L.dV)(s.attrs,e);return["img",{...e.dom(s),...t}]}}}}t(38029);var B=t(63473),M=t(74609),F=t(87374),P=t(44842),$=t.n(P),E=t(41315),Y=t(57024),O=t(64178),W=t(46503),H=t(68604);let G=e=>{let{toggleBlockquote:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().blockquote(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(W.A,{size:16})})};var U=t(19249);let q=e=>{let{toggleBold:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().bold(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(U.A,{size:16})})};var V=t(28275);let J=e=>{let{toggleBulletList:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().bulletList(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(V.A,{size:16})})};var Z=t(27409);let Q=e=>{let{toggleCode:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().code(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(Z.A,{size:16})})};var X=t(33235),K=t(28941);let ee=e=>{let{attrs:s}=e,{toggleHeading:t}=(0,l.oG)(),r=(0,i.useCallback)(()=>{t.enabled(s)&&t(s)},[t,s]),n=(0,l._T)().heading(s),d=t.enabled(s);
1return(0,a.jsx)(H.l,{disabled:!d,pressed:n,onPressedChange:r,icon:s?.level===2?(0,a.jsx)(X.A,{size:16}):(0,a.jsx)(K.A,{size:16})})};var es=t(42301);let et=e=>{let{toggleItalic:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().italic(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(es.A,{size:16})})};var ea=t(3634);let el=e=>{let{toggleOrderedList:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().orderedList(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(ea.A,{size:16})})};var er=t(64006);let en=e=>{let{toggleStrike:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().strike(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(er.A,{size:16})})};var ei=t(29915);let ed=e=>{let{toggleUnderline:s}=(0,l.oG)(),t=(0,i.useCallback)(()=>{s.enabled()&&s()},[s]),r=(0,l._T)().underline(),n=s.enabled();return(0,a.jsx)(H.l,{disabled:!n,pressed:r,onPressedChange:t,icon:(0,a.jsx)(ei.A,{size:16})})},eo=()=>{let{isEditing:e,clickEdit:s,onRemove:t,setHref:n,submitHref:i,cancelHref:d,href:o}=ec(),c=(0,l._T)().link();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.wK,{positioner:"selection",children:(0,a.jsxs)("div",{className:"flex border border-sand-6 rounded-md divide-x divide-sand-6 shadow-onWhite dark:shadow-onWhite-dark",children:[(0,a.jsx)("div",{children:(0,a.jsx)(q,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(et,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(en,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(ed,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(J,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(el,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(ee,{attrs:{level:2}})}),(0,a.jsx)("div",{children:(0,a.jsx)(ee,{attrs:{level:3}})}),(0,a.jsx)("div",{children:(0,a.jsx)(G,{})}),(0,a.jsx)("div",{children:(0,a.jsx)(Q,{})}),c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{children:(0,a.jsx)(Y.Button,{size:"small",theme:"ghost",onClick:s,icon:(0,a.jsx)(B.A,{size:16}),className:$()({"rounded-none":!0,"text-blue-11":e})})}),(0,a.jsx)("div",{children:(0,a.jsx)(Y.Button,{size:"small",theme:"ghost",onClick:t,icon:(0,a.jsx)(M.A,{size:16}),className:"rounded-none"})})]}):(0,a.jsx)("div",{children:(0,a.jsx)(Y.Button,{size:"small",theme:"ghost",onClick:s,icon:(0,a.jsx)(F.A,{size:16}),className:"rounded-none"})})]})}),(0,a.jsx)(r.Me,{positioner:"always",placement:"bottom",enabled:e,renderOutsideEditor:!0,children:(0,a.jsx)("div",{className:"flex flex-col w-[300px] divide-y divide-sand-6 rounded-md shadow-onWhite dark:shadow-onWhite-dark",children:(0,a.jsx)("div",{className:"flex flex-col p-2",children:(0,a.jsx)(eu,{style:{zIndex:20},autoFocus:!0,placeholder:"Enter link...",onChange:e=>{n(e.target.value)},value:o,onKeyDown:e=>{let{code:s}=e;"Enter"===s&&i(),"Escape"===s&&d()}})})})})]})},ec=()=>{let e=(0,l.mR)(),{isEditing:s,linkShortcut:t,setIsEditing:a}=(()=>{let[e,s]=(0,i.useState)(),[t,a]=(0,i.useState)(!1);return(0,l.tP)(g.O$,"onShortcut",(0,i.useCallback)(e=>(t||a(!0),s(e)),[t])),{linkShortcut:e,isEditing:t,setIsEditing:a}})(),{to:r,empty:n}=(0,l.T1)(),d=(0,l.OA)().link()?.href??"",[o,c]=(0,i.useState)(d),u=(0,i.useMemo)(()=>(0,E.AL)({type:"link"}),[]),m=(0,l.F6)();(0,i.useLayoutEffect)(()=>{s&&(m.doc||m.selection)&&a(!1)},[s,a,m.doc,m.selection]),(0,i.useEffect)(()=>{c(d)},[d]);let x=(0,i.useCallback)(()=>{a(!1);let s=t??void 0;""===o?e.removeLink():e.updateLink({href:o,auto:!1},s),e.focus(s?.to??r).run()},[a,t,e,o,r]),h=(0,i.useCallback)(()=>{a(!1)},[a]),p=(0,i.useCallback)(()=>e.removeLink().focus().run(),[e]),f=(0,i.useCallback)(()=>{n&&e.selectLink(),a(!0)},[e,n,a]);return(0,i.useMemo)(()=>({href:o,setHref:c,linkShortcut:t,linkPositioner:u,isEditing:s,clickEdit:f,onRemove:p,submitHref:x,cancelHref:h}),[o,t,u,s,f,p,x,h])},eu=({autoFocus:e,...s})=>{let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!e)return;let s=window.requestAnimationFrame(()=>{t.current?.focus()});return()=>{window.cancelAnimationFrame(s)}},[e]),(0,a.jsx)(O.p,{ref:t,...s,size:"small"})},em=(0,i.forwardRef)((e,s)=>{let{insertImage:t}=(0,l.oG)(),{setContent:r}=(0,l.pm)({autoUpdate:!0});return(0,i.useImperativeHandle)(s,()=>({setContent:r,insertImage:t})),(0,a.jsx)(a.Fragment,{})});em.displayName="ImperativeHandle";let ex=({placeholder:e,children:s,editorRef:t,onChange:d,hideToolbar:c,...L})=>{let I=(0,i.useCallback)(()=>[new x.l,new h.A,new g.O$({autoLink:!0}),new p.n({placeholder:e}),new f.C,new j.o,new b.x,new v.IQ({enableSpine:!0}),new v.XS,new v.vs({priority:m.OR.High,enableCollapsible:!0}
1),new w.$,new N.U({supportedLanguages:[o(),u()]}),new y.Q,new C.Oq,new _.D({copyAsMarkdown:!1}),new k.Y,new A.S,new R({uploadHandler:e=>{let s;return(0,z.V1)(e.length>0,{code:m.bh.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"}),s=0,e.map(({file:t,progress:a})=>async()=>{let l=await (0,D.V6)(t);return l.success&&l.data.result?(a((s+=1)/e.length),{src:l.data.result,fileName:t.name}):(T.toast.error("Image upload failed"),a((s+=1)/e.length),{src:"",fileName:t.name})})}}),new S.U],[e]),{manager:B}=(0,l._B)({extensions:I,stringHandler:"markdown",selection:"end"}),M=(0,i.useCallback)(e=>{d?.(e.helpers.getMarkdown())},[d]);return(0,a.jsx)("div",{className:"markdown-content remirror-editor",style:{maxWidth:"100%"},children:(0,a.jsx)("div",{className:"remirror-theme",children:(0,a.jsx)(n.yv,{children:(0,a.jsx)(r.NP,{children:(0,a.jsxs)(l.tj,{manager:B,autoFocus:!0,...L,onChange:M,children:[(0,a.jsx)(l.xn,{}),s,c?null:(0,a.jsx)(eo,{}),t&&(0,a.jsx)(em,{ref:t})]})})})})})};ex.displayName="MarkdownEditor";let eh=ex},4348:(e,s,t)=>{"use strict";t.d(s,{cn:()=>r});var a=t(76910),l=t(75806);function r(...e){return(0,l.Q)((0,a.$)(e))}},4761:(e,s,t)=>{"use strict";t.d(s,{o:()=>r,s:()=>l});var a=t(95155);let l=(0,t(12115).createContext)(void 0);function r({children:e,lang:s}){return(0,a.jsx)(l.Provider,{value:{lang:s},children:e})}},5458:(e,s,t)=>{"use strict";t.d(s,{AD:()=>n,V6:()=>l,dW:()=>i,vS:()=>r});var a=t(61763);let l=e=>{let s=new FormData;return s.append("file",e),(0,a.Zd)("resource",s)},r=e=>(0,a.Fb)("resource",{path:e}),n=(e,s)=>{let t=new FormData;return s.forEach(e=>{t.append("file",e)}),t.append("siteId",e),(0,a.Zd)("util/markdown-import",t)},i=e=>{window.open(`/api/util/markdown-export?siteId=${e}`)}},5814:(e,s,t)=>{"use strict";t.d(s,{Gw:()=>r,Q2:()=>n,VZ:()=>l,_R:()=>i});var a=t(61763);let l=e=>(0,a.bE)("tag",e),r=e=>(0,a.yJ)("tag",e),n=e=>(0,a.Jt)("tags",{siteId:e}),i=e=>(0,a.Fb)("tag",{id:e})},11439:(e,s,t)=>{"use strict";t.d(s,{PU:()=>n,g6:()=>r});var a,l,r=((a={}).BLOG_LIST="BLOG_LIST",a.BLOG_DETAIL="BLOG_DETAIL",a.NOTE_LIST="NOTE_LIST",a),n=((l={}).Last24Hours="last24Hours",l.Last7Days="last7Days",l.Last14Days="last14Days",l)},15398:(e,s,t)=>{"use strict";t.d(s,{Y:()=>i});var a=t(60150),l=t(31692),r=t(88429);let n={sites:[],currentSite:void 0,isLoading:!0},i=(0,a.vt)()((0,l.Zr)((e,s)=>({...n,getSiteDomainPath:()=>s().currentSite?.domain?`https://${s().currentSite?.domain}`:`https://${s().currentSite?.slug}.ongridea.com`,fetchSites:async()=>{e({isLoading:!0});let t=await (0,r.Wr)();if(t.success)if(t.data?.[0]&&Array.isArray(t.data)){e({sites:t.data});let a=s().currentSite;a?e({currentSite:t.data.find(e=>e.id===a.id)||t.data[0]}):e({currentSite:t.data[0]})}else e({sites:[],currentSite:void 0});e({isLoading:!1})},setCurrentSite:t=>{let a=s().sites.find(e=>e.id===t);a&&e({currentSite:a})},updateSitesByCurrentSite:t=>{let a=s().sites.findIndex(e=>e.id===t.id),l=s().sites;l[a]=t,e({sites:l}),e({currentSite:t})},updateSitesByDeleteSite:t=>{let a=s().sites.findIndex(e=>e.id===t.id),l=s().sites;l.splice(a,1),e({sites:l}),e({currentSite:l[0]})},updateSitesByAddSite:t=>{let a=s().sites;a.push(t),e({sites:a}),e({currentSite:t})},reset:()=>e(n)}),{name:"gridea-web-site",skipHydration:!0}))},15846:(e,s,t)=>{"use strict";t.d(s,{B:()=>o});var a=t(50931),l=t(55009),r=t(19646);t(81641);var n=t(55195);let i=["en","zh"],d="common";function o(e=d){let{lang:s}=(0,n.u)();return a.Ay.resolvedLanguage!==s&&i.includes(s)&&a.Ay.changeLanguage(s),(0,r.Bd)(e)}a.Ay.use(r.r9).use((0,l.A)((e,s)=>t(94466)(`./${e}/${s}.json`))).init({...function(e="en",s=d){return{supportedLngs:i,fallbackLng:"en",lng:e,fallbackNS:d,defaultNS:d,ns:s}}()})},23068:(e,s,t)=>{"use strict";t.d(s,{Ay:()=>i,M8:()=>d});var a=t(27866),l=t.n(a);t(88893),t(702),t(20574);var r=t(53401),n=t.n(r);l().extend(n());let i=l(),d=(e,s)=>(l().locale({"zh-hans":"zh-cn","zh-hant":"zh-tw",zh:"zh-cn",en:"en"}[s]),l().utc(e).format({"zh-hans":"YYYY / M / D","zh-hant":"YYYY / M / D",zh:"YYYY / MM / DD",en:"MMM D, YYYY"}[s]))},27370:(e,s,t)=>{"use strict";t.d(s,{CS:()=>l,Iy:()=>i,Sz:()=>o,iE:()=>d,p4:()=>r,w3:()=>n});var a=t(61763);let l=e=>(0,a.Jt)("note-my",e),r=e=>(0,a.bE)("note",e),n=e=>(0,a.yJ)("note",e),i=e=>(0,a.Fb)("note",{id:e}),d=e=>(0,a.bE)("note-patch",e),o=e=>(0,a.Jt)("note",e)},29619:(e,s,t)=>{"use strict";t.d(s,{N:()=>f});var a=t(95155),l=t(64393),r=t(56643),n=t(16346),i=t(73258),d=t(1794),o=t(12115),c=t(66609),u=t(61763),m=t(43609),x=t(64630),h=t(15846),g=t(23068),p=t(38320);let f=o.forwardRef(({children:e},s)=>
1{let t=o.useRef(null),{user:f,isAdmin:j}=(0,p.k)(),[b,v]=o.useState("info"),[w,N]=o.useState([]),{t:y}=(0,h.B)("dialog"),[C,_]=o.useState(!1),[k,A]=o.useState(!1),S=[{title:y("dialog_my.info"),value:"info"},{title:y("dialog_my.topup_record"),value:"topup"}];o.useEffect(()=>{(async()=>{if("topup"===b){let e;_(!0);let s=await (e={page:0,pageSize:100},(0,u.Jt)("topup-my",e));_(!1),s.success&&N(s.data.topups)}})()},[b]),o.useImperativeHandle(s,()=>({open:()=>{t.current?.open()},close:()=>{t.current?.close()}}));let z=()=>{f?.token?(0,x.lW)(f.token):c.toast.error("Copy failed")};return(0,a.jsx)(m.Dialog,{ref:t,title:y("dialog_my.my"),content:(0,a.jsx)(()=>(0,a.jsxs)("div",{children:[(0,a.jsx)(m.Tabs,{tabs:S,value:b,onChange:v}),(0,a.jsxs)("div",{className:"mt-6 px-2",children:["info"===b&&(0,a.jsxs)("div",{className:"flex flex-col gap-6 pb-6",children:[(0,a.jsx)(m.FormItem,{label:y("dialog_my.email"),children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{children:f?.email}),f?.vip?(0,a.jsx)(m.Tag,{icon:(0,a.jsx)(l.A,{size:14}),color:"yellow",children:y("dialog_my.paid")}):(0,a.jsx)(m.Tag,{icon:(0,a.jsx)(r.A,{size:14}),color:"sand",children:y("dialog_my.trial")})]})}),(0,a.jsx)(m.FormItem,{label:"API Token",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"text-sand-11",children:"***************************"}),(0,a.jsx)(m.Button,{size:"small",icon:(0,a.jsx)(n.A,{size:16}),onClick:z})]}),(0,a.jsxs)("div",{className:"text-sand-11 text-sm flex flex-wrap gap-2",children:[">"," ",y("dialog_my.token_note"),(0,a.jsx)("a",{href:"https://docs.gridea.dev/open-api",target:"_blank",rel:"noreferrer",children:(0,a.jsxs)("div",{className:"flex items-center gap-1 text-blue-11 underline",children:[(0,a.jsx)(i.A,{size:12}),"Open API"]})})]})]})}),(0,a.jsx)(m.FormItem,{label:y("dialog_my.join_time"),children:(0,a.jsx)("div",{children:g.Ay.utc(f?.createdAt).format("YYYY-MM-DD")})}),(0,a.jsx)(m.FormItem,{label:y("dialog_my.due_time"),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{children:g.Ay.utc(f?.dueDate).format("YYYY-MM-DD")}),f&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Button,{theme:"amber",rightIcon:(0,a.jsx)(d.A,{size:14}),onClick:()=>{window.open(`https://gridea.lemonsqueezy.com/checkout/buy/8bf24b55-16f1-48cd-8ec4-82066aa2ebf3?checkout[custom][user_id]=${f.id}`,"_blank")},children:f?.vip?y("dialog_my.continue_subscription"):y("dialog_my.subscription")}),(0,a.jsx)("div",{className:"flex justify-center underline text-sm cursor-pointer",onClick:()=>A(!k),children:"For Chinese User â¬ï¸"}),k&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"text-sm text-sand-11",children:"微信æ¯ä»ç¨æ·å¯éæ©æ¤æ¹å¼ï¼äººå·¥å¤ç订é
ï¼æ¯ä»æ¶è¯·å¤æ³¨æ³¨åé®ç®±ï¼æåéæ³¨åé®ç®±å¤æ³¨å° [email protected] ï¼ï¼æé¿ 24 å°æ¶å
å°å¤ç订é
仿¬¾ï¼å¤çåå°é®ä»¶éç¥å°æ¨"}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"max-w-96 mx-auto",children:(0,a.jsx)("img",{src:"/zan-shang.jpeg"})})})]})]})]})})]}),"topup"===b&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-8 prose",children:[(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:y("dialog_my.topup_time")}),(0,a.jsx)("th",{children:y("dialog_my.new_due_time")}),(0,a.jsx)("th",{children:y("dialog_my.finally_price")})]})}),(0,a.jsx)("tbody",{children:w.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:g.Ay.utc(e.createdAt).format("YYYY-MM-DD")}),(0,a.jsx)("td",{children:g.Ay.utc(e.dueDate).format("YYYY-MM-DD")}),(0,a.jsx)("td",{children:e.price})]},e.id))})]}),C&&0===w.length&&(0,a.jsx)("div",{className:"px-2 py-8 flex justify-center w-full",children:(0,a.jsx)(m.Spinner,{})}),!C&&0===w.length&&(0,a.jsx)("div",{className:"px-2 py-8 text-center w-full",children:y("dialog_my.no_topups")})]})]})]}),{}),children:e})});f.displayName="DialogMy"},38029:()=>{},38320:(e,s,t)=>{"use strict";t.d(s,{k:()=>i});var a=t(60150),l=t(31692),r=t(61763);let n={user:void 0},i=(0,a.vt)()((0,l.Zr)((e,s)=>({...n,fetchMe:async()=>{let s=await (0,r.Jt)("me");return s.success&&s.data&&e({user:s.data}),s},isAdmin:()=>s().user?.id==="17f026c3-0de7-45f6-9242-8bdf594cbd5c"||s().user?.id==="ea6065f6-48f8-4308-8865-156b4e4cfc83",isBentoEnable:()=>!0,reset:()=>e(n)}),{name:"gridea-web-user",skipHydration:!0}))},43609:(e,s,t)=>{"use strict";t.r(s),t.d(s,{Accordion:()=>K,AccordionContent:()=>et,AccordionItem:()=>ee,AccordionTrigger:()=>es,AlertDialog:()=>M,AnimateText:()=>P,AutoGrowInput:()=>c,Avatar:()=>j,BrowserHeader:()=>V,BrowserView:()=>Y,Button:()=>a.Button,Checkbox:()=>Z,ColorPicker:()=>ea.s,Dialog:()=>k,FontPicker:()=>el.C,FormItem:()=>u,ImagePicker:()=>p,Input:()=>l.p,Link:()=>i,Logo:()=>H.g,Markdown:()=>O.o,Radio:()=>I,RadioGroup:()=>L,Select:()=>R,Spinner:()=>B.y,Tabs:()=>b.t,Tag:()=>$,Textarea:()=>F,Toggle:()=>er.l,Tooltip:()=>W.Tooltip});var a=t(57024),l=t(64178),r=t(95155),n=t(12115);let i=e=>{let{children:s,...t}=e;return(0,r.jsx)("span",{className:"inline-flex item-center",children:(0,r.jsx)("a",{...t,className:"text-blue-9 hover:text-blue-10 focus:text-blue-11 hover:underline",children:s})})};var d=t(44842),o=t.n(d);let c=n.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{contentEditable:!0,ref:s,"aria-placeholder":"Type something...",...a,className:o()(t,"bg-sand-3 placeholder-sand-11 rounded-md px-4 py-2 text-sm hover:bg-sand-4 transition duration-150 focus:outline focus:bg-transparent focus:outline-sand-8")})});c.displayName="AutoGrowInput";let u=n.forwardRef((e,s)=>{let{label:t,children:a,className:l}=e;return(0,r.jsxs)("div",{className:o()("flex flex-col gap-2",l),children:[(0,r.jsx)("div",{className:"text-sand-11 text-sm h-5",children:t}),(0,r.jsx)("div",{children:a})]})});u.displayName="FormItem";var m=t(24685),x=t(89042),h=t(4348),g=t(50768);let p=n.forwardRef((e,s)=>{let{className:t,url:a,onChange:l}=e,[i,d]=n.useState(a);return n.useEffect(()=>{a!==i&&d(a)},[a]),(0,r.jsx)("div",{children:(0,r.jsx)(g.Wn,{onSetImage:e=>{e&&(l?.(e),d(e))},children:(0,r.jsx)("div",{className:(0,h.cn)("flex aspect-[2/1] justify-center items-center bg-sand-3 rounded-md hover:bg-sand-4 focus:bg-sand-5 duration-150",t),children:i?(0,r.jsxs)("div",{className:"relative w-full h-full flex justify-center items-center",children:[(0,r.jsx)(m.A,{size:20,className:"text-sand-11 absolute right-1 bottom-8 bg-sand-1 bg-opacity-70 p-1 rounded-md shadow-border",onClick:e=>{e.stopPropagation(),d(""),l?.("")}}),(0,r.jsx)(x.A,{size:20,className:"text-sand-11 absolute right-1 bottom-1 bg-sand-1 bg-opacity-70 p-1 rounded-md shadow-border"}),(0,r.jsx)("img",{src:i,className:"max-w-full max-h-full object-cover rounded-md"})]}):(0,r.jsx)(x.A,{size:16,className:"text-sand-11"})})})})});p.displayName="ImagePicker";var f=t(5143);let j=({src:e,...s})=>(0,r.jsx)(f.Root,{className:o()("relative inline-flex h-7 w-7",s.className),children:(0,r.jsx)(f.Image,{src:e,alt:"Avatar",className:o()("h-full w-full object-cover rounded-full")})});j.displayName="Avatar";var b=t(49920),v=t(43146),w=t(55638),N=t(80642),y=t(75909),C=t(98200),_=t.n(C);let k=n.forwardRef((e,s)=>{let{title:t,children:l,content:i,isCustom:d}
1=e,[c,u]=(0,n.useState)(!1),m=()=>{u(!0)},x=()=>{u(!1)};return(0,n.useImperativeHandle)(s,()=>({open:m,close:x})),(0,r.jsxs)(v.Root,{open:c,onOpenChange:u,children:[(0,r.jsx)(v.Trigger,{asChild:!0,children:l}),(0,r.jsx)(v.Portal,{children:(0,r.jsxs)(N.N,{children:[(0,r.jsx)(v.Overlay,{forceMount:!0,children:(0,r.jsx)(y.P.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-20 bg-black/30",onClick:e=>{e.preventDefault(),e.stopPropagation()}})}),d?(0,r.jsx)(v.Content,{className:o()(`fixed z-50 flex flex-col ${_().variable} font-snpro`,"top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]"),children:i}):(0,r.jsx)(v.Content,{className:o()(`fixed z-50 flex flex-col ${_().variable} font-snpro`,"w-full sm:w-[95vw] max-h-[95vh] max-w-xl md:w-full","bottom-0 sm:bottom-auto sm:top-[50%] left-[50%] -translate-x-[50%] translate-y-0 sm:-translate-y-[50%]"),children:(0,r.jsx)(y.P.div,{initial:{y:0,scaleX:1},animate:{y:0,scaleX:1},className:"bg-white dark:bg-sand-2 rounded-t-md sm:rounded-b-md h-full py-safe overflow-hidden flex flex-col",children:(0,r.jsxs)(y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"overflow-hidden flex flex-col",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center p-4 flex-shrink-0",children:[(0,r.jsx)(v.Title,{className:"text-sand-12 font-medium text-md md:text-lg",children:t}),(0,r.jsx)(v.Close,{children:(0,r.jsx)(a.Button,{size:"small",icon:(0,r.jsx)(w.raE,{}),theme:"ghost"})})]}),(0,r.jsx)("div",{className:"px-4 flex-1 flex flex-col",style:{overflow:"overlay"},children:i})]})})})]})})]})});k.displayName="Dialog";var A=t(86033),S=t(6214),z=t(12194);let L=n.forwardRef((e,s)=>(0,r.jsx)("div",{children:(0,r.jsx)(A.Root,{className:"flex gap-4",ref:s,...e,children:e.children})}));L.displayName="RadioGroup";let I=n.forwardRef((e,s)=>(0,r.jsxs)(A.Item,{ref:s,value:e.value,id:e.value,className:"text-sm cursor-default relative group",children:[(0,r.jsx)("div",{className:"px-1 group-hover:bg-sand-4 text-sm rounded-md cursor-default transition duration-150 absolute left-[-5%] block w-[110%] h-full group-hover:scale-110"}),(0,r.jsxs)("div",{className:"flex gap-1 relative",children:[(0,r.jsx)(A.Indicator,{className:"absolute",style:{top:"2.5px",left:"0.5px"},children:(0,r.jsx)(S.A,{size:15})}),(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsx)(z.A,{size:16})}),(0,r.jsx)("label",{htmlFor:"2",children:e.children})]})]}));I.displayName="Radio";var T=t(29521),D=t(59384);let R=(0,n.forwardRef)((e,s)=>{let{defaultValue:t,value:l,items:i,multiple:d,onValueChange:o,footerContent:c,size:u="middle"}=e,[m,x]=(0,n.useState)(l||t);return(0,n.useEffect)(()=>{x(l)},[l]),(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(T.WF,{value:m,onChange:e=>{x(e),o(e)},multiple:d,children:(0,r.jsxs)("div",{className:"relative leading-none",children:[(0,r.jsx)(T.WF.Button,{className:"w-full",as:"div",children:(0,r.jsxs)(a.Button,{align:"left",block:!0,rightIcon:(0,r.jsx)(w.TBE,{"aria-hidden":"true"}),size:u,children:["string"==typeof m&&i.find(e=>e.value===m)?.label||" ",m instanceof Array&&(0,r.jsx)("div",{className:"flex gap-1 flex-wrap",children:m.map(e=>{let s=i.find(s=>s.value===e);return s?(0,r.jsx)("div",{className:"inline-flex px-1 bg-sand-1 rounded-md",children:s.label},s.value):null})})]})}),(0,r.jsx)(D.e,{as:n.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsxs)(T.WF.Options,{className:"absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-sand-2 p-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",style:{overflow:"overlay"},children:[i.map(e=>(0,r.jsx)(T.WF.Option,{value:e.value,children:(0,r.jsx)(a.Button,{theme:"ghost",size:"middle",block:!0,align:"left",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"flex-1 truncate",children:e.label}),(0,r.jsx)("span",{className:"flex-shrink-0",children:m?.includes(e.value)&&(0,r.jsx)(w.Srz,{className:"ml-2"})})]})})},e.value)),c]})})]})})})});R.displayName="Select";var B=t(72346);let M=n.forwardRef((e,s)=>{let{title:t,children:a,content:l}=e,[i,d]=(0,n.useState)(!1),c=()=>{d(!0)},u=()=>{d(!1)};return(0,n.useImperativeHandle)(s,()=>({open:c,close:u})),(0,r.jsxs)(v.Root,{open:i,onOpenChange:d,children:[(0,r.jsx)(v.Trigger,{asChild:!0,children:a}),(0,r.jsxs)(v.Portal,{children:[(0,r.jsx)(v.Overlay,{className:"fixed inset-0 z-20 bg-black/30"}),(0,r.jsxs)(v.Content,{className:o()("fixed z-50","w-[90vw] max-w-lg rounded-md p-4 md:w-full","top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]","bg-white dark:bg-sand-2"),children:[(0,r.jsx)("div",{className:"flex justify-between items-center mb-3",children:(0,r.jsx)(v.Title,{className:"text-sand-12 text-lg",children:t})}),(0,r.jsx)("div",{children:l})]})]})]})});M.displayName="AlertDialog";let F=n.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("textarea",{ref:s,...a,rows:3,className:o()("bg-sand-3 placeholder-sand-11 rounded-md px-4 py-2 text-sm hover:bg-sand-4 transition duration-150 focus:outline focus:bg-transparent focus:outline-sand-8 w-full",t)})});F.displayName="Textarea";let P=e=>{let s={error:"text-red-9",success:"text-green-9",info:"text-blue-9"}[e.type||"info"],t=n.useId();return(0,r.jsx)(y.P.div,{className:o()(s,"text-xs",e.className),animate:{height:"auto"},initial:{height:0},children:e.children},t)};P.displayName="AnimateText";let $=n.forwardRef((e,s)=>{let{color:t,size:a,icon:l,className:n}=e;return(0,r.jsxs)("div",{ref:s,className:o()("text-sm leading-none py-1 px-2 inline-flex gap-1 rounded-md border ",{sand:"bg-sand-1 text-sand-11 border-sand-6",yellow:"bg-yellow-1 text-yellow-11 border-yellow-6"}[t||"sand"],n),children:[l,(0,r.jsx)("div",{children:e.children})]})});$.displayName="Tag";var E=t(75171);let Y=n.forwardRef((e,s)=>{let{domainPath:t,slug:a,children:l}=e;return(0,r.jsxs)("div",{className:"bg-white dark:bg-sand-1 rounded-md h-full flex flex-col border-sand-6 border shadow-sm",ref:s,children:[(0,r.jsxs)("div",{className:"flex items-center h-8 px-4 justify-between flex-shrink-0 border-b border-sand-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-sand-4 roun
1ded-full"}),(0,r.jsx)("div",{className:"w-2 h-2 bg-sand-4 rounded-full"}),(0,r.jsx)("div",{className:"w-2 h-2 bg-sand-4 rounded-full"})]}),(0,r.jsx)("div",{className:"flex-1 flex justify-center text-xs",children:(0,r.jsxs)("div",{className:"text-sand-11",children:[t,(0,r.jsx)("span",{className:"text-blue-11",children:a&&`/${a}`})]})}),(0,r.jsx)("div",{})]}),(0,r.jsx)(E.F,{children:(0,r.jsx)("div",{className:"flex-1",children:l})})]})});Y.displayName="BrowserView";var O=t(53815),W=t(83578),H=t(83458),G=t(90030),U=t(49423),q=t(2593);let V=n.forwardRef((e,s)=>{let{favicon:t,title:a,children:l}=e;return(0,r.jsx)("div",{className:"border border-sand-6 rounded-md overflow-hidden",ref:s,children:(0,r.jsx)("div",{className:"",children:(0,r.jsxs)("div",{className:"bg-sand-3 pt-2 px-4 rounded-md",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsxs)("div",{className:"flex bg-sand-1 p-2 gap-2 rounded-t-lg justify-between items-center overflow-hidden flex-1 max-w-[240px]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-1 overflow-hidden",children:[t?(0,r.jsx)("img",{src:t,className:"w-5 h-5 bg-sand-2 flex-shrink-0"}):(0,r.jsx)("div",{className:"w-4 h-4 bg-green-9 rounded-md flex-shrink-0"}),(0,r.jsx)("div",{className:"text-sm truncate text-sand-11",children:a})]}),(0,r.jsx)(G.A,{className:"w-3 h-3 text-sand-11"})]}),(0,r.jsx)(U.A,{className:"w-3 h-3 text-sand-11"})]}),(0,r.jsxs)("div",{className:"p-2 bg-sand-1 -mx-4 flex gap-2 items-center",children:[(0,r.jsx)(q.A,{className:"w-3 h-3 text-sand-11"}),(0,r.jsx)("div",{className:"bg-sand-2 rounded-2xl px-2 py-1 text-xs flex-1 truncate text-sand-11",children:l})]})]})})})});V.displayName="BrowserHeader";var J=t(47279);let Z=e=>{let{children:s,value:t,onValueChange:a}=e;return(0,r.jsxs)("div",{className:"flex items-start py-2",children:[(0,r.jsx)(J.Root,{className:"shadow-blackA7 hover:bg-violet3 flex w-5 h-5 appearance-none items-center justify-center rounded-[4px] bg-sand-3 outline-none flex-shrink-0",value:void 0,checked:t,onCheckedChange:a,id:"c1",children:(0,r.jsx)(J.Indicator,{className:"text-violet11",children:(0,r.jsx)(w.Srz,{})})}),(0,r.jsx)("label",{className:"pl-1 text-sm",htmlFor:"c1",children:s})]})};Z.displayName="Checkbox";var Q=t(89670),X=t(43e3);let K=Q.Root,ee=n.forwardRef(({className:e,...s},t)=>(0,r.jsx)(Q.Item,{ref:t,className:(0,h.cn)("border-b border-b-sand-6",e),...s}));ee.displayName="AccordionItem";let es=n.forwardRef(({className:e,children:s,...t},a)=>(0,r.jsx)(Q.Header,{className:"flex sticky top-0 z-10",children:(0,r.jsxs)(Q.Trigger,{ref:a,className:(0,h.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all [&[data-state=open]>svg]:rotate-180",e),...t,children:[s,(0,r.jsx)(X.A,{className:"h-4 w-4 transition-transform duration-200"})]})}));es.displayName=Q.Trigger.displayName;let et=n.forwardRef(({className:e,children:s,...t},a)=>(0,r.jsx)(Q.Content,{ref:a,className:(0,h.cn)("data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden text-sm transition-all",e),...t,children:(0,r.jsx)("div",{className:"pt-px px-px pb-4",children:s})}));et.displayName=Q.Content.displayName;var ea=t(67582),el=t(47086);t(1345);var er=t(68604)},47086:(e,s,t)=>{"use strict";t.d(s,{C:()=>r});var a=t(95155),l=t(12115);let r=e=>{let{fontTokens:s,onChange:t}=e,[r,n]=l.useState(e.value||"");return(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:`flex text-center flex-col gap-2 border-sand-6 border rounded-md p-2 cursor-pointer ${r===e.value?"border-sand-12":""}`,onClick:()=>{var s;n(s=e.value),t(s)},children:(0,a.jsx)("div",{className:"text-sand-12 text-base",style:{fontFamily:`${e.value}`},children:e.title})},e.value))})}},49920:(e,s,t)=>{"use strict";t.d(s,{t:()=>c});var a=t(95155),l=t(44842),r=t.n(l),n=t(12115),i=t(75806),d=t(83578),o=t(4348);let c=e=>{let{tabs:s,theme:t="default",miniInMobile:l=!1,withTooltip:c=!1}=e,[u,m]=n.useState(),[x,h]=n.useState(),[g,p]=n.useState(),[f,j]=n.useState(!0),b=n.useRef(null),v=n.useRef(null);n.useEffect(()=>{let t=s.findIndex(s=>s.value===e.value);m(w.current[t]?.getBoundingClientRect()),h(v.current?.getBoundingClientRect()),j(!g),p(s[t])},[e.value]);let w=n.useRef([]),N={};u&&x&&(N.transitionDuration=f?"0ms":"150ms",N.opacity=+!!g,N.width=`${u.width}px`,N.transform=`translate(${u.left-x.left}px)`);let y=(s,n)=>(0,a.jsxs)("div",{ref:e=>{w.current[n]=e},onClick:()=>
1e.onChange?.(s.value),className:(0,i.Q)(r()({"tab-item":!0,"flex flex-1 items-center justify-center text-sm text-sand-11 relative transition-colors duration-200 ease-in-out hover:text-sand-12 cursor-default select-none":!0,"px-4 py-1":"simple"!==t,"px-2 py-1 text-xs":"simple"===t,"text-sand-12":g?.value===s.value})),children:[s.icon&&(0,a.jsx)("div",{className:r()({"h-5 flex items-center":!0,"sm:mr-2":l&&!!s.title.length,"mr-2":!l&&!!s.title.length}),children:s.icon}),(0,a.jsx)("div",{className:r()({"sm:block whitespace-nowrap hidden":l,"block whitespace-nowrap":!l}),children:s.title})]},s.value);return(0,a.jsx)("div",{className:r()("rounded-md","default"===t?"bg-sand-3 p-1":"bg-white dark:bg-sand-2 py-1"),children:(0,a.jsxs)("div",{className:"relative flex",ref:v,children:[(0,a.jsx)("div",{ref:b,style:N,className:(0,o.cn)("absolute top-0 left-0 rounded-md h-7 transition-all duration-150 ease-in-out",{"bg-white dark:bg-sand-5 shadow-tab":"default"===t,"bg-sand-5":"ghost"===t,"border-b border-sand-12 rounded-none h-6":"simple"===t})}),s.map((e,s)=>c?(0,a.jsx)(d.Tooltip,{content:e.tooltip||"",children:y(e,s)},e.value):y(e,s))]})})};c.displayName="Tabs"},50768:(e,s,t)=>{"use strict";t.d(s,{Nr:()=>ee.N,Wo:()=>K,BR:()=>Q,_D:()=>k,G_:()=>es,r2:()=>V,Wn:()=>b});var a=t(95155),l=t(33763),r=t(93119),n=t(78556),i=t(89042),d=t(16346),o=t(27719),c=t(12115),u=t(99003),m=t(66609),x=t(61763),h=t(5458),g=t(43609),p=t(64630),f=t(15846);let j=({onSetImage:e,onClose:s})=>{let t,j=c.useRef(null),[b,v]=c.useState("url"),[w,N]=c.useState([]),{register:y,watch:C,formState:{isSubmitting:_},handleSubmit:k}=(0,u.mN)(),[A,S]=c.useState(!1),[z,L]=c.useState([]),{t:I}=(0,f.B)("dialog"),T=(t=I,[{title:"URL",icon:(0,a.jsx)(l.A,{size:14}),value:"url"},{title:t("dialog_image.resource_library"),icon:(0,a.jsx)(r.A,{size:14}),value:"resource"},{title:"Unsplash",icon:(0,a.jsx)(n.A,{size:14}),value:"unsplash"},{title:t("dialog_image.local_upload"),icon:(0,a.jsx)(i.A,{size:14}),value:"local"}]),D=async t=>{let a=t.target.files?.[0];if(!a)return;if(a.size>1048576)return void m.toast.error(I("dialog_image.limit_warning"));S(!0);let l=await (0,h.V6)(a);S(!1),l.success&&l.data.result&&(e(l.data.result),s?.())};c.useEffect(()=>{"resource"!==b||w.length||k(R)()},[b]);let R=async()=>{let e=await (0,x.Jt)("resource");e.success&&e.data&&N(e.data.images||[])},B=async e=>{try{L([...z,e]);let s=await (0,h.vS)(e);if(s.success&&s.data.success){let s=w.filter(s=>s!==e);N(s),m.toast.success("Delete successful.");return}m.toast.error("Delete failed.")}catch(e){}finally{L(z.filter(s=>s!==e))}};return(0,a.jsxs)("div",{className:"flex flex-col h-full overflow-hidden -mx-4",children:[(0,a.jsx)("div",{className:"flex-shrink-0 px-4 pb-4",children:(0,a.jsx)(g.Tabs,{miniInMobile:!0,tabs:T,value:b,onChange:e=>v(e)})}),(0,a.jsxs)("div",{className:"flex-1 p-4",style:{overflow:"overlay"},children:["url"===b&&(0,a.jsxs)("div",{className:"flex gap-2 py-8",children:[(0,a.jsx)(g.Input,{placeholder:"https://",...y("url")}),(0,a.jsx)(g.Button,{className:"flex-shrink-0",theme:"primary",onClick:()=>{e(C("url")),s?.()},children:I("dialog_image.save")})]}),_&&(0,a.jsx)("div",{className:"py-8 flex justify-center",children:(0,a.jsx)(g.Spinner,{})}),"resource"===b&&(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 overflow-auto",children:w.map(t=>(0,a.jsxs)("div",{className:"p-1 border border-sand-4 rounded-md flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-24 group bg-sand-2 transition rounded-sm flex justify-center",onClick:()=>{e(t),s?.()},children:(0,a.jsx)("img",{src:t,alt:"Resource",loading:"lazy",className:"group-hover:scale-95 transition-transform object-scale-down"})}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)(g.Button,{size:"small",theme:"ghost",icon:(0,a.jsx)(d.A,{size:14}),onClick:()=>{(0,p.lW)(t)}}),(0,a.jsx)(g.Button,{loading:z.includes(t),size:"small",onClick:()=>{B(t)},icon:(0,a.jsx)(o.A,{size:14}),withConfirm:!0,theme:"dangerGhost"})]})]},t))}),"unsplash"===b&&(0,a.jsx)("div",{className:"flex p-8 justify-center text-sand-9",children:"Coming soon..."}),"local"===b&&(0,a.jsxs)("div",{className:"flex p-8 justify-center",children:[(0,a.jsx)(g.Button,{onClick:()=>{j.current&&j.current.click()},loading:A,children:I("dialog_image.select_image")}),(0,a.jsx)("input",{ref:j,type:"file",className:"hidden",accept:"image/*",onChange:D})]})]})]})},b=({children:e,onSetImage:s})=>{let t=c.useRef(null),{t:l}=(0,f.B)("dialog");return(0,a.jsx)(g.Dialog,{title:l("dialog_image.image_upload"),ref:t,content:(0,a.jsx)(j,{onSetImage:s,onClose:t.current?.close}),children:e})};
1var v=t(99271),w=t(90613),N=t(12210),y=t(88429),C=t(15398),_=t(38320);let k=c.forwardRef(({children:e},s)=>{let t=c.useRef(null),{updateSitesByAddSite:l}=(0,C.Y)(),[r,n]=c.useState(""),[i,d]=c.useState(""),{t:o}=(0,f.B)("dialog"),{isBentoEnable:x,isAdmin:h}=(0,_.k)();return c.useImperativeHandle(s,()=>({open:()=>{t.current?.open()},close:()=>{t.current?.close()}})),(0,a.jsx)(g.Dialog,{ref:t,title:o("dialog_site_create.site_new"),content:(0,a.jsx)(()=>{let{register:e,watch:s,setValue:c,formState:{isSubmitting:h,isValid:p},handleSubmit:f}=(0,u.mN)({defaultValues:{theme:"default"}}),j=async()=>{n("");let e=await (0,y.Ae)(s());e.success&&(e.data.success?(l(e.data.result),d(e.data.result.slug),m.toast.success(o("dialog_site_create.site_create_success"))):n(e.data.message))};return(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[!i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.FormItem,{label:o("dialog_site_create.site_name"),children:(0,a.jsx)(g.Input,{placeholder:"Gridea's blog",...e("title",{required:!0})})}),(0,a.jsx)(g.FormItem,{label:o("dialog_site_create.site_slug"),children:(0,a.jsx)(g.Input,{placeholder:"yourname",...e("slug",{onChange:e=>{e.target.value=e.target.value.replace(/[^a-z0-9_-]/g,""),c("slug",e.target.value)},maxLength:20,required:!0})})}),x()&&(0,a.jsx)(g.FormItem,{label:o("dialog_site_create.site_theme_style"),children:(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1 items-center group cursor-pointer",onClick:()=>c("theme","default"),children:[(0,a.jsxs)("div",{className:`flex flex-col gap-1 p-4 border rounded-xl ${"default"!==s("theme")&&"border-sand-6 group-hover:border-sand-8"} transition-all ${"default"===s("theme")&&"border-blue-9"}`,children:[(0,a.jsxs)("div",{className:"flex gap-1 items-center py-2",children:[(0,a.jsx)("div",{className:"w-5 h-5 bg-blue-6 rounded-3xl"}),(0,a.jsxs)("div",{className:"flex gap-1 flex-col",children:[(0,a.jsx)("div",{className:"w-8 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-14 h-1 bg-blue-6 rounded-md"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"w-8 h-1 mt-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-24 h-8 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-8 h-1 mt-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-24 h-12 bg-blue-6 rounded-md"})]})]}),(0,a.jsxs)("div",{className:`flex justify-between w-full px-2 transition-all ${"default"===s("theme")&&"px-4"}`,children:[(0,a.jsx)("div",{className:`text-sm ${"default"!==s("theme")&&"group-hover:text-sand-12"} transition-all ${"default"===s("theme")?"text-blue-9":"text-sand-11"}`,children:"Default"}),"default"===s("theme")&&(0,a.jsx)(v.A,{className:"w-4 h-4 text-blue-9"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 items-center group cursor-pointer",onClick:()=>c("theme","bento"),children:[(0,a.jsxs)("div",{className:`flex flex-col gap-1 p-4 border rounded-xl ${"bento"!==s("theme")&&"border-sand-6 group-hover:border-sand-8"} transition-all ${"bento"===s("theme")&&"border-blue-9"}`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1 items-center pb-2",children:[(0,a.jsx)("div",{className:"w-5 h-5 bg-blue-6 rounded-3xl"}),(0,a.jsxs)("div",{className:"flex gap-1 flex-col items-center",children:[(0,a.jsx)("div",{className:"w-8 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-14 h-1 bg-blue-6 rounded-md"})]})]}),(0,a.jsxs)("div",{className:"flex gap-1",children:[(0,a.jsx)("div",{className:"w-8 h-8 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-16 h-8 bg-blue-6 rounded-md"})]}),(0,a.jsxs)("div",{className:"flex gap-1",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-8 h-16 bg-blue-6 rounded-md"})]})]}),(0,a.jsxs)("div",{className:`flex justify-between w-full transition-all px-2 ${"bento"===s("theme")&&"px-4"}`,children:[(0,a.jsx)("div",{className:`text-sm ${"bento"!==s("theme")&&"group-hover:text-sand-12"} transition-all ${"bento"===s("theme")?"text-blue-9":"text-sand-11"}`,children:"Bento"}),"bento"===s("theme")&&(0,a.jsx)(v.A,{className:"w-4 h-4 text-blue-9"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 items-center group cursor-pointer",onClick:()=>c("theme","side"),children:[(0,a.jsx)("div",{className:`flex flex-col gap-1 border rounded-xl overflow-hidden ${"side"!==s("theme")&&"border-sand-6 group-hover:border-sand-8"} transition-all ${"side"===s("theme")&&"border-blue-9"}`,children:(0,a.jsxs)("div",{className:"flex bg-sand-2 dark:bg-sand-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1 px-2 pt-4",children:[(0,a.jsxs)("div",{className:"flex gap-1 items-center py-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-blue-6 rounded-3xl"}),(0,a.jsx)("div",{className:"flex gap-1 flex-col",children:(0,a.jsx)("div",{className:"w-3 h-1 bg-blue-6 rounded-md"})})]}),(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-3 h-[2px] bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 p-4 bg-white dark:bg-sand-2 m-1 rounded-md shadow-border",children:[(0,a.jsx)("div",{className:"w-6 h-1 mt-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-20 h-8 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 mt-1 bg-blue-6 rounded-md pt-1"}),(0,a.jsx)("div",{className:"w-20 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-20 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-20 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-6 h-1 mt-1 bg-blue-6 rounded-md pt-1"}),(0,a.jsxs)("div",{className:"flex gap-1",children:[(0,a.jsx)("div",{className:"w-6 h-1 bg-blue-6 rounded-md"}),(0,a.jsx)("div",{className:"w-12 h-11 bg-blue-6 rounded-md"})]})]})]})}),(0,a.jsxs)("div",{className:`flex justify-between w-full px-2 transition-all ${"side"===s("theme")&&"px-4"}`,children:[(0,a.jsx)("div",{className:`text-sm ${"side"!==s("theme")&&"group-hover:text-sand-12"} transition-all ${"side"===s("theme")?"text-blue-9":"text-sand-11"}`,children:"Doz"}),"side"===s("theme")&&(0,a.jsx)(v.A,{className:"w-4 h-4 text-blue-9"})]})]})]})}),(0,a.jsx)("div",{className:"flex items-center justify-center pt-6 text-neutral-300",children:(0,a.jsx)("div",{className:"hr dark:hr-dark w-64"})}),(0,a.jsx)(g.FormItem,{label:o("dialog_site_create.site_preview"),children:(0,a.jsx)(g.BrowserHeader,{title:s("title")||"Gridea's blog",children:(0,a.jsxs)("div",{className:"text-sand-11 text-xs mt-1",children:["https://",(0,a.jsx)("span",{className:"text-blue-9",children:s("slug")||"yourname"}),".ongridea.com"]})})})]}),r&&(0,a.jsx)(g.AnimateText,{type:"error",children:r}),!i&&(0,a.jsx)(g.Button,{disabled:!p,type:"button",theme:"primary",loading:h,onClick:f(j),icon:(0,a.jsx)(w.A,{size:14}),children:o("dialog_site_create.site_create")}),i&&(0,a.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,a.jsx)(g.Button,{rightIcon:(0,a.jsx)(N.A,{size:14}),block:!0,theme:"primary",onClick:()=>{window.open(`https://${i}.ongridea.com/`)},children:o("dialog_site_create.site_go")}),(0,a.jsx)(g.Button,{block:!0,onClick:()=>t.current?.close(),children:o("back")})]})]})},{}),children:e})});k.displayName="DialogSiteCreate";var A=t(88711),S=t(62733),z=t(27693),L=t(89561),I=t(63093),T=t(46732),D=t(32638);let R="#434c5e",B="var(--sand9)",M="#88c0d0",F="var(--sand12)",P="var(--blue9)",$="#ebcb8b",E="#a3be8c",Y="#d30102",O=L.Lz.theme({"&":{height:"100%",backgroundColor:"transparent !important"},"&.cm-editor.cm-focused":{outline:"none"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-content":{fontSize:"15px",fontFamily:"iA Writer Mono,Menlo,PingFang SC,-apple-system,SF UI Text,Lucida Grande,STheiti,Microsoft YaHei,sans-serif",lineHeight:1.6,minHeight:"110px"},".cm-line":{padding:"0 4px"},".cm-line span":{textDecoration:"none"},".cm-lineWrapping":{wordBreak:"break-all"},".cm-cursor-primary":{borderLeft:"1.5px solid var(--yellow11)"}
1,"&.cm-focused .cm-selectionBackground, ::selection":{background:"var(--yellow4)"}},{dark:!1}),W=T.cr.define([{tag:D._A.keyword,color:F},{tag:[D._A.name,D._A.deleted,D._A.character,D._A.propertyName,D._A.macroName],color:P},{tag:[D._A.variableName],color:P},{tag:[D._A.function(D._A.variableName)],color:F},{tag:[D._A.labelName],color:"#81a1c1"},{tag:[D._A.color,D._A.constant(D._A.name),D._A.standard(D._A.name)],color:F},{tag:[D._A.definition(D._A.name),D._A.separator],color:E},{tag:[D._A.brace],color:B},{tag:[D._A.annotation],color:Y},{tag:[D._A.number,D._A.changed,D._A.annotation,D._A.modifier,D._A.self,D._A.namespace],color:M},{tag:[D._A.typeName,D._A.className],color:$},{tag:[D._A.operator,D._A.operatorKeyword],color:E},{tag:[D._A.tagName],color:"#b48ead"},{tag:[D._A.squareBracket],color:"#bf616a"},{tag:[D._A.angleBracket],color:P},{tag:[D._A.attributeName],color:$},{tag:[D._A.regexp],color:F},{tag:[D._A.quote],color:"var(--sand11)"},{tag:[D._A.string],color:P},{tag:D._A.link,color:B,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[D._A.url,D._A.escape,D._A.special(D._A.string)],color:P},{tag:[D._A.meta],color:M},{tag:[D._A.comment],color:R,fontStyle:"italic"},{tag:D._A.strong,fontWeight:"bold",color:F},{tag:D._A.emphasis,fontStyle:"italic",color:F},{tag:D._A.strikethrough,textDecoration:"line-through"},{tag:D._A.heading,fontWeight:"bold",color:F},{tag:D._A.special(D._A.heading1),fontWeight:"bold",color:F},{tag:D._A.heading1,fontWeight:"bold",color:F},{tag:[D._A.heading2,D._A.heading3,D._A.heading4],fontWeight:"bold",color:F},{tag:[D._A.heading5,D._A.heading6],color:F},{tag:[D._A.atom,D._A.bool,D._A.special(D._A.variableName)],color:P},{tag:[D._A.processingInstruction,D._A.inserted],color:B},{tag:[D._A.contentSeparator],color:$},{tag:D._A.invalid,color:R,borderBottom:`1px dotted ${Y}`}]),H=[O,(0,T.y9)(W)];L.Lz.theme({"&":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-content":{fontSize:"16px",fontFamily:"iA Writer Mono,Menlo,PingFang SC,-apple-system,SF UI Text,Lucida Grande,STheiti,Microsoft YaHei,sans-serif",lineHeight:1.6,minHeight:"110px"},".cm-line":{padding:"0 4px"},".cm-line span":{textDecoration:"none"},".cm-lineWrapping":{wordBreak:"break-all"},".cm-cursor-primary":{borderLeft:"1.5px solid var(--yellow11)"},"&.cm-focused .cm-selectionBackground, ::selection":{background:"#fff8bb"}});let G=new I.xx;c.forwardRef((e,s)=>(0,a.jsx)(A.Ay,{value:e.value,extensions:[(0,S.markdown)({base:S.markdownLanguage,codeLanguages:z.e}),L.Lz.lineWrapping,G.of(H)],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1},onChange:e.onValueChange,placeholder:e.placeholder||"åç¹ä»ä¹...",ref:s})).displayName="MarkdownEditor";var U=t(355),q=t(5814);let V=c.forwardRef(({children:e,tag:s},t)=>{let l=c.useRef(null),{fetchTags:r}=(0,U.P)(),{currentSite:n}=(0,C.Y)(),{t:i}=(0,f.B)("dialog");return c.useImperativeHandle(t,()=>({open:()=>{l.current?.open()},close:()=>{l.current?.close()}})),(0,a.jsx)(g.Dialog,{ref:l,title:i("dialog_tag_create.tag"),content:(0,a.jsx)(()=>{let{register:e,watch:t,setValue:d,formState:{isSubmitting:o,isValid:c},handleSubmit:m}=(0,u.mN)({defaultValues:s||{}}),x=async()=>{t("id")?(await (0,q.Gw)({...t(),siteId:n?.id})).success&&(r(),l.current?.close()):(await (0,q.VZ)({...t(),siteId:n?.id})).success&&(r(),l.current?.close())};return(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-8",children:[(0,a.jsx)(g.FormItem,{label:i("dialog_tag_create.tag_name"),children:(0,a.jsx)(g.Input,{...e("title",{required:!0})})}),(0,a.jsx)(g.FormItem,{label:"Slug",children:(0,a.jsx)(g.Input,{...e("slug",{required:!0,onChange:e=>{e.target.value=e.target.value.replace(/[^a-z0-9_-]/g,""),d("slug",e.target.value)}}),placeholder:"some-tag"})}),(0,a.jsx)(g.FormItem,{label:i("dialog_tag_create.tag_description"),children:(0,a.jsx)(g.Input,{...e("description")})}),(0,a.jsx)(g.Button,{disabled:!c,className:"mt-4",onClick:m(x),block:!0,theme:"primary",loading:o,children:i("dialog_tag_create.done")})]})},{}),children:e})});V.displayName="DialogTagCreate";var J=t(80584),Z=t(54635);let Q=c.forwardRef(({children:e,tag:s},t)=>{let l=c.useRef(null),{fetchNoteTags:r}=(0,J.p)(),{t:n}=(0,f.B)("dialog");return c.useImperativeHandle(t,()=>({open:()=>{l.current?.open()},close:()=>{l.current?.close()}})),(0,a.jsx)(g.Dialog,{ref:l,title:n("dialog_note_tag_create.tag"),content:(0,a.jsx)(()=>{let{register:e,watch:t,formState:{isSubmitting:i,isValid:d},handleSubmit:o,setValue:c}=(0,u.mN)({defaultValues:s||{}}),{formState:{isSubmitting:m},handleSubmit:x}=(0,u.mN)(),h=t("id"),p=async()=>{h?(await (0,Z.AX)({id:t("id"),title:t("title")})).success&&(r(),l.current?.close()):(await (0,Z.dP)(t())).success&&(r(),l.current?.close())},f=async()=>{(await (0,Z.cq)(t("id"))).success&&(r(),l.current?.close())};return(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-8",children:[(0,a.jsx)(g.FormItem,{label:n("dialog_note_tag_create.tag_name"),children:(0,a.jsx)(g.Input,{...e("title",{required:!0})})}),(0,a.jsx)(g.Button,{disabled:!d,className:"mt-4",onClick:o(p),block:!0,theme:"primary",loading:i,children:n("dialog_note_tag_create.done")}),h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex items-center justify-center pt-8 pb-6 text-neutral-300",children:(0,a.jsx)("div",{className:"hr dark:hr-dark w-64"})}),(0,a.jsx)(g.Button,{theme:"dangerGhost",onClick:x(f),block:!0,loading:m,children:n("dialog_note_tag_create.delete_tag")})]})]})},{}),children:e})});Q.displayName="DialogNoteTagCreate";var X=t(27370);let K=c.forwardRef(({children:e,noteId:s,onPublishSuccess:t},l)=>{let r=c.useRef(null),{t:n}=(0,f.B)("note");return c.useImperativeHandle(l,()=>({open:()=>{r.current?.open()},close:()=>{r.current?.close()}})),(0,a.jsx)(g.Dialog,{ref:r,title:n("publish_to_site"),content:(0,a.jsx)(()=>{let{watch:e,formState:{isSubmitting:l,isValid:i},handleSubmit:d,setValue:o}=(0,u.mN)({defaultValues:{siteId:""}}),{sites:c,currentSite:x}=(0,C.Y)(),h=async()=>{let a=e("siteId")||x?.id||c[0]?.id;(await (0,X.iE)({id:s,siteId:a,action:"publish"})).success&&(m.toast.success(n("publish_success")),t(a),r.current?.close())};return(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-8",children:[(0,a.jsx)(g.FormItem,{label:n("select_website"),children:(0,a.jsx)(g.Select,{value:e("siteId")||x?.id||c[0]?.id,items:c.map(e=>({value:e.id,label:e.title})),onValueChange:e=>{o("siteId",e)},defaultValue:x?.id||c[0]?.id})}),(0,a.jsx)(g.Button,{disabled:!i,className:"mt-14",onClick:d(h),block:!0,theme:"primary",loading:l,children:n("confirm_publish")})]})},{}),children:e})});K.displayName="DialogNotePublish";var ee=t(29619);let es=c.forwardRef(({children:e},s)=>{let t=c.useRef(null),{t:l}=(0,f.B)("dialog");return c.useImperativeHandle(s,()=>({open:()=>{t.current?.open()},close:()=>{t.current?.close()}})),(0,a.jsx)(g.Dialog,{ref:t,title:l("dialog_support.support"),content:(0,a.jsx)(()=>(0,a.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[(0,a.jsxs)("div",{children:[l("dialog_support.follow_twitter")," ",(0,a.jsx)("a",{className:"text-blue-11",href:"https://x.com/getgridea",target:"_blank",rel:"noreferrer",children:"@getgridea"})]}),(0,a.jsxs)("div",{children:[l("dialog_support.email_support")," ",(0,a.jsx)("a",{className:"text-blue-11",href:"mailto:[email protected]",target:"_blank",rel:"noreferrer",children:"[email protected]"})]}),(0,a.jsx)("div",{children:(0,a.jsx)("a",{className:"text-blue-11",href:"https://discord.gg/AtTM5fZUpX",target:"_blank",rel:"noreferrer",children:"Join Discord"})})]}),{}),children:e})});es.displayName="DialogSupport"},53815:(e,s,t)=>{"use strict";t.d(s,{o:()=>v});var a=t(95155),l=t(55638),r=t(44842),n=t.n(r),i=t(75909),d=t(12115),o=t(40830),c=t(1100),u=t(7644),m=t(24215),x=t(34359),h=t(64565),g=t(98500),p=t.n(g),f=t(60207),j=t(70852),b=t.n(j);b().defaults.modes["rfc3986-non-unicode"]={replacement:"-",symbols:!1,remove:/[.]/g,lower:!0,charmap:b().charmap,multicharmap:b().multicharmap},b().defaults.modes["rfc3986-non-unicode-with-dots"]={replacement:"-",symbols:!1,lower:!0,charmap:b().charmap,multicharmap:b().multicharmap},b().defaults.modes["rfc3986-non-unicode-with-dots-no-lower"]={replacement:"-",symbols:!1,lower:!1,charmap:b().charmap,multicharmap:b().multicharmap},b().defaults.mode="rfc3986-non-unicode";let v=d.forwardRef((e,s)=>{let[t,r]=d.useState(null),g=d.useRef([]),j=d.useRef(!1),v=({children:e,...s})=>{let t=Number(s.node.tagName.match(/h(\d)/)?.slice(1));if(!t||!e||"string"!=typeof e[0])return d.createElement(s.node.tagName,s,e);{let a=function(e,s=!1,t=!1){return e=(0,f.transliterate)(e),s?b().defaults.mode="rfc3986-non-unicode-with-dots":t&&(b().defaults.mode="rfc3986-non-unicode-with-dots-no-lower"),e=b()(e),b().defaults.mode="rfc3986-non-unicode",e}(e[0]);return g.current.push({level:t,id:a,title:e[0]}),d.createElement(s.node.tagName,{id:a},e)}};return d.useImperativeHandle(s,()=>({getTOC:()=>g.current,getTocProcessed:()=>j.current})),d.useEffect(()=>{j.current=!0},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$,{remarkPlugins:[x.A],rehypePlugins:[m.A],components:{a:e=>{var s;return(s={href:e.href||"",children:e.children}).href.startsWith("/")||""===s.href||s.href.startsWith("#")?(0,a.jsx)(p(),{href:s.href,className:"cursor-pointer",children:s.children}):(0,a.jsxs)("a",{href:s.href,target:"_blank",rel:"noopener noreferrer",children:[s.children," ",(0,a.jsx)(h.A,{className:"inline w-3 h-3"})]})}
1,code:({node:e,inline:s,className:t,children:l,...r})=>{let i=/language-(\w+)/.exec(t||"");return!s&&i?(0,a.jsx)(c.A,{style:u.E1,language:i[1],PreTag:"div",...r,customStyle:{margin:0,borderRadius:0},children:String(l).replace(/\n$/,"")}):(0,a.jsx)("code",{className:n()({className:t,"inline-code":!0}),...r,children:l})},img:e=>(0,a.jsx)("img",{src:e.src,alt:e.alt,loading:"lazy",decoding:"async",onClick:()=>r("string"==typeof e.src?e.src:"")}),h2:v,h3:v,h4:v,h5:v,h6:v},children:e.markdown}),t&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 bg-black/30 flex items-center justify-center",onClick:()=>r(null),children:[(0,a.jsx)("button",{className:"absolute top-4 right-4 p-2 rounded-full bg-sand-1 hover:bg-sand-2 transition-colors",onClick:()=>r(null),children:(0,a.jsx)(l.raE,{className:"w-5 h-5"})}),(0,a.jsx)(i.P.img,{src:t,className:"max-w-[90vw] max-h-[90vh] rounded-lg shadow-lg",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2},onClick:e=>e.stopPropagation()})]})]})});v.displayName="Markdown"},54635:(e,s,t)=>{"use strict";t.d(s,{AX:()=>n,cQ:()=>l,cq:()=>i,dP:()=>r});var a=t(61763);let l=()=>(0,a.Jt)("note-tag-my"),r=e=>(0,a.bE)("note-tag",e),n=e=>(0,a.yJ)("note-tag",e),i=e=>(0,a.Fb)("note-tag",{id:e})},55195:(e,s,t)=>{"use strict";t.d(s,{m:()=>r,u:()=>n});var a=t(12115),l=t(4761);function r(){let[e,s]=a.useState(!1);return a.useEffect(()=>{s(!0)},[]),e}function n(){let e=a.useContext(l.s);if(!e)throw Error("useLang must be used within a LangProvider");return e}},57024:(e,s,t)=>{"use strict";t.d(s,{Button:()=>u});var a=t(95155),l=t(99271),r=t(44842),n=t.n(r),i=t(75909),d=t(12115),o=t(75806),c=t(72346);let u=d.forwardRef((e,s)=>{let{theme:t,block:r,children:u,loading:m,className:x,size:h,icon:g,rightIcon:p,align:f,color:j,onClick:b,withConfirm:v,confirmText:w,disabled:N,unsaved:y,...C}=e,[_,k]=d.useState(!1),A=d.Children.count(u)>0,S={small:A?"text-sm px-4 py-1 min-h-[1.75rem] min-w-[1.75rem]":"p-1 min-h-[1.75rem] min-w-[1.75rem]",middle:A?"text-sm px-5 py-2 min-h-[2.25rem] min-w-[2.25rem]":"p-2 min-h-[2.25rem] min-w-[2.25rem]",large:A?"text-sm px-6 py-3":"p-3",mini:A?"text-xs px-2":""}[h||"middle"],z=m?"invisible":"",L={left:"justify-start",center:"justify-center",right:"justify-end"}[f||"center"],I={left:"text-left",center:"text-center",right:"text-right"}[f||"center"];return(0,a.jsxs)("button",{ref:s,onClick:e=>{if(!N){if(v&&!_){k(!0),e.stopPropagation();return}!m&&b&&b(e)}},...C,className:(0,o.Q)(n()("group font-medium tracking-wide rounded-md cursor-default transition duration-150 relative active:transform active:scale-x-[0.985] active:scale-y-[0.985] active:translate-y-[0.5px]",{default:"bg-sand-3 text-sand-12 hover:bg-sand-4 active:bg-sand-5",primary:"bg-sand-12 text-white hover:bg-black dark:text-sand-1 dark:hover:bg-white",ghost:"bg-transparent text-sand-11 hover:bg-sand-4 active:bg-sand-5",danger:"bg-red-3 text-red-11 hover:bg-red-4 active:bg-red-5",dangerGhost:"bg-transparent text-red-11 hover:bg-red-4 active:bg-red-5",amber:"bg-amber-3 hover:bg-amber-4 active:bg-amber-5 text-amber-12"}[t||"default"],S,r?"w-full":"",N&&"opacity-50 cursor-not-allowed",x)),children:[_?(0,a.jsxs)(i.P.div,{className:n()(z,L,"flex items-center"),initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5},children:[(0,a.jsx)("div",{className:"mr-2 -ml-1 flex-shrink-0",children:(0,a.jsx)(l.A,{className:"w-4 h-4"})}),(0,a.jsx)("span",{className:n()({"tracking-wide select-none text-left text-sm":!0,textAlignClass:I,truncate:!w}),children:w||"Confirm"})]}):(0,a.jsxs)("div",{className:n()(z,L,"flex items-center"),children:[g&&(0,a.jsx)("div",{className:n()(A&&"mr-2 -ml-1 flex-shrink-0"),children:g}),(0,a.jsx)("span",{className:n()("tracking-wide select-none truncate",I,!!p&&"flex-1",A&&"w-full"),children:u}),p&&(0,a.jsx)("div",{className:n()(A&&"ml-2 -mr-1 flex-shrink-0"),children:p})]}),m&&(0,a.jsx)("div",{className:"absolute inset-0 flex justify-center items-center bg-white border border-sand-7 rounded-md",children:(0,a.jsx)(c.y,{className:"text-black w-3 h-3"})}),y&&!m&&(0,a.jsx)("div",{className:"absolute top-1 right-1",children:(0,a.jsx)("div",{className:"w-1 h-1 bg-yellow-9 rounded-full"})})]})});u.displayName="Button"},61763:(e,s,t)=>{"use strict";t.d(s,{Fb:()=>o,Jt:()=>c,Zd:()=>u,bE:()=>i,yJ:()=>d});
1var a=t(17302),l=t.n(a),r=t(66609);let n=l().create({baseURL:"/api"});n.interceptors.request.use(e=>e),n.interceptors.response.use(e=>{if(200===e.status){let{data:s}=e;return{success:!0,data:s}}return{success:!1,data:null}},e=>(console.log(">> error",e,e.response),e.response&&e.response.data.message&&(console.log("run toast>>"),r.toast.error(e.response.data.message)),{success:!1,data:null}));let i=(e,s)=>n.request({url:e,method:"POST",data:s||{}}),d=(e,s)=>n.request({url:e,method:"PUT",data:s||{}}),o=(e,s)=>n.request({url:e,method:"DELETE",data:s||{}}),c=(e,s)=>n.request({url:e,method:"GET",params:s}),u=(e,s)=>n({method:"POST",url:e,data:s,headers:{"Content-Type":"multipart/form-data"}})},64178:(e,s,t)=>{"use strict";t.d(s,{p:()=>i});var a=t(95155),l=t(44842),r=t.n(l),n=t(52457);let i=t(12115).forwardRef((e,s)=>{let{type:t="text",className:l,size:i,...d}=e;return(0,a.jsxs)("div",{className:"relative group w-full",children:[(0,a.jsx)("input",{ref:s,...d,type:t,className:r()("bg-sand-3 placeholder-sand-11 rounded-md hover:bg-sand-4 transition duration-150 outline-none focus:shadow-border-input focus:bg-transparent w-full text-base",{small:"text-sm px-2 py-1",medium:"text-sm px-4 py-2",large:"text-base px-4 py-2"}[i||"medium"],l)}),"datetime-local"===t&&(0,a.jsx)(n.A,{size:16,className:"absolute top-3 right-4 bg-sand-3 group-hover:bg-sand-4 pointer-events-none"})]})});i.displayName="Input"},64630:(e,s,t)=>{"use strict";t.d(s,{RS:()=>c,aX:()=>d,be:()=>n,ec:()=>u,is:()=>i,lW:()=>o,nB:()=>m});var a=t(66609),l=t(23068),r=t(11439);let n=(e,s,t)=>{if(t>=e.length){let s=t-e.length+1;for(;s--;)e.push(void 0)}e.splice(t,0,e.splice(s,1)[0])},i=(e,s)=>e?`https://${e}`:`https://${s}.ongridea.com`,d=e=>{try{return new URL(e).hostname}catch(s){return console.error("Invalid URL:",s),e}},o=e=>{navigator.clipboard.writeText(e).then(function(){a.toast.success("Copy successful")},function(e){a.toast.error("Copy failed")})},c=e=>({"zh-hans":"å è½½æ´å¤","zh-hant":"è¼å
¥æ´å¤",en:"Load more"})[e];function u(e,s){let t={[r.PU.Last24Hours]:"HH A",[r.PU.Last7Days]:"[Day] DD",[r.PU.Last14Days]:"[Day] DD"}[e];return console.log(">> result",l.Ay.utc(s).format(t)),l.Ay.utc(s).format(t)}function m(e,s=["m","s"],t=""){let a,l,r,{days:n,hours:i,minutes:d,seconds:o,ms:c}=(a=~~(e/86400),l=~~(e/3600)-24*a,r=~~(e/60)-1440*a-60*l,{days:a,hours:l,minutes:r,seconds:~~e-86400*a-3600*l-60*r,ms:(e-~~e)*1e3}),u="";return(n>0&&-1!==s.indexOf("d")&&(u+=`${n}d${t}`),i>0&&-1!==s.indexOf("h")&&(u+=`${i}h${t}`),d>0&&-1!==s.indexOf("m")&&(u+=`${d}m${t}`),o>0&&-1!==s.indexOf("s")&&(u+=`${o}s${t}`),c>0&&-1!==s.indexOf("ms")&&(u+=`${c}ms`),u)?u:`0${s[s.length-1]}`}},67582:(e,s,t)=>{"use strict";t.d(s,{s:()=>d});var a=t(95155),l=t(45230),r=t(12115),n=t(4348),i=t(57024);let d=e=>{let{colorTokens:s,onChange:t}=e,[d,o]=r.useState(e.value||"");return(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 items-center",children:[(0,a.jsx)("div",{className:"w-10 h-[72px] rounded-full border border-sand-6 shrink-0",style:{backgroundColor:`var(${d})`}}),(0,a.jsx)(i.Button,{size:"small",icon:(0,a.jsx)(l.A,{size:12}),theme:"ghost",onClick:()=>{o(""),t("")}})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 pl-2",children:s.map(e=>(0,a.jsx)("div",{className:(0,n.cn)("w-8 h-8 border-sand-6 border rounded-full cursor-pointer",d===e?"border-2 border-sand-12":""),style:{backgroundColor:`var(${e})`},onClick:()=>{o(e),t(e)}},e))})]})}},68604:(e,s,t)=>{"use strict";t.d(s,{l:()=>d});var a=t(95155),l=t(4402);t(12115);var r=t(57024),n=t(44842),i=t.n(n);let d=e=>
1{let{pressed:s,onPressedChange:t,disabled:n,icon:d}=e;return(0,a.jsx)(l.Root,{pressed:s,onPressedChange:t,asChild:!0,disabled:n,children:(0,a.jsx)(r.Button,{size:"small",theme:"ghost",className:i()({"text-blue-11":s,"rounded-none":!0}),icon:d})})}},72346:(e,s,t)=>{"use strict";t.d(s,{y:()=>l});var a=t(95155);let l=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",className:"text-sand-600",viewBox:"0 0 2400 2400",width:24,height:24,...e,children:(0,a.jsxs)("g",{strokeWidth:200,strokeLinecap:"round",stroke:"currentColor",fill:"none",children:[(0,a.jsx)("path",{d:"M1200 600L1200 100"}),(0,a.jsx)("path",{opacity:.5,d:"M1200 2300L1200 1800"}),(0,a.jsx)("path",{opacity:.917,d:"M900 680.4L650 247.4"}),(0,a.jsx)("path",{opacity:.417,d:"M1750 2152.6L1500 1719.6"}),(0,a.jsx)("path",{opacity:.833,d:"M680.4 900L247.4 650"}),(0,a.jsx)("path",{opacity:.333,d:"M2152.6 1750L1719.6 1500"}),(0,a.jsx)("path",{opacity:.75,d:"M600 1200L100 1200"}),(0,a.jsx)("path",{opacity:.25,d:"M2300 1200L1800 1200"}),(0,a.jsx)("path",{opacity:.667,d:"M680.4 1500L247.4 1750"}),(0,a.jsx)("path",{opacity:.167,d:"M2152.6 650L1719.6 900"}),(0,a.jsx)("path",{opacity:.583,d:"M900 1719.6L650 2152.6"}),(0,a.jsx)("path",{opacity:.083,d:"M1750 247.4L1500 680.4"}),(0,a.jsx)("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",keyTimes:"0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667",values:"0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199",dur:"0.83333s",begin:"0s",repeatCount:"indefinite",calcMode:"discrete"})]})});l.displayName="Spinner"},80584:(e,s,t)=>{"use strict";t.d(s,{p:()=>r});var a=t(60150),l=t(54635);let r=(0,a.vt)()(e=>({noteTags:[],currentTagId:"",fetchNoteTags:async()=>{let s=await (0,l.cQ)();s.success&&s.data&&e({noteTags:s.data})},updateCurrentTagId:s=>{e({currentTagId:s})}}))},83458:(e,s,t)=>{"use strict";t.d(s,{g:()=>l});var a=t(95155);let l=({size:e,color:s})=>(0,a.jsxs)("svg",{className:{light:"fill-sand-12",dark:"fill-sand-1"}[s||"light"],width:e||32,height:e||32,viewBox:"0 0 310 310",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M270.087 154.06C273.541 154.038 275.268 154.027 276.64 154.785C277.693 155.366 278.657 156.394 279.169 157.482C279.836 158.901 279.722 160.504 279.493 163.71C277.775 187.778 269.119 210.911 254.471 230.259C237.862 252.198 214.478 268.044 187.945 275.338C161.413 282.632 133.214 280.968 107.724 270.603C82.2342 260.237 60.8765 241.751 46.9639 218.01C33.0513 194.269 27.3612 166.601 30.7762 139.297C34.1912 111.992 46.5204 86.578 65.8516 66.9951C85.1828 47.4122 110.436 34.7552 137.693 30.9873C161.732 27.6643 186.145 31.4185 207.982 41.6826C210.891 43.0501 212.346 43.7338 213.257 45.0091C213.956 45.9878 214.382 47.3309 214.375 48.5336C214.365 50.101 213.511 51.6021 211.804 54.6043L211.505 55.129C209.792 58.1418 208.935 59.6481 207.777 60.4329C206.781 61.1075 205.816 61.4215 204.614 61.462C203.215 61.5092 201.49 60.7295 198.04 59.17C180.069 51.0465 160.104 48.1237 140.438 50.8422C117.551 54.006 96.3475 64.6334 80.1161 81.0762C63.8846 97.519 53.5324 118.858 50.665 141.784C47.7976 164.71 52.5753 187.942 64.257 207.876C75.9387 227.81 93.8717 243.332 115.274 252.035C136.677 260.738 160.354 262.136 182.632 256.011C204.91 249.887 224.545 236.582 238.491 218.161C250.474 202.332 257.681 183.486 259.377 163.837C259.703 160.065 259.866 158.179 260.59 156.982C261.213 155.953 261.959 155.264 263.034 154.725C264.285 154.098 266.018 154.087 269.484 154.064L270.087 154.06Z"}),(0,a.jsx)("path",{d:"M228.585 66.2278C230.795 63.574 231.9 62.247 233.364 61.6871C234.487 61.2574 235.895 61.1841 237.057 61.4947C238.571 61.8994 239.722 63.0207 242.025 65.2633C243.354 66.5579 244.654 67.8819 245.924 69.2343C248.125 71.5772 249.225 72.7487 249.602 74.2701C249.892 75.4375 249.793 76.8431 249.343 77.9585C248.756 79.4121 247.41 80.493 244.716 82.6547L244.245 83.0326C241.542 85.202 240.19 86.2867 238.824 86.5894C237.65 86.8496 236.637 86.786 235.505 86.3807C234.187 85.9093 232.871 84.5489 230.239 81.8282C229.878 81.4554 229.514 81.0853 229.148 80.7178C226.476 78.0365 225.139 76.6958 224.692 75.37C224.307 74.2304 224.262 73.2165 224.544 72.0471C224.871 70.6867 225.98 69.3551 228.198 66.6918L228.585 66.2278Z"}),(0,a.jsx)("path",{d:"M228.585 66.2278C230.795 63.574 231.9 62.247 233.364 61.6871C234.487 61.2574 235.895 61.1841 237.057 61.4947C238.571 61.8994 239.722 63.0207 242.025 65.2633C243.354 66.5579 244.654 67.8819 245.924 69.2343C248.125 71.5772 249.225 72.7487 249.602 74.2701C249.892 75.4375 249.793 76.8431 249.343 77.9585C248.756 79.4121 247.41 80.493 244.716 82.6547L244.245 83.0326C241.542 85.202 240.19 86.2867 238.824 86.5894C237.65 86.8496 236.637 86.786 235.505 86.3807C234.187 85.9093 232.871 84.5489 230.239 81.8282C229.878 81.4554 229.514 81.0853 229.148 80.7178C226.476 78.0365 225.139 76.6958 224.692 75.37C224.307 74.2304 224.262 73.2165 224.544 72.0471C224.871 70.6867 225.98 69.3551 228.198 66.6918L228.585 66.2278Z"}),(0,a.jsx)("path",{d:"M100.809 154.881C100.786 151.407 100.775 149.67 101.464 148.349C102.02 147.282 102.883 146.407 103.942 145.838C105.255 145.132 106.992 145.12 110.465 145.098L271.171 144.053C273.564 144.038 274.761 144.03 275.726 144.36C277.453 144.952 278.817 146.298 279.431 148.018C279.774 148.978 279.782 150.175 279.798 152.569V152.569C279.818 155.76 279.829 157.356 279.388 158.642C278.599 160.945 276.804 162.764 274.511 163.583C273.231 164.04 271.635 164.05 268.443 164.071L110.595 165.097C107.122 165.12 105.385 165.131 104.063 164.442C102.997 163.886 102.122 163.023 101.552 161.964C100.846 160.651 100.835 158.914 100.812 155.441L100.809 154.881Z"}),(0,a.jsx)("path",{d:"M162.687 155.832C160.143 153.466 158.872 152.284 158.382 150.876C157.987 149.74 157.943 148.511 158.255 147.35C158.641 145.91 159.824 144.639 162.19 142.095L208.678 92.1169C211.044 89.5735 212.227 88.3018 213.635 87.8124C214.771 87.4174 215.999 87.3729 217.161 87.6848C2
118.6 88.0712 219.872 89.2542 222.416 91.62L222.826 92.0014C225.369 94.3672 226.641 95.5501 227.13 96.9578C227.525 98.0939 227.57 99.3224 227.258 100.484C226.871 101.923 225.688 103.195 223.323 105.739L176.834 155.717C174.468 158.26 173.285 159.532 171.878 160.021C170.742 160.416 169.513 160.461 168.351 160.149C166.912 159.762 165.64 158.579 163.097 156.214L162.687 155.832Z"}),(0,a.jsx)("path",{d:"M123.117 201.114C120.574 198.748 119.302 197.566 118.813 196.158C118.418 195.022 118.373 193.793 118.685 192.632C119.071 191.192 120.254 189.92 122.62 187.377L156.527 150.925C158.893 148.381 160.076 147.11 161.484 146.62C162.62 146.225 163.848 146.181 165.01 146.492C166.449 146.879 167.721 148.062 170.264 150.428L170.674 150.809C173.218 153.175 174.49 154.358 174.979 155.766C175.374 156.902 175.418 158.13 175.107 159.292C174.72 160.731 173.537 162.003 171.171 164.546L137.264 200.999C134.898 203.542 133.716 204.814 132.308 205.303C131.172 205.698 129.943 205.743 128.782 205.431C127.342 205.044 126.07 203.861 123.527 201.496L123.117 201.114Z"})]})},83578:(e,s,t)=>{"use strict";t.d(s,{Tooltip:()=>i});var a=t(95155),l=t(40623),r=t(44842),n=t.n(r);let i=t(12115).forwardRef((e,s)=>(0,a.jsx)(l.Provider,{children:(0,a.jsxs)(l.Root,{children:[(0,a.jsx)(l.Trigger,{asChild:!0,children:e.children}),(0,a.jsx)(l.Portal,{children:(0,a.jsx)(l.Content,{sideOffset:2,className:n()("radix-side-top:animate-slide-down-fade","radix-side-right:animate-slide-left-fade","radix-side-bottom:animate-slide-up-fade","radix-side-left:animate-slide-right-fade","inline-flex items-center rounded-md px-3 py-2","bg-white dark:bg-sand-3 shadow-onWhite dark:shadow-onWhite-dark z-50"),children:(0,a.jsx)("div",{className:"block text-xs leading-none text-sand-11",children:e.content})})})]})}));i.displayName="Tooltip"},88429:(e,s,t)=>{"use strict";t.d(s,{Ae:()=>l,Kr:()=>
1o,Wr:()=>r,hj:()=>n,qi:()=>c,sn:()=>d,x_:()=>i});var a=t(61763);let l=e=>(0,a.bE)("site",e),r=()=>(0,a.Jt)("site-my"),n=e=>(0,a.yJ)("site",e),i=e=>(0,a.Fb)("site",e),d=e=>(0,a.bE)("domain",e),o=e=>(0,a.Fb)("domain",e),c=e=>(0,a.yJ)("domain",e)},94466:(e,s,t)=>{var a={"./en/analytics.json":[97643,7643],"./en/common.json":[3374,3374],"./en/dashboard.json":[7027,7027],"./en/design.json":[69753,9753],"./en/dialog.json":[17667,7667],"./en/forgot-password.json":[96532,6532],"./en/home.json":[42796,2796],"./en/login.json":[72962,2962],"./en/meta.json":[74074,4074],"./en/note.json":[51927,1927],"./en/post_and_page_new.json":[25532,5532],"./en/posts_and_pages.json":[12805,2805],"./en/pricing.json":[689,689],"./en/register.json":[53126,3126],"./en/setting.json":[30983,983],"./en/site.json":[25376,2995],"./en/tag.json":[51731,1731],"./zh/analytics.json":[22230,2230],"./zh/common.json":[1953,1953],"./zh/dashboard.json":[23382,3382],"./zh/design.json":[43970,3970],"./zh/dialog.json":[49e3,9e3],"./zh/forgot-password.json":[43369,3369],"./zh/home.json":[4687,4687],"./zh/login.json":[44107,4107],"./zh/meta.json":[82925,2925],"./zh/note.json":[82980,2980],"./zh/post_and_page_new.json":[94321,4321],"./zh/posts_and_pages.json":[30924,924],"./zh/pricing.json":[91260,1260],"./zh/register.json":[21261,1261],"./zh/setting.json":[51238,1238],"./zh/site.json":[79175,9175],"./zh/tag.json":[10534,534]};function l(e){if(!t.o(a,e))return Promise.resolve().then(()=>{var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s});var s=a[e],l=s[0];return t.e(s[1]).then(()=>t.t(l,19))}l.keys=()=>Object.keys(a),l.id=94466,e.exports=l}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.