PageSourceSearch

https://hyrenora.com/_next/static/chunks/9856.868b70cbccf8bf36.js

js hyrenora.com collected 2026-10-02 01:33:03 UTC 10,689 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a051ebfd-b9a3-4825-bc80-fbfde83ebf3d",e._sentryDebugIdIdentifier="sentry-dbid-a051ebfd-b9a3-4825-bc80-fbfde83ebf3d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9856],{12661:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(22135).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},49856:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(38448),s=l(59580),d=l(44162),n=l(2272),o=l(928),r=l(27896),c=l(47972),i=l(72832),x=l(12661),u=l(68337),m=l(85773);let b=[{key:"product",label:"Product"},{key:"setup-tpo",label:"Setup — TPO"},{key:"setup-student",label:"Setup — Student"},{key:"accounts",label:"Accounts & Billing"},{key:"troubleshooting",label:"Troubleshooting"},{key:"sales",label:"Sales"},{key:"it-runbook",label:"IT Runbook"}],p=Object.fromEntries(b.map(e=>[e.key,e.label])),h=["all","rep","it","sales","onboarding"],g={title:"",category:"product",audience:"all",body:""};function f(e){var t;let{onSwitchToLearn:l,onSwitchToSkills:f}=e,[y,k]=(0,s.useState)([]),[j,w]=(0,s.useState)(""),[v,N]=(0,s.useState)(""),[C,A]=(0,s.useState)(null),[S,B]=(0,s.useState)([]),[D,I]=(0,s.useState)(null),[_,L]=(0,s.useState)(!1),T=(0,s.useCallback)(async()=>{var e;let t=new URLSearchParams;j&&t.set("category",j),v.trim()&&t.set("q",v.trim());let l=await fetch("/api/workspace/knowledge/docs?".concat(t));k(null!=(e=(await l.json().catch(()=>({docs:[]}))).docs)?e:[])},[j,v]);(0,s.useEffect)(()=>{T()},[T]);let z=async e=>{let t=await fetch("/api/workspace/knowledge/docs/".concat(e)),l=await t.json().catch(()=>null);if(null==l?void 0:l.doc){var a;A(l.doc),B(null!=(a=l.backlinks)?a:[]),I(null)}},M=async e=>{var t;let l=await fetch("/api/workspace/knowledge/docs?q=".concat(encodeURIComponent(e))),a=null!=(t=(await l.json().catch(()=>({docs:[]}))).docs)?t:[],s=a.find(t=>t.title.toLowerCase()===e.toLowerCase()||t.slug===e.toLowerCase()),d=null!=s?s:a[0];d&&z(d.id)},P=async()=>{if(D&&D.title.trim()&&D.body.trim()){L(!0);try{let e=D.id?"/api/workspace/knowledge/docs/".concat(D.id):"/api/workspace/knowledge/docs",t=await fetch(e,{method:D.id?"PATCH":"POST",headers:{"content-type":"application/json"},body:JSON.stringify(D)}),l=await t.json().catch(()=>null);(null==l?void 0:l.doc)&&(A(l.doc),I(null),T())}finally{L(!1)}}};return(0,a.jsx)("div",{className:"min-h-screen",style:{background:"#F7F6F3"},children:(0,a.jsxs)("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[(0,a.jsxs)("div",{className:"mb-6 flex items-center gap-2.5",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg",style:{background:"linear-gradient(135deg, #0B1033 0%, #FB5A2D 100%)"},children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-white"})}),(0,a.jsx)("h1",{className:"text-xl font-bold text-black",children:"Knowledge Hub"}),(0,a.jsxs)("div",{className:"ml-4 flex rounded-lg border border-slate-200 bg-white p-0.5 text-sm",children:[(0,a.jsx)("button",{onClick:l,className:"rounded-md px-3 py-1 text-slate-500 hover:text-slate-800",children:"Learn"}),(0,a.jsx)("button",{className:"rounded-md bg-[#0B1033] px-3 py-1 font-medium text-white",children:"Team Docs"}),(0,a.jsx)("button",{onClick:f,className:"rounded-md px-3 py-1 text-slate-500 hover:text-slate-800",children:"Agent Skills"})]}),(0,a.jsxs)("button",{onClick:()=>{I({...g}),A(null)},className:"ml-auto flex items-center gap-1 rounded-lg bg-[#FB5A2D] px-3 py-1.5 text-sm font-semibold text-white hover:bg-[#e14e24]",children:[(0,a.jsx)(r.A,{className:"h-4 w-4"}),"New doc"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[220px_1fr]",children:[(0,a.jsxs)("aside",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-slate-400"}
1),(0,a.jsx)("input",{value:v,onChange:e=>{N(e.target.value),A(null),B([])},placeholder:"Search docs",className:"w-full bg-transparent text-sm outline-none"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-slate-200 bg-white p-1 text-sm",children:[(0,a.jsx)("button",{onClick:()=>{w(""),A(null),B([]),I(null)},className:"block w-full rounded-md px-2.5 py-1.5 text-left ".concat(""===j?"bg-slate-100 font-medium":"text-slate-600 hover:bg-slate-50"),children:"All"}),b.map(e=>(0,a.jsx)("button",{onClick:()=>{w(e.key),A(null),B([]),I(null)},className:"block w-full rounded-md px-2.5 py-1.5 text-left ".concat(j===e.key?"bg-slate-100 font-medium":"text-slate-600 hover:bg-slate-50"),children:e.label},e.key))]})]}),(0,a.jsx)("main",{className:"min-w-0",children:D?(0,a.jsxs)("div",{className:"rounded-xl border border-slate-200 bg-white p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,a.jsx)("input",{value:D.title,onChange:e=>I(t=>t&&{...t,title:e.target.value}),placeholder:"Title",className:"flex-1 rounded-lg border border-slate-200 px-3 py-2 text-sm font-semibold outline-none"}),(0,a.jsx)("button",{onClick:()=>I(null),className:"rounded-lg p-2 text-slate-400 hover:bg-slate-100",children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"mb-3 flex gap-2",children:[(0,a.jsx)("select",{value:D.category,onChange:e=>I(t=>t&&{...t,category:e.target.value}),className:"rounded-lg border border-slate-200 px-2 py-1.5 text-sm",children:b.map(e=>(0,a.jsx)("option",{value:e.key,children:e.label},e.key))}),(0,a.jsx)("select",{value:D.audience,onChange:e=>I(t=>t&&{...t,audience:e.target.value}),className:"rounded-lg border border-slate-200 px-2 py-1.5 text-sm capitalize",children:h.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),(0,a.jsx)("textarea",{value:D.body,onChange:e=>I(t=>t&&{...t,body:e.target.value}),placeholder:"Markdown body…",rows:16,className:"w-full rounded-lg border border-slate-200 p-3 font-mono text-sm outline-none"}),(0,a.jsx)("div",{className:"mt-3 flex justify-end",children:(0,a.jsxs)("button",{onClick:P,disabled:_||!D.title.trim()||!D.body.trim(),className:"flex items-center gap-1 rounded-lg bg-[#0B1033] px-4 py-2 text-sm font-semibold text-white disabled:opacity-40",children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),_?"Saving…":"Save"]})})]}):C?(0,a.jsxs)("article",{className:"rounded-xl border border-slate-200 bg-white p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>{A(null),B([])},className:"flex items-center gap-1 text-sm text-slate-500 hover:text-slate-800",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"}),"Back"]}),(0,a.jsx)("span",{className:"rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-500",children:null!=(t=p[C.category])?t:C.category}),"obsidian"===C.source?(0,a.jsx)("span",{className:"ml-auto rounded-full bg-violet-50 px-2 py-0.5 text-[11px] font-medium text-violet-600",title:"Source of truth is the Obsidian vault — edit it there; HQ edits would be overwritten on the next sync.",children:"⟳ synced from Obsidian"}):(0,a.jsxs)("button",{onClick:()=>I({id:C.id,title:C.title,category:C.category,audience:C.audience,body:C.body}),className:"ml-auto flex items-center gap-1 text-sm text-slate-500 hover:text-slate-800",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),"Edit"]})]}),(0,a.jsx)("h2",{className:"mb-3 text-2xl font-bold text-black",children:C.title}),(0,a.jsx)("div",{className:"prose prose-sm max-w-none prose-headings:font-semibold prose-a:text-[#FB5A2D] prose-table:text-sm",children:(0,a.jsx)(d.oz,{remarkPlugins:[n.A],components:{a:e=>{let{href:t,children:l}=e;return(null==t?void 0:t.startsWith("wl:"))?(0,a.jsx)("a",{role:"link",tabIndex:0,className:"cursor-pointer text-[#0B1033] underline decoration-dotted underline-offset-2 hover:
1decoration-solid",onClick:e=>{e.preventDefault(),M(decodeURIComponent(t.slice(3)))},children:l}):(0,a.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:l})}},children:C.body.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,t,l)=>"[".concat((null!=l?l:t).trim(),"](wl:").concat(encodeURIComponent(t.trim()),")"))})}),S.length>0&&(0,a.jsxs)("div",{className:"mt-6 border-t border-slate-100 pt-3",children:[(0,a.jsx)("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Linked from"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:S.map(e=>(0,a.jsx)("button",{onClick:()=>z(e.id),className:"rounded-full border border-slate-200 px-2.5 py-1 text-xs text-slate-600 hover:border-slate-300 hover:bg-slate-50",children:e.title},e.id))})]}),C.updatedBy&&(0,a.jsxs)("p",{className:"mt-6 border-t border-slate-100 pt-3 text-xs text-slate-400",children:["Updated by ",C.updatedBy," \xb7 ",new Date(C.updatedAt).toLocaleDateString()]})]}):(0,a.jsxs)("div",{className:"space-y-2",children:[0===y.length&&(0,a.jsx)("p",{className:"rounded-xl border border-dashed border-slate-200 bg-white p-8 text-center text-sm text-slate-400",children:"No docs here yet."}),y.map(e=>{var t;return(0,a.jsxs)("button",{onClick:()=>z(e.id),className:"block w-full rounded-xl border border-slate-200 bg-white p-4 text-left hover:border-slate-300 hover:shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-black",children:e.title}),(0,a.jsx)("span",{className:"rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-medium text-slate-500",children:null!=(t=p[e.category])?t:e.category}),"all"!==e.audience&&(0,a.jsx)("span",{className:"rounded-full bg-[#0B1033]/5 px-2 py-0.5 text-[10px] font-medium capitalize text-[#0B1033]",children:e.audience})]}),(0,a.jsx)("p",{className:"mt-1 line-clamp-2 text-sm text-slate-500",children:e.excerpt})]},e.id)})]})})]})]})})}},68337:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(22135).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},72832:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(22135).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},85773:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(22135).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])}}]);

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.