1import{_ as S}from"./Cbl7aF_S.js";import{d as E,c as v,a as t,g as s,j as l,n as x,C as M,aI as T,L as y,F as z,r as B,h as A,l as k,o as _,t as u,R as D,V as H,as as N,f as R,w as b,k as V,K as W,S as j}from"./BVOEmJK6.js";import{h as F,u as I,E as q}from"./BqvdS3Ps.js";import{u as K}from"./C1dYCDaE.js";import{C as P}from"./BAcGYlN7.js";import{E as U}from"./Nyd5OZJB.js";import"./DMK55Ao3.js";import"./bJ9dph_C.js";import"./BQD7A6eJ.js";import"./BZiT0Hcg.js";import"./DZSmiyls.js";import"./DtARhy1i.js";import"./rpE5ceHv.js";import"./C4rODWJp.js";import"./31gkuqJQ.js";import"./oEZJT27w.js";import"./uuGBZq06.js";import"./uRtRR_6j.js";import"./C5ozpDii.js";import"./D_wKU-Sh.js";import"./CSRMssFX.js";import"./BlhwQgEQ.js";const Y={class:"flex flex-col gap-y-3"},G=["onClick"],C=284,J=E({__name:"index",props:{editor:{},data:{default:()=>[]},ui:{}},emits:["handle-click"],setup(n,{emit:c}){const f=n,i=k(!0),d=p=>{const o=f.editor;if(o){const m=p.id,e=o.view.dom.querySelector(`[data-toc-id="${m}"`);if(e){const a=o.view.posAtDOM(e,0),r=o.view.state.tr;r.setSelection(new F(r.doc.resolve(a))),o.view.dispatch(r),o.view.focus(),window.scrollTo({top:Math.max(e.getBoundingClientRect().top+window.scrollY-180,120),behavior:"smooth"})}}};return(p,o)=>{const m=S;return _(),v("div",{class:x(s(A)("transition-all sticky overflow-hidden hidden xl:block","h-[calc(100vh-140px)] top-[140px]",n.ui?.warpper)),style:y({width:s(i)?`${C}px`:"150px"})},[t("div",Y,[t("button",{onClick:o[0]||(o[0]=e=>i.value=!s(i)),class:"flex items-center gap-x-2 text-gray-900 hover:bg-opacity-10 hover:bg-gray-900 p-1 self-start transition-all rounded font-semibold text-13"},[l(m,{icon:"icon-exit",class:x({"rotate-180":!s(i)})},null,8,["class"])]),M(t("ul",{class:"flex flex-col gap-y-3 text-start pr-8 pl-2 overflow-y-auto scrollbar text-sm h-full",style:y({width:C+"px"})},[(_(!0),v(z,null,B(n.data,(e,a)=>(_(),v("li",{class:x(["relative before:absolute before:top-1/2 before:-translate-y-1/2 before:-left-2 before:h-[70%] before:w-1 before:rounded-xl",{"font-semibold":e.originalLevel<3,"before:bg-secondary":e.isScrolledOver&&!n.data[a+1]?.isScrolledOver}]),style:y({paddingLeft:`${Math.max(e.originalLevel-2,0)*8}px`})},[t("a",{role:"button",class:x(["text-start hover:text-secondary",{"text-secondary":e.isScrolledOver&&!n.data[a+1]?.isScrolledOver}]),onClick:r=>d(e)},u(e.textContent),11,G)],6))),256))],4),[[T,s(i)]])])],6)}}}),Q={class:"flex flex-col gap-y-5"},X={class:"flex justify-between px-10 py-5 border-b border-gray-300 sticky top-0 bg-[var(--light-white-color)] left-0 z-[2024] max-h-[80px]"},Z={class:"flex items-center gap-x-2 text-15"},tt={class:"line-clamp-2"},et={class:"flex-1"},ot={class:"flex-1 flex px-5"},st={class:"bg-white py-15 px-10 flex-1"},rt={class:"h2 mb-6 essay-title","aria-essay":"title"},it=["innerHTML"],at={__name:"index",async setup(n){let c,f;K({title:"writergpt-writer-e.title",description:"writergpt-writer-e.description"});const i=H(),{essay_info:d}=i.params,p=k([]),o=d?.title??"",m=d?.essay??"",e=d?.cite_html,a=I({...P,content:m,editable:!1,extensions:([c,f]=N(()=>U({TableOfContents:{onUpdate:r=>{p.value=r.map(({editor:h,node:g,...w})=>w)}},Cite:{disabled:!0}},{excludes:["dragHandle","continuation","placeholder"]})),c=await c,f(),c),onCreate({editor:r}){r.view.dom.removeAttribute("translate")}});return(r,h)=>{const g=S,w=V,$=W,L=q,O=j;return _(),R(O,{name:"preview"},{default:b(()=>[t("main",Q,[t("header",X,[t("div",Z,[l(g,{class:"text-secondary size-9",icon:"icon-article"}),t("p",tt,u(s(o)),1)]),l($,{to:"/writergpt/writer",class:"py-2 px-5 text-15 text-white font-semibold gap-x-1 bg-secondary flex items-center rounded-md self-center hover:shadow-btn transition-all"},{default:b(()=>[t("span",et,u(r.$t("writergpt-writer-e.try-yourself")),1),l(w,{icon:"icon-arrow-left",class:"rotate-180 size-4"})]),_:1})]),t("section",ot,[l(J,{data:s(p),editor:s(a),ui:{warpper:"top-[100px] h-[calc(100vh-100px)]"}},null,8,["data","editor"]),t("div",st,[t("h1",rt,u(s(o)),1),l(L,{class:"tiptap-editor bg-white text-15 mt-6",editor:s(a)},null,8,["editor"]),t("div",{"aria-style":"reference",class:"flex flex-col gap-y-4 mt-15 reference",innerHTML:s(e)},null,8,it)]),h[0]||(h[0]=t("div",{class:"w-[284px]"},null,-1))])])]),_:1})}}},Et=D(at,[["__scopeId","data-v-0f87078b"]]);export{Et as default};
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.