PageSourceSearch

https://www.anytime-trial.com/_next/static/chunks/3tnv69gdun2mx.js

js anytime-trial.com collected 2026-10-02 01:24:23 UTC 25,026 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,520487,e=>{"use strict";let t;var n=e.i(247167),r=e.i(843476);e.i(386791);var a=e.i(555759),l=e.i(177693),o=e.i(622322),i=e.i(413335),s=e.i(343155),c=e.i(175324),u=e.i(948321),d=e.i(770703),f=e.i(618566),h=e.i(526732),p=e.i(861745),m=e.i(948148),g=e.i(271645),v=e.i(599925),x=e.i(363585),w=e.i(365191),b=e.i(818431),y=e.i(167672),C=e.i(93351),S=e.i(690454),k=e.i(244948);let D=({open:e,defaultMessage:t,onConfirm:n,onCancel:a})=>{let l=(0,m.useTranslations)("Common"),[o,i]=(0,g.useState)(t),[c,u]=(0,g.useState)(!1);(0,g.useEffect)(()=>{e&&(i(t),u(!1))},[e,t]);let d=()=>{let e=o.trim();e&&n(e,c)};return(0,r.jsxs)(w.Dialog,{open:e,onClose:a,fullWidth:!0,maxWidth:"xs",children:[(0,r.jsx)(C.DialogTitle,{sx:{fontSize:"0.95rem"},children:l("commitMessageDialogTitle")}),(0,r.jsx)(y.DialogContent,{children:(0,r.jsxs)(s.Box,{sx:{display:"flex",flexDirection:"column",gap:1,pt:.5},children:[(0,r.jsx)(k.TextField,{autoFocus:!0,fullWidth:!0,multiline:!0,minRows:2,label:l("commitMessageLabel"),value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),d())},helperText:""}),(0,r.jsx)(S.FormControlLabel,{control:(0,r.jsx)(x.Checkbox,{checked:c,onChange:e=>u(e.target.checked)}),label:l("commitMessageRememberLabel")})]})}),(0,r.jsxs)(b.DialogActions,{sx:{px:3,pb:2},children:[(0,r.jsx)(v.Button,{onClick:a,"aria-label":l("cancel"),sx:{textTransform:"none"},children:l("cancel")}),(0,r.jsx)(v.Button,{onClick:d,variant:"contained",disabled:!o.trim(),"aria-label":l("commitMessageConfirm"),sx:{textTransform:"none"},children:l("commitMessageConfirm")})]})]})};var j=e.i(452894);let I=(0,j.default)((0,r.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22zm1 14h-2v2h2zm0-6h-2v4h2z"}),"WarningAmberOutlined");var T=e.i(64599);let R=({open:e,onDiscard:t,onCancel:n})=>{let a=(0,m.useTranslations)("Common");return(0,r.jsxs)(w.Dialog,{open:e,onClose:n,fullWidth:!0,maxWidth:"xs",children:[(0,r.jsx)(C.DialogTitle,{sx:{fontSize:"0.95rem"},children:(0,r.jsxs)(s.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(I,{sx:{fontSize:20,color:"warning.main"}}),a("discardDraftTitle")]})}),(0,r.jsx)(y.DialogContent,{children:(0,r.jsx)(T.Typography,{variant:"body2",sx:{color:"text.secondary"},children:a("discardDraftBody")})}),(0,r.jsxs)(b.DialogActions,{sx:{px:3,pb:2},children:[(0,r.jsx)(v.Button,{onClick:n,"aria-label":a("cancel"),sx:{textTransform:"none"},children:a("cancel")}),(0,r.jsx)(v.Button,{onClick:t,variant:"contained",color:"warning","aria-label":a("discardDraftConfirm"),sx:{textTransform:"none"},children:a("discardDraftConfirm")})]})]})},E=(0,j.default)((0,r.jsx)("path",{d:"M24 15c0-2.64-2.05-4.78-4.65-4.96C18.67 6.59 15.64 4 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 .99-.48 1.85-1.21 2.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81M4.41 3.86 3 5.27l2.77 2.77h-.42C2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41zM6 18c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73l8 8z"}),"CloudOffOutlined"),O=({open:e,onOverwrite:t,onCancel:n})=>{let a=(0,m.useTranslations)("Common");return(0,r.jsxs)(w.Dialog,{open:e,onClose:n,fullWidth:!0,maxWidth:"xs",children:[(0,r.jsx)(C.DialogTitle,{sx:{fontSize:"0.95rem"},children:(0,r.jsxs)(s.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(E,{sx:{fontSize:20,color:"warning.main"}}),a("driveConflictTitle")]})}),(0,r.jsx)(y.DialogContent,{children:(0,r.jsx)(T.Typography,{variant:"body2",sx:{color:"text.secondary"},children:a("driveConflictBody")})}),(0,r.jsxs)(b.DialogActions,{sx:{px:3,pb:2},children:[(0,r.jsx)(v.Button,{onClick:n,"aria-label":a("cancel"),sx:{textTransform:"none"},children:a("cancel")}),(0,r.jsx)(v.Button,{onClick:t,variant:"contained",color:"warning","aria-label":a("driveConflictOverwrite"),sx:{textTransform:"none"},children:a("driveConflictOverwrite")})]})]})},P=({open:e,defaultName:t,onConfirm:n,onCancel:a})=>{let l=(0,m.useTranslations)("Common"),[o,i]=(0,g.useState)(t);(0,g.useEffect)(()=>{e&&i(t)},[e,t]);let s=()=>{let e=o.trim();e&&n(e.endsWith(".md")?e:`${e}.md`)};return(0,r.jsxs)(w.Dialog,{open:e,onClose:a,fullWidth:!0,maxWidth:"xs",children:[(0,r.jsx)(C.DialogTitle,{sx:{fontSize:"0.95rem"},children:l("driveSaveAsTitle")}),(0,r.jsx)(y.DialogContent,{children:(0,r.jsx)(k.TextField,{autoFocus:!0,fullWidth:!0,label:l("driveSaveAsLabel"),value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s())},helperText:"",sx:{mt:.5}})}),(0,r.jsxs)(b.DialogActions,{sx:{px:3,pb:2},children:[(0,r.jsx)(v.Button,{onClick:a,"aria-label":l("cancel"),sx:{textTransform:"none"},children:l("cancel")}),(0,r.jsx)(v.Button,{onClick:s,variant:"contained",disabled:!o.trim(),"aria-label":l("driveSaveAsConfirm"),sx:{textTransform:"none"},children:l("driveSaveAsConfirm")})]})]})};function A(e){return"string"==typeof e&&e.length>0}
1var M=e.i(657135),$=e.i(387481),B=e.i(635862),L=e.i(603475),F=e.i(64144);let W="driveOpenIntent",N="githubPickerIntent",U="githubFileOpenAttempt";function H(e){try{sessionStorage.setItem(e,"1")}catch(t){console.warn(`[${new Date().toISOString()}] [WARN] Failed to mark session flag (${e}):`,t)}}function _(e){try{let t="1"===sessionStorage.getItem(e);return t&&sessionStorage.removeItem(e),t}catch(t){return console.warn(`[${new Date().toISOString()}] [WARN] Failed to read session flag (${e}):`,t),!1}}function G(e){return"string"==typeof e&&e.length>0?e:null}class z{supportsDirectAccess=!1;open(){return new Promise(e=>{let t=document.createElement("input");t.type="file",t.accept=".md,text/markdown,text/plain",t.onchange=async()=>{let n=t.files?.[0];if(!n)return void e(null);let r=await n.text();e({handle:{name:n.name},content:r})},t.oncancel=()=>e(null),t.click()})}async save(e,t){await this.saveAs(t)}async saveAs(e){let t=new Blob([e],{type:"text/markdown;charset=utf-8"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;let a=new Date,l=`${a.getFullYear()}${String(a.getMonth()+1).padStart(2,"0")}${String(a.getDate()).padStart(2,"0")}_${String(a.getHours()).padStart(2,"0")}${String(a.getMinutes()).padStart(2,"0")}${String(a.getSeconds()).padStart(2,"0")}`;return r.download=`document_${l}.md`,r.click(),URL.revokeObjectURL(n),null}}async function K(e,t,n){let r=await fetch(`/api/github/content?repo=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}&ref=${encodeURIComponent(n)}`);if(!r.ok)throw Error(`GitHub content fetch failed: ${r.status} (${e}/${t}@${n})`);return(await r.json()).content??""}async function X(e,t){let n=await fetch(`/api/note-graph?repo=${encodeURIComponent(e)}&branch=${encodeURIComponent(t)}`);if(!n.ok)return[];let r=await n.json();return Array.isArray(r.docs)?r.docs:[]}let J="https://apis.google.com/js/api.js";async function q(e,n,r){await (window.gapi?Promise.resolve():t||(t=new Promise((e,t)=>{let n=document.querySelector(`script[src="${J}"]`);if(n){n.addEventListener("load",()=>e()),n.addEventListener("error",()=>t(Error("googlePicker: failed to load Google API script")));return}let r=document.createElement("script");r.src=J,r.async=!0,r.defer=!0,r.addEventListener("load",()=>e()),r.addEventListener("error",()=>t(Error("googlePicker: failed to load Google API script"))),document.head.appendChild(r)}))),await new Promise((e,t)=>{window.gapi?window.gapi.load("picker",()=>e()):t(Error("googlePicker: gapi is not available after script load"))});let a=window.google;if(!a)throw Error("pickDriveMarkdownFile: google.picker failed to load");let{picker:l}=a;return new Promise(t=>{let a=new l.DocsView().setMimeTypes("text/markdown,text/plain");new l.PickerBuilder().setOAuthToken(e).setDeveloperKey(n).setAppId(r).addView(a).setCallback(e=>(function(e,t){if("picked"===e.action){let n=e.docs?.[0];if(n)return void t({fileId:n.id,name:n.name})}"cancel"===e.action&&t(null)})(e,t)).build().setVisible(!0)})}let V=[{description:"Markdown",accept:{"text/markdown":[".md"]}}];class Y{get supportsDirectAccess(){return"u">typeof globalThis&&"showOpenFilePicker"in globalThis}async open(){if(!this.supportsDirectAccess)return null;try{let[e]=await globalThis.showOpenFilePicker({types:V,multiple:!1}),t=await e.getFile(),n=await t.text();return{handle:{name:t.name,nativeHandle:e},content:n}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;return console.error("[WebFileSystemProvider] open failed",e),null}}async save(e,t){if(!e.nativeHandle)return;let n=await e.nativeHandle.createWritable();await n.write(t),await n.close()}async saveAs(e){if(!this.supportsDirectAccess)return null;try{let t=await globalThis.showSaveFilePicker({suggestedName:"document.md",types:V}),n=await t.createWritable();return await n.write(e),await n.close(),{name:t.name,nativeHandle:t}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;return console.error("[WebFileSystemProvider] saveAs failed",e),null}}}function Z(e){return"object"!=typeof e||null===e?null:e}function Q(e){let t=Z(e),n=t?.accessToken;return"string"==typeof n&&n.length>0?n:null}function ee(e){let t=Z(e),n=t?.headRevisionId;return"string"==typeof n?n:null}function et(e){let t=Z(e)?.error;return"string"==typeof t?t:void 0}function en(){let e=(0,m.useTranslations)("Common");return(0,r.jsx)(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},role:"status","aria-busy":"true","data-state":"loading",children:(0,r.jsx)(c.CircularProgress,{"aria-label":e("loadingEditor")})})}let er=(0,d.default)(()=>e.A(360129).then(e=>({default:e.GitHubRepoBrowser})),{loadableGenerated:{modules:[382702]},ssr:!1}),ea=(0,d.default)(()=>e.A(49994),{loadableGenerated:{modules:[815350]},ssr:!1,loading:()=>(0,r.jsx)(en,{})});function el(){let t=(0,m.useTranslations)("Common"),c=(0,f.useSearchParams)(),d=c.get("state"),v=c.get("gh"),x=c.get("branch"),w=c.get("path"),b=c.get("mode"),y=(0,g.useMemo)(()=>v&&x&&w?{repo:v,branch:x,path:w}:null,[v,x,w]),{open:C,confirmDiscardDraft:S,onDiscard:k,onCancel:j}=function(){let[e,t]=(0,g.useState)(!1),n=(0,g.useRef)(null),r=(0,g.useCallback)(()=>new Promise(e=>{n.current=e,t(!0)}),[]),a=(0,g.useCallback)(e=>{t(!1),n.current?.(e),n.current=null},[]);return{open:e,confirmDiscardDraft:r,onDiscard:(0,g.useCallback)(()=>a(!0),[a]),onCancel:(0,g.useCallback)(()=>a(!1),[a])}}(),{themeMode:I,setThemeMode:T}=(0,L.useThemeMode)(),{presetName:E,setPresetName:J}=(0,L.usePreset)(),{setLocale:V}=(0,B.useLocaleSwitch)(),en="1"===n.default.env.NEXT_PUBLIC_SHOW_THEME_PRESET,{data:el,status:eo}=(0,h.useSession)(),ei=(0,g.useMemo)(()=>{let e;return"loading"===eo?void 0:(e="object"==typeof el&&null!==el?el:null,{github:A(e?.accessToken),google:A(e?.googleAccessToken)}).github},[el,eo]),{externalContent:es,externalFileName:ec,externalCompareContent:eu,editorKey:ed,isDirty:ef,saveSnackbar:eh,ssoSnackbar:ep,driveConflict:em,hasDriveFile:eg,handleSaveTargetChange:ev,commitMessageDialog:ex,externalSaveKind:ew,githubDoc:eb,handleGitHubOpenFile:ey,handleExternalSave:eC,handleCompareModeChange:eS,handleContentChange:ek,setSsoSnackbar:eD,setSaveSnackbar:ej,fileSystemProvider:eI,handleDriveOpen:eT,handleDriveConflictOverwrite:eR,handleDriveConflictCancel:eE,driveSaveAsDialog:eO,handleSaveToDriveClick:eP,handleSaveToDriveConfirm:eA,handleSaveToDriveCancel:eM,handleCommitMessageConfirm:e$,handleCommitMessageCancel:eB}=function({isGitHubConnected:e,t,driveOpenState:n=null,githubOpenRequest:r=null,confirmDiscardDraft:a,fetchFileFn:l=K,fetchFn:i=window.fetch.bind(window),signInFn:s=h.signIn}){let[c,u]=(0,g.useState)(void 0),[d,f]=(0,g.useState)(void 0),[p,m]=(0,g.useState)(void 0),[v,x]=(0,g.useState)(null),[,w]=(0,g.useState)(!1),[b,y]=(0,g.useState)(0),C=(0,g.useRef)(null),S=(0,g.useRef)(null),k=(0,g.useRef)(null),[D,j]=(0,g.useState)(!1),[I,T]=(0,g.useState)(null),[R,E]=(0,g.useState)(null),[O,P]=(0,g.useState)(!1),A=(0,g.useCallback)(e=>{S.current=e,P(null!=e)},[]),M=(0,g.useRef)(""),$=(0,g.useRef)(null),[B,L]=(0,g.useState)(null),F=(0,g.useRef)(""),N=(0,g.useRef)(null),[X,J]=(0,g.useState)(void 0),[V,en]=(0,g.useState)(null),er=(0,g.useRef)(!1),ea=(0,g.useRef)(null);(0,g.useEffect)(()=>(document.body.classList.add("editor-page"),()=>{document.body.classList.remove("editor-page")}),[]),(0,g.useEffect)(()=>{!e||er.current||(C.current||(u(""),y(e=>e+1)),"1"!==sessionStorage.getItem("ssoContentCleared")&&(sessionStorage.setItem("ssoContentCleared","1"),(0,o.clearDraft)()))},[e]);let el=(0,g.useCallback)(e=>{M.current=e,null!=k.current&&j(e!==k.current)},[]),eo=(0,g.useMemo)(()=>{let e=new Y;
1return e.supportsDirectAccess?e:new z},[]),ei=(0,g.useRef)(e),[es,ec]=(0,g.useState)(null);(0,g.useEffect)(()=>{if(void 0===e)return;let n=ei.current;ei.current=e,void 0===n||n===e||(C.current=null,A(null),u(void 0),f(void 0),x(null),y(e=>e+1),N.current=null,L(null),J(void 0),e&&!n?ec(t("githubConnected")):!e&&n&&ec(t("githubDisconnected")))},[e,t,A]);let eu=(0,g.useCallback)(async(e,n,r)=>{let a=C.current;if(a?.repo!==e||a?.filePath!==n||a?.branch!==r){let a;try{a=await l(e,n,r)}catch(a){console.error(`[${new Date().toISOString()}] [ERROR] GitHub file open failed (${e}/${n}@${r}):`,a),T({message:t("githubLoadError"),severity:"error"});return}C.current={repo:e,filePath:n,branch:r},m({repo:e,branch:r,path:n}),A(null),J("github"),j(!1),k.current=a,(0,o.writeDraft)(a),u(void 0),f(n.split("/").pop()??n),x(null),y(e=>e+1);return}C.current={repo:e,filePath:n,branch:r},m({repo:e,branch:r,path:n}),A(null),J("github")},[l,A,t]),ed=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(r&&!ed.current&&void 0!==e){if(ed.current=!0,e){_(U),eu(r.repo,r.path,r.branch);return}if(_(U))return void T({message:t("githubOpenSignInRequired"),severity:"error"});H(U),s("github",{callbackUrl:window.location.href})}},[r,e,eu,s,t]);let ef=(0,g.useCallback)(async(e,n)=>{let r=S.current;if(!r)return!1;let a=await i("/api/drive/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileId:r.fileId,content:e,headRevisionId:n})});if(409===a.status)return E({content:e,latestHeadRevisionId:ee(await a.json().catch(()=>null))??n}),!1;if(a.ok){let n=ee(await a.json().catch(()=>null))??r.headRevisionId;return A({...r,headRevisionId:n}),k.current=e,j(!1),T({message:t("fileSaved"),severity:"success"}),!0}return console.warn("Failed to save to Drive:",et(await a.json().catch(()=>null))),T({message:t("driveSaveError"),severity:"error"}),!1},[t,i,A]),eh=(0,g.useCallback)(async()=>{R&&(E(null),await ef(R.content,R.latestHeadRevisionId))},[R,ef]),ep=(0,g.useCallback)(()=>{E(null)},[]),em=(0,g.useCallback)(async(e,n)=>{let r=C.current;if(!r)return!1;let a=await i("/api/github/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:r.repo,path:r.filePath,content:e,branch:r.branch,message:n})});return a.ok?(k.current=e,j(!1),T({message:t("fileSaved"),severity:"success"}),!0):(console.warn("Failed to save to GitHub:",et(await a.json().catch(()=>null))),T({message:t("saveError"),severity:"error"}),!1)},[t,i]),eg=(0,g.useCallback)(async e=>{if(S.current)return ef(e,S.current.headRevisionId);let n=C.current;return n?null!=N.current?em(e,N.current):(F.current=e,L({open:!0,defaultMessage:`Update ${n.filePath}`}),new Promise(e=>{$.current=e})):(console.warn("External save requested with no target (no Drive file, no GitHub file selected)"),T({message:t("saveNoTarget"),severity:"error"}),!1)},[ef,em,t]),ev=(0,g.useCallback)(e=>{e?.kind==="local"&&(A(null),J(void 0),C.current=null,f(void 0))},[A]),ex=(0,g.useCallback)(e=>{let t=$.current;$.current=null,t?.(e)},[]),ew=(0,g.useCallback)(async(e,t)=>{L(null),t&&(N.current=e),ex(await em(F.current,e))},[em,ex]),eb=(0,g.useCallback)(()=>{L(null),ex(!1)},[ex]),ey=(0,g.useCallback)(async()=>{try{await s("google",{callbackUrl:window.location.href})}catch(e){console.warn("Failed to start Google sign-in:",e),T({message:t("driveSignInRequired"),severity:"error"})}},[s,t]),eC=(0,g.useCallback)(e=>{en({open:!0,defaultName:e})},[]),eS=(0,g.useCallback)(()=>{en(null)},[]),ek=(0,g.useCallback)(async e=>{en(null);let n=ea.current,r=await i("/api/drive/content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,content:M.current,...n?{parentId:n}:{}})});if(401===r.status)return void await ey();if(!r.ok){let e=et(await r.json().catch(()=>null));console.warn(`Failed to create Drive file (${r.status}):`,e),T({message:t("driveCreateError"),severity:"error"});return}let a=function(e){let t=Z(e);if(!t)return null;let{fileId:n,name:r,headRevisionId:a}=t;return"string"!=typeof n||"string"!=typeof r?null:{fileId:n,name:r,headRevisionId:"string"==typeof a?a:null}}(await r.json().catch(()=>null));if(!a){console.warn("Failed to create Drive file: unexpected payload shape"),T({message:t("driveCreateError"),severity:"error"});return}A({fileId:a.fileId,name:a.name,headRevisionId:a.headRevisionId??""}),J("drive"),ea.current=null,C.current=null,k.current=M.current,j(!1),f(a.name),T({message:t("fileSaved"),severity:"success"})},[i,t,ey,A]),eD=(0,g.useCallback)(async e=>{let n=await i(`/api/drive/content?fileId=${encodeURIComponent(e)}`);
1if(!n.ok){let e=et(await n.json().catch(()=>null));return console.warn(`Failed to load Drive file (${n.status}):`,e),T({message:t("driveLoadError"),severity:"error"}),!1}let r=function(e){let t=Z(e);if(!t)return null;let{name:n,headRevisionId:r,content:a}=t;return"string"!=typeof n||"string"!=typeof r||"string"!=typeof a?null:{name:n,headRevisionId:r,content:a}}(await n.json().catch(()=>null));return r?(A({fileId:e,name:r.name,headRevisionId:r.headRevisionId}),J("drive"),ea.current=null,C.current=null,j(!1),k.current=r.content,(0,o.writeDraft)(r.content),u(void 0),f(r.name),x(null),y(e=>e+1),!0):(console.warn("Failed to load Drive file: unexpected payload shape"),T({message:t("driveLoadError"),severity:"error"}),!1)},[i,t,A]),ej=(0,g.useCallback)(async()=>{let e=await i("/api/auth/google-token"),t=e.ok?Q(await e.json().catch(()=>null)):null;if(!t)return void await ey();let n=await q(t,"AIzaSyBHZwEzIgBfsw55O4xhJOKiNPuN95_WOok","319387139351");n&&await eD(n.fileId)},[i,t,ey,eD]),eI=(0,g.useCallback)(e=>{ea.current=e,A(null),J(void 0),C.current=null,k.current="",M.current="",j(!1),(0,o.writeDraft)(""),u(""),f(void 0),x(null),y(e=>e+1)},[A]),eT=(0,g.useCallback)(async()=>0===(0,o.readDraft)("").length||!!a&&a(),[a]),eR=(0,g.useCallback)(async(e,n)=>{if(!await eT())return void T({message:t("driveOpenDraftBlocked"),severity:"error"});let r=await i("/api/auth/google-token");if(!(r.ok?Q(await r.json().catch(()=>null)):null)){try{sessionStorage.setItem(W,n)}catch(e){console.warn(`[${new Date().toISOString()}] [WARN] Failed to mark Drive open intent:`,e)}await ey();return}"create"===e.action?eI(e.folderId):await eD(e.fileId)},[eT,i,t,ey,eI,eD]);return(0,g.useEffect)(()=>{if(er.current)return;let e=function(){try{let e=sessionStorage.getItem(W);return null!==e&&sessionStorage.removeItem(W),e}catch(e){return console.warn(`[${new Date().toISOString()}] [WARN] Failed to read Drive open intent:`,e),null}}(),t=n??e,r=function(e){var t;if(!e)return null;let n="object"!=typeof(t=function(e){try{return JSON.parse(e)}catch(e){console.warn(`[${new Date().toISOString()}] [WARN] Invalid Drive state payload:`,e);return}}(e))||null===t||Array.isArray(t)?null:t;if(!n)return null;let r=G(n.userId);if("open"===n.action){let e=function(e){if(!Array.isArray(e))return null;for(let t of e){let e=G(t);if(e)return e}return null}(n.ids);return e?{action:"open",fileId:e,userId:r}:null}return"create"===n.action?{action:"create",folderId:G(n.folderId),userId:r}:null}(t);r&&null!==t&&(er.current=!0,eR(r,t))},[n,eR]),{externalContent:c,externalFileName:d,externalCompareContent:v,editorKey:b,isDirty:D,saveSnackbar:I,ssoSnackbar:es,driveConflict:R,hasDriveFile:O,externalSaveKind:X,githubDoc:p,commitMessageDialog:B,driveSaveAsDialog:V,handleGitHubOpenFile:eu,handleExternalSave:eg,handleSaveTargetChange:ev,handleCompareModeChange:(0,g.useCallback)(e=>{w(e)},[]),handleContentChange:el,setSsoSnackbar:ec,setSaveSnackbar:T,fileSystemProvider:eo,handleDriveOpen:ej,handleSaveToDriveClick:eC,handleSaveToDriveConfirm:ek,handleSaveToDriveCancel:eS,handleDriveConflictOverwrite:eh,handleDriveConflictCancel:ep,handleCommitMessageConfirm:ew,handleCommitMessageCancel:eb}}({isGitHubConnected:ei,t,driveOpenState:d,githubOpenRequest:y,confirmDiscardDraft:S}),eL=ei||eg,eF=(0,p.useLocale)(),eW=(0,g.useMemo)(()=>(0,a.createMarkdownT)("MarkdownEditor",eF),[eF]),eN=function(t){let{enabled:n,repo:r,branch:a,currentPath:l,themeMode:o,t:i,onOpenDoc:s}=t,c=(0,g.useRef)({t:i,onOpenDoc:s,themeMode:o,currentPath:l});c.current={t:i,onOpenDoc:s,themeMode:o,currentPath:l};let u=(0,g.useRef)(null),d=(0,g.useRef)(!1),f=(0,g.useRef)(!1),h=(0,g.useRef)(!1),p=(0,g.useMemo)(()=>{if(!n||!r||!a)return;let e=document.createElement("div");return e.style.cssText="display:flex;min-height:0;flex:1 1 auto;",d.current=!1,f.current=!1,{element:e,onOpen:()=>{d.current=!0,m(r,a)},isPinned:()=>u.current?.isPinned()??!1}},[n,r,a]);async function m(e,t){if(!f.current&&!h.current&&u.current){h.current=!0;try{var n;let r=await X(e,t);f.current=!0,u.current?.setDocs({docs:r,isDark:(n=c.current.themeMode,"dark"===n||"light"!==n&&"function"==typeof globalThis.matchMedia&&globalThis.matchMedia("(prefers-color-scheme: dark)").matches),currentPath:c.current.currentPath})}catch(n){console.warn(`[noteGraph] docs 取得に失敗 (repo=${e} branch=${t})`,n)}finally{h.current=!1}}}return(0,g.useEffect)(()=>
1{if(!p||!r||!a)return;let t=!1;return(async()=>{let{createNoteGraphPanel:n}=await e.A(736468);if(t)return;let l=n({t:e=>c.current.t(e),readOnly:!0,onOpenDoc:e=>c.current.onOpenDoc(e),onConnect:()=>{},onRefresh:()=>{}});u.current=l,p.element.append(l.element),d.current&&m(r,a)})(),()=>{t=!0,u.current?.destroy(),u.current=null}},[p,r,a]),p}({enabled:"github"===ew,repo:eb?.repo,branch:eb?.branch,currentPath:eb?.path,themeMode:I,t:eW,onOpenDoc:e=>{eb&&ey(eb.repo,e,eb.branch)}}),eU=(0,g.useMemo)(()=>void 0!==es?es:(0,o.readDraft)((0,l.getDefaultContent)(eF)),[es,eF,ed]);(0,g.useEffect)(()=>{ek(eU)},[eU,ek]);let{gitHubPickerOpen:eH,handleOpenFromGitHub:e_,closeGitHubPicker:eG}=function({isGitHubConnected:e,signInFn:t=h.signIn}){let[n,r]=(0,g.useState)(!1),a=(0,g.useCallback)(()=>{if(!e){H(N),t("github",{callbackUrl:window.location.href});return}r(!0)},[e,t]);return(0,g.useEffect)(()=>{e&&_(N)&&r(!0)},[e]),{gitHubPickerOpen:n,handleOpenFromGitHub:a,closeGitHubPicker:(0,g.useCallback)(()=>r(!1),[])}}({isGitHubConnected:ei}),ez=(0,g.useMemo)(()=>({onWebImportCreate:(e,t)=>{(0,M.downloadMarkdownBlob)(e,t)},onOpenFromDrive:eT,onOpenFromGitHub:e_,onSaveToDrive:()=>eP(ec??"document.md")}),[eT,e_,eP,ec]);return(0,r.jsxs)(s.Box,{sx:{display:"flex",flexDirection:"column",height:"100vh"},children:[(0,r.jsx)($.default,{}),(0,r.jsxs)(s.Box,{id:"md-page-wrapper",sx:{display:"flex",flex:1,overflow:"hidden"},children:[(0,r.jsx)(s.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:(0,r.jsx)(s.Box,{sx:{flex:1,minHeight:0},children:(0,r.jsx)(F.EmbedProvidersBoundary,{children:(0,r.jsx)(ea,{t:eW,locale:eF,themeMode:I,onThemeModeChange:T,presetName:en?E:void 0,onPresetChange:en?J:void 0,onLocaleChange:V,fileSystemProvider:eI,initialMode:"review"===b||"readonly"===b||"source"===b||"wysiwyg"===b?b:void 0,onCompareModeChange:eS,externalCompareContent:eu,initialContent:es??(0,l.getDefaultContent)(eF),persistDraft:void 0===es,fileName:ec,onExternalSave:eL?eC:void 0,externalSaveKind:ew,onSaveTargetChange:ev,noteGraph:eN,showReadonlyMode:"1"===n.default.env.NEXT_PUBLIC_SHOW_READONLY_MODE,showFrontmatter:!0,sideToolbar:!0,hide:{explorer:!0},fileHandlers:ez,onContentChange:ek,gridRows:n.default.env.NEXT_PUBLIC_GRID_ROWS?Number(n.default.env.NEXT_PUBLIC_GRID_ROWS):void 0,gridCols:n.default.env.NEXT_PUBLIC_GRID_COLS?Number(n.default.env.NEXT_PUBLIC_GRID_COLS):void 0},`${ed}-${eF}`)})})}),(0,r.jsx)(er,{open:eH,onClose:eG,onSelect:(e,t,n)=>void ey(e,t,n)}),(0,r.jsx)(u.Snackbar,{open:!!ep,autoHideDuration:4e3,onClose:()=>eD(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,r.jsx)(i.Alert,{onClose:()=>eD(null),severity:"info",variant:"filled",role:"status",sx:{width:"100%"},children:ep})}),(0,r.jsx)(u.Snackbar,{open:!!eh,autoHideDuration:4e3,onClose:()=>ej(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,r.jsx)(i.Alert,{onClose:()=>ej(null),severity:eh?.severity??"info",variant:"filled",role:"status",sx:{width:"100%"},children:eh?.message})}),(0,r.jsx)(P,{open:eO?.open??!1,defaultName:eO?.defaultName??"document.md",onConfirm:eA,onCancel:eM}),(0,r.jsx)(O,{open:!!em,onOverwrite:eR,onCancel:eE}),(0,r.jsx)(D,{open:!!ex,defaultMessage:ex?.defaultMessage??"",onConfirm:e$,onCancel:eB}),(0,r.jsx)(R,{open:C,onDiscard:k,onCancel:j})]})]})}e.s(["default",0,function(){return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(en,{}),children:(0,r.jsx)(el,{})})}],520487)}]);

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.