PageSourceSearch

https://www.innersophist.com/_next/static/chunks/pages/inneradmin/dashboard/content-bffbdd03277ac763.js

js innersophist.com collected 2026-10-02 01:34:39 UTC 16,446 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[303,570,2684],{576:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(37876),l=s(77328),n=s.n(l),r=s(48230),i=s.n(r),d=s(14232),c=s(1876),o=s(12683),x=s(96035);function u(e){let{dataset:t}=e;if(!["plus_pages","plus_books"].includes(t))return null;let s="plus_books"===t,l="/inneradmin/dashboard/plus/".concat(s?"books":"pages");return(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-4 rounded border border-is-border bg-is-surface p-4 text-sm",children:[(0,a.jsxs)(i(),{href:"".concat(l,"/add"),className:"font-semibold text-is-primary underline",children:["Add Plus ",s?"Book":"Page"]}),(0,a.jsxs)(i(),{href:l,className:"text-is-primary underline",children:["Manage Plus ",s?"Books":"Pages"]}),(0,a.jsx)("p",{className:"text-is-text-muted",children:"Copy, assets and lifecycle are available in the Plus sidebar. This dataset remains available for translations and advanced edits."})]})}var p=s(25027);function m(){var e;let{currentUser:t}=(0,o.A)(),[s,l]=(0,d.useState)(null),[r,m]=(0,d.useState)("coloring_pages"),[h,g]=(0,d.useState)(""),[b,j]=(0,d.useState)(""),[y,f]=(0,d.useState)(1),[N,v]=(0,d.useState)(null),[w,k]=(0,d.useState)(null),[S,C]=(0,d.useState)(!1),[_,A]=(0,d.useState)(""),[O,P]=(0,d.useState)(!1),T=(0,d.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=await t.getIdToken();return fetch(e,{...s,headers:{...s.headers||{},Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}})},[t]);(0,d.useEffect)(()=>{t&&T("/api/admin/content").then(async e=>{var t;let s=await e.json();if(!e.ok)throw Error(s.error||"HTTP ".concat(e.status));l(s.data),A(((null==(t=s.data)?void 0:t.translationTargets)||[]).join(", "))}).catch(e=>k(e.message||"Failed to load content registry"))},[t,T]);let E=(0,d.useCallback)(async()=>{if(t){C(!0),k(null);try{let e=new URLSearchParams({search:h,page:String(y),filter:b}),t=await T("/api/admin/content/".concat(r,"?").concat(e)),s=await t.json();if(!t.ok)throw Error(s.error||"HTTP ".concat(t.status));v(s.data)}catch(e){k(e.message),v(null)}finally{C(!1)}}},[t,T,r,h,y,b]);(0,d.useEffect)(()=>{E()},[E]);let J=async()=>{P(!0);try{var e;let t=await T("/api/admin/settings"),s=await t.json();if(!t.ok)throw Error(s.error||"HTTP ".concat(t.status));let a=_.split(",").map(e=>e.trim()).filter(Boolean),n=await T("/api/admin/settings",{method:"PUT",body:JSON.stringify({geminiModel:s.data.geminiModel,translationTargets:a})}),r=await n.json();if(!n.ok)throw Error(r.error||"Save failed");let i=await T("/api/admin/content"),d=await i.json();if(!i.ok)throw Error(d.error||"HTTP ".concat(i.status));l(d.data),A(((null==(e=d.data)?void 0:e.translationTargets)||[]).join(", "))}catch(e){k(e.message)}finally{P(!1)}},I=null==s||null==(e=s.datasets)?void 0:e.find(e=>e.id===r);return(0,a.jsxs)(c.default,{children:[(0,a.jsx)(n(),{children:(0,a.jsx)("title",{children:"Content & Translations | Admin"})}),(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Content & Translations"}),(0,a.jsx)(i(),{href:"/inneradmin/dashboard/content/catalogs",className:"text-blue-600 underline text-sm",children:"Static catalogs →"})]}),s&&(0,a.jsxs)("div",{className:"bg-white rounded shadow p-3 mb-4 text-sm",children:[(0,a.jsx)("span",{className:"font-semibold mr-2",children:"Locales:"}),s.locales.map(e=>(0,a.jsxs)("span",{className:"inline-block mr-2 px-2 py-0.5 rounded text-xs ".concat(e.isSource?"bg-blue-100":e.isPublic?"bg-green-100":"bg-yellow-100"),children:[e.code," — ",e.label," ",e.isSource?"(source)":e.isPublic?"(public)":"(planned)"]},e.code)),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 ml-3",children:[(0,a.jsx)("input",{value:_,onChange:e=>A(e.target.value),placeholder:"es, fr, de",className:"border rounded px-2 py-0.5 text-xs w-40"}),(0,a.jsx)("button",{type:"button",onClick:J,disabled:O,className:"bg-gray-800 text-white text-xs px-2 py-1 rounded disabled:opacity-50",children:O?"Saving…":"Save targets"})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4 items-center",children:[(0,a.jsx)("select",{value:r,onChange:e=>{m(e.target.value),f(1)},className:"border rounded px-2 py-1.5 text-sm",children:((null==s?void 0:s.datasets)||[]).map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.label," (",e.id,")"]},e.id))}),(0,a.jsx)("input",{value:h,onChange:e=>{g(e.target.value),f(1)},placeholder:"Search…",className:"border rounded px-2 py-1.5 text-sm w-56"}),(0,a.jsxs)("select",{value:b,onChange:e=>{j(e.target.value),f(1)},className:"border rounded px-2 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"All"}),(0,a.jsx)("option",{value:"missing-content",children:"Missing content"}),(0,a.jsx)("option",{value:"missing-translation",children:"Missing translation"}),(0,a.jsx)("option",{value:"stale-translation",children:"Stale translation"})]})]}),("plus_pages"===r||"plus_books"===r)&&t&&(0,a.jsx)(u,{dataset:r,currentUser:t}),"plus_pages"===r&&t&&(0,a.jsx)(p.A,{currentUser:t,onScheduled:E}),w&&(0,a.jsx)("p",{className:"text-red-600 text-sm mb-3",children:w}),S&&(0,a.jsx)("p",{className:"text-gray-500 text-sm",children:"Loading…"}),N&&(0,a.jsxs)("div",{className:"bg-white rounded shadow overflow-x-auto",children:[(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-gray-500 border-b",children:[((null==I?void 0:I.listFields)||[]).map(e=>(0,a.jsx)("th",{className:"p-2",children:e},e)),(0,a.jsx)("th",{className:"p-2",children:"v"}),(0,a.jsx)("th",{className:"p-2",children:"missing"}),(0,a.jsx)("th",{className:"p-2",children:"translations"}),(0,a.jsx)("th",{className:"p-2"})]})}),(0,a.jsx)("tbody",{children:N.items.map(e=>(0,a.jsxs)("tr",{className:"border-b hover:bg-gray-50",children:[((null==I?void 0:I.listFields)||[]).map(t=>{var s;return(0,a.jsx)("td",{className:"p-2 max-w-[240px] truncate",children:String(null!=(s=e.fields[t])?s:"")},t)}),(0,a.jsxs)("td",{className:"p-2 font-mono",children:["v",e.version]}),(0,a.jsx)("td",{className:"p-2",children:e.missingContent?(0,a.jsx)("span",{className:"text-orange-600 text-xs font-semibold",children:"missing"}):"—"}),(0,a.jsx)("td",{className:"p-2",children:(0,a.jsx)(x.w0,{localeStatus:e.localeStatus||{}})}),(0,a.jsx)("td",{className:"p-2",children:(0,a.jsx)(i(),{href:"/inneradmin/d
1ashboard/content/".concat(r,"/").concat(e._id),className:"text-blue-600 underline",children:"edit"})})]},e._id))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 p-2 text-sm",children:[(0,a.jsx)("button",{type:"button",disabled:y<=1,onClick:()=>f(y-1),className:"border rounded px-2 py-1 disabled:opacity-40",children:"‹ Prev"}),(0,a.jsxs)("span",{children:["Page ",N.page," \xb7 ",N.total," documents"]}),(0,a.jsx)("button",{type:"button",disabled:N.page*N.pageSize>=N.total,onClick:()=>f(y+1),className:"border rounded px-2 py-1 disabled:opacity-40",children:"Next ›"})]})]})]})]})}},16042:(e,t,s)=>{"use strict";s.d(t,{Dk:()=>a.Dk,Sx:()=>a.Sx,Wp:()=>a.Wp});var a=s(96614);(0,a.KO)("firebase","11.10.0","app")},70303:(e,t,s)=>{"use strict";s.r(t),s.d(t,{auth:()=>r,loginWithEmail:()=>i,logoutUser:()=>d});var a=s(16042),l=s(49834);let n=(0,a.Dk)().length?(0,a.Sx)():(0,a.Wp)({apiKey:"AIzaSyD19xpA6ARVakAAmpwCht5uXesrpeB5MxA",authDomain:"innersophist-20107.firebaseapp.com",projectId:"innersophist-20107",storageBucket:"innersophist-20107.appspot.com",messagingSenderId:"454465082281",appId:"1:454465082281:web:e1de2f253b057efca6eab8",measurementId:"G-JKKJFH3HM4"}),r=(0,l.getAuth)(n),i=async(e,t)=>{try{return{user:(await (0,l.signInWithEmailAndPassword)(r,e,t)).user,error:null}}catch(e){return{user:null,error:e.message}}},d=async()=>{try{return await (0,l.signOut)(r),{success:!0,error:null}}catch(e){return{success:!1,error:e.message}}}},91833:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/inneradmin/dashboard/content",function(){return s(576)}])},96035:(e,t,s)=>{"use strict";s.d(t,{A_:()=>d,Eu:()=>x,I5:()=>o,Nf:()=>u,bP:()=>r,l2:()=>c,up:()=>h,v5:()=>m,w0:()=>i});var a=s(37876),l=s(14232);let n={source:"bg-blue-100 text-blue-800",missing:"bg-gray-200 text-gray-600",none:"bg-gray-200 text-gray-600",draft:"bg-yellow-100 text-yellow-800",generated:"bg-purple-100 text-purple-800",needs_review:"bg-orange-100 text-orange-800",approved:"bg-emerald-100 text-emerald-800",published:"bg-green-200 text-green-900",ready_for_integration:"bg-teal-100 text-teal-800",exported:"bg-sky-100 text-sky-800",stale:"bg-red-100 text-red-800",failed:"bg-red-200 text-red-900",present:"bg-emerald-100 text-emerald-800","missing-file":"bg-gray-200 text-gray-600","key-mismatch":"bg-orange-100 text-orange-800","invalid-structure":"bg-red-100 text-red-800","invalid-json":"bg-red-200 text-red-900"};function r(e){let{status:t}=e;return(0,a.jsx)("span",{className:"inline-block rounded px-1.5 py-0.5 text-[11px] font-semibold ".concat(n[t]||"bg-gray-100 text-gray-700"),children:t})}function i(e){let{localeStatus:t={}}=e;return(0,a.jsx)("span",{className:"flex flex-wrap gap-1",children:Object.entries(t).map(e=>{let[t,s]=e;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[11px]",children:[(0,a.jsx)("span",{className:"font-mono text-gray-500",children:t}),(0,a.jsx)(r,{status:s})]},t)})})}function d(e){let{label:t,value:s,onChange:l,readOnly:n=!1}=e;return(0,a.jsxs)("label",{className:"block mb-3",children:[(0,a.jsxs)("span",{className:"block text-xs font-semibold text-gray-600 mb-1",children:[t,n?" (read-only)":""]}),(0,a.jsx)("input",{type:"text",className:"w-full border rounded px-2 py-1.5 text-sm ".concat(n?"bg-gray-100 text-gray-500":"bg-white"),value:null!=s?s:"",readOnly:n,onChange:e=>!n&&l(e.target.value)})]})}function c(e){let{label:t,value:s,onChange:l,readOnly:n=!1,rows:r=4}=e;return(0,a.jsxs)("label",{className:"block mb-3",children:[(0,a.jsxs)("span",{className:"block text-xs font-semibold text-gray-600 mb-1",children:[t,n?" (read-only)":""]}),(0,a.jsx)("textarea",{rows:r,className:"w-full border rounded px-2 py-1.5 text-sm ".concat(n?"bg-gray-100 text-gray-500":"bg-white"),value:null!=s?s:"",readOnly:n,onChange:e=>!n&&l(e.target.value)})]})}function o(e){let{label:t,value:s=[],onChange:l,readOnly:n=!1}=e,r=Array.isArray(s)?s:[];return(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("span",{className:"block text-xs font-semibold text-gray-600 mb-1",children:t}),r.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-1 mb-1",children:[(0,a.jsx)("input",{type:"text",className:"flex-1 border rounded px-2 py-1 text-sm ".concat(n?"bg-gray-100 text-gray-500":""),value:e,readOnly:n,onChange:e=>l(r.map((s,a)=>a===t?e.target.value:s))}),!n&&(0,a.jsx)("button",{type:"button",className:"text-red-600 text-xs px-1",onClick:()=>l(r.filter((e,s)=>s!==t)),children:"✕"})]},t)),!n&&(0,a.jsx)("button",{type:"button",className:"text-blue-600 text-xs",onClick:()=>l([...r,""]),children:"+ add"})]})}function x(e){let{label:t,value:s,onChange:n,readOnly:r=!1,rows:i=12}=e,[d,c]=(0,l.useState)(JSON.stringify(null!=s?s:null,null,2)),[o,x]=(0,l.useState)(null),u=(0,l.useRef)(JSON.stringify(null!=s?s:null));return(0,l.useEffect)(()=>{let e=JSON.stringify(null!=s?s:null);e!==u.current&&(u.current=e,c(JSON.stringify(null!=s?s:null,null,2)),x(null))},[s]),(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("span",{className:"block text-xs font-semibold text-gray-600 mb-1",children:[t," (JSON)"]}),(0,a.jsx)("textarea",{rows:i,className:"w-full border rounded px-2 py-1.5 font-mono text-xs ".concat(r?"bg-gray-100 text-gray-500":""," ").concat(o?"border-red-500":""),value:d,readOnly:r,onChange:e=>{c(e.target.value);try{let t=JSON.parse(e.target.value);u.current=JSON.stringify(null!=t?t:null),n(t),x(null)}catch(e){x(e.message),n(null)}}}),o&&(0,a.jsxs)("p",{className:"text-xs text-red-600",children:["Invalid JSON: ",o]})]})}function u(e){let{suggestion:t,sourceValues:s,selected:l,onToggle:n,onApply:r,onDiscard:i,busy:d,meta:c}=e,o=Object.keys(t||{});return 0===o.length?null:(0,a.jsxs)("div",{className:"border border-purple-300 bg-purple-50 rounded p-3 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("h4",{className:"text-sm font-bold text-purple-900",children:"AI suggestion (nothing is saved until you apply)"}),c&&(0,a.jsxs)("span",{className:"text-[11px] text-purple-700",children:["model ",c.model," \xb7 ",c.promptVersion]})]}),o.map(e=>(0,a.jsx)("div",{className:"mb-2 border-b border-purple-100 pb-2",children:(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs",children:[(0,a.jsx)("input",{type:"checkbox",checked:l.includes(e),onChange:()=>n(e),className:"mt-0.5"}),(0,a.jsxs)("span",{className:"flex-1",children:[(0,a.jsx)("span",{className:"font-mono font-semibold",children:e}),(0,a.jsx)("span",{className:"block text-gray-500 line-through whitespace-pre-wrap",children:p(null==s?void 0:s[e])}),(0,a.jsx)("span",{className:"block text-purple-900 whitespace-pre-wrap",children:p(t[e])})]})]})},e)),(0,a.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,a.jsxs)("button",{type:"button",disabled:d||0===l.length,onClick:r,className:"bg-purple-700 text-white text-xs px-3 py-1.5 rounded disabled:opacity-50",children:["Apply ",l.length," selected field",1===l.length?"":"s"]}),(0,a.jsx)("button",{type:"button",disabled:d,onClick:i,className:"text-xs px-3 py-1.5 rounded border",children:"Discard"})]})]})}function p(e){return null==e?"(empty)":"string"==typeof e?e:JSON.stringify(e,null,1)}function m(e){let{revisions:t=[],onRestore:s,busy:l}=e;return 0===t.length?(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"No revisions yet — the first save creates v2 (v1 is the migrated source)."}):(0,a.jsxs)("table",{className:"w-full text-xs",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-gray-500 border-b",children:[(0,a.jsx)("th",{className:"py-1 pr-2",children:"v"}),(0,a.jsx)("th",{className:"pr-2",children:"locale"}),(0,a.jsx)("th",{className:"pr-2",children:"action"}),(0,a.jsx)("th",{className:"pr-2",children:"fields"}),(0,a.jsx)("th",{className:"pr-2",children:"AI"}),(0,a.jsx)("th",{className:"pr-2",children:"admin"}),(0,a.jsx)("th",{className:"pr-2",children:"date"}),(0,a.jsx)("th",{})]})}),(0,a.jsx)("tbody",{children:t.map(e=>(0,a.jsxs)("tr",{className:"border-b align-top",children:[(0,a.jsx)("td",{className:"py-1 pr-2 font-mono",children:e.version}),(0,a.jsx)("td",{className:"pr-2 font-mono",children:e.locale}),(0,a.jsx)("td",{className:"pr-2",children:e.action}),(0,a.jsx)("td",{className:"pr-2 font-mono",children:(e.changedFields||[]).join(", ")||"—"}),(0,a.jsx)("td",{className:"pr-2",children:e.ai?"".concat(e.ai.model||""," ").concat(e.ai.promptVersion||""):"—"}),(0,a.jsx)("td",{className:"pr-2",children:e.admin||"—"}),(0,a.jsx)("td",{className:"pr-2 whitespace-nowrap",children:e.at?new Date(e.at).toLocaleStr
1ing():""}),(0,a.jsx)("td",{children:s&&"en"===e.locale&&(e.changedFields||[]).length>0&&(0,a.jsx)("button",{type:"button",disabled:l,onClick:()=>s(e),className:"text-blue-600 underline disabled:opacity-50",children:"restore (source)"})})]},e._id))})]})}function h(e){let{paths:t,sourceValues:s,translationFields:l,onChangeField:n,readOnly:r}=e;return(0,a.jsx)("div",{children:t.map(e=>{let t=null==s?void 0:s[e],i=null==l?void 0:l[e],d=Array.isArray(t);return(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-3 border-b pb-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"block text-[11px] font-mono text-gray-500 mb-1",children:[e," (source)"]}),(0,a.jsx)("div",{className:"text-sm bg-gray-50 rounded p-2 whitespace-pre-wrap",children:p(t)})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"block text-[11px] font-mono text-gray-500 mb-1",children:[e," (translation)"]}),d?(0,a.jsx)(o,{label:"",value:i||[],onChange:t=>n(e,t),readOnly:r}):(0,a.jsx)("textarea",{rows:Math.min(6,Math.max(2,String(t||"").length/60)),className:"w-full border rounded px-2 py-1.5 text-sm ".concat(r?"bg-gray-100 text-gray-500":""," ").concat(void 0===i?"border-dashed border-gray-400":""),value:null!=i?i:"",readOnly:r,placeholder:"(missing)",onChange:t=>n(e,t.target.value)})]})]},e)})})}}},e=>{e.O(0,[2661,665,1876,8260,156,5027,636,6593,8792],()=>e(e.s=91833)),_N_E=e.O()}]);

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.