wrong-notebook 2026.11.8-1 → 2026.11.9-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
- package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/eula/page.js.nft.json +1 -1
- package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +2 -2
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
- package/.next/server/chunks/ssr/{_12ho9vlz1_nzo._.js → _0ethdphoh7xqp._.js} +1 -1
- package/.next/server/chunks/ssr/_0p3bqrojxwfs0._.js +3 -0
- package/.next/server/chunks/ssr/_0r_8p9g00106y._.js +3 -0
- package/.next/server/chunks/ssr/_1ctycpq4tb8xw._.js +3 -0
- package/.next/server/chunks/ssr/_1dl7pg0vhu_7m._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_133xkxfckw9tf._.js → node_modules_0r81ft4mt93or._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1brtdb7tndxid.js → node_modules_heic-to_dist_csp_heic-to_03m-1das3a4fz.js} +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +2 -2
- package/.next/server/chunks/ssr/src_components_image-cropper_tsx_0pcp8-ifruyx-._.js +1 -1
- package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0-3d2l_vcliz4.js +6 -0
- package/.next/static/chunks/0b_bdug9u1cxw.js +1 -0
- package/.next/static/chunks/0xo3qpipk_k3u.js +1 -0
- package/.next/static/chunks/11jjfyt0-zwcn.js +1 -0
- package/.next/static/chunks/135mrn0ll7pgh.js +1 -0
- package/.next/static/chunks/13oi1micj1ewp.js +1 -0
- package/.next/static/chunks/172dko4hv3xbk.js +13 -0
- package/.next/static/chunks/{1kzmqap7asc46.js → 19a04m6wxadzm.js} +1 -1
- package/.next/static/chunks/2-9lp8_rdefk8.js +9 -0
- package/.next/static/chunks/209odxnq_2nok.js +1 -0
- package/.next/static/chunks/23h7edvgzvaoi.js +8 -0
- package/.next/static/chunks/32hvb4b-e4jpa.js +1 -0
- package/.next/static/chunks/334z2x2rojgkd.js +1 -0
- package/.next/static/chunks/3lsj4waqfw7eq.js +1 -0
- package/.next/static/chunks/3m_jfkz23whuc.js +1 -0
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/ssr/_0a0h6yv1_61zn._.js +0 -3
- package/.next/server/chunks/ssr/_0m1jjbrzk71io._.js +0 -3
- package/.next/server/chunks/ssr/_14h_732sdmo6b._.js +0 -3
- package/.next/server/chunks/ssr/_1hp3fw-gk2r-3._.js +0 -3
- package/.next/static/chunks/0a_jerp9yv-om.js +0 -2
- package/.next/static/chunks/0cpyqet_sqmdp.js +0 -1
- package/.next/static/chunks/0jyyrmsnlj04i.js +0 -13
- package/.next/static/chunks/0l8auoibmum0r.js +0 -1
- package/.next/static/chunks/0wn8i_n7wpzhy.js +0 -8
- package/.next/static/chunks/16qwioc_q7wfz.js +0 -8
- package/.next/static/chunks/1ti8akix3yalf.js +0 -1
- package/.next/static/chunks/1u6m54j807_cw.js +0 -1
- package/.next/static/chunks/2hlvwtql2eiqy.js +0 -1
- package/.next/static/chunks/3-gt5s84owxj2.js +0 -1
- package/.next/static/chunks/3_wki8y0qb28v.js +0 -1
- package/.next/static/chunks/3ios-g8cm_1vz.js +0 -6
- package/.next/static/chunks/3mnblmrqi_tcr.js +0 -1
- /package/.next/static/{8txIetq9muxlc0OqsgaeI → I4Rw8GasSc6yR7HSWfSnC}/_buildManifest.js +0 -0
- /package/.next/static/{8txIetq9muxlc0OqsgaeI → I4Rw8GasSc6yR7HSWfSnC}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{8txIetq9muxlc0OqsgaeI → I4Rw8GasSc6yR7HSWfSnC}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],711241)},399847,e=>{var t=e.i(456420);let n={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],399847)},13285,e=>{var t=e.i(456420);let n={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],13285)},813572,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(618566),l=e.i(518515),s=e.i(328623),a=e.i(747819),r=e.i(866531),o=e.i(12130),u=e.i(430634),c=e.i(576019),h=e.i(847483),f=e.i(497346),m=e.i(717448),d=e.i(798469),p=e.i(393842),g=e.i(956738),x=e.i(185592),y=e.i(111110),w=e.i(41931),b=e.i(201276),j=e.i(35209),v=e.i(598053),k=e.i(315092),I=e.i(804536),$=e.i(271945);e.s(["default",0,function(){let e=(0,i.useParams)(),S=(0,i.useRouter)(),N=e.id,{t:M}=(0,y.b)(),[A,T]=(0,n.useState)(null);(0,j.f)(M.notebooks.title,A?.name,M.pageTitle.addError);let[P,C]=(0,I.y)($.c,$.k,"image"),q=(0,v.f)({logPrefix:"[AddErrorItem]",analyzeSubjectId:N,importSubjectId:N,textNotebook:{id:N,name:A?.name||""},fixedSubjectId:N});return((0,n.useEffect)(()=>{w.k.get(`/api/notebooks/${N}`).then(e=>T(e)).catch(e=>{b.V.error("[AddErrorItem]","Failed to fetch notebook",{error:e}),S.push("/notebooks")})},[N,S]),A)?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(g.f,{status:q.analysisStep,completed:q.completedStages}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===q.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,t.jsx)(f.f,{message:q.saveError,onDismiss:q.dismissSaveError}),(0,t.jsx)(p.f,{backHref:`/notebooks/${N}`,title:M.app.addError,description:A.name}),"upload"===q.step&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(x.f,{options:[{value:"image",icon:l.f,label:M.app?.uploadImage||"Take Photo"},{value:"text",icon:s.f,label:M.app?.manualInput||"Manual Input"}],value:P,onChange:C}),q.pendingTask&&(0,t.jsx)(c.f,{task:q.pendingTask,onRefresh:q.refreshPendingTask,onDismiss:q.dismissPendingTask}),q.lastImported&&(0,t.jsx)(u.f,{imported:q.lastImported,onDismiss:q.dismissImported}),q.batchImages?(0,t.jsx)(a.f,{images:q.batchImages,subjectId:N,onClose:q.closeBatch}):"image"===P?(0,t.jsxs)(t.Fragment,{children:[q.parts.length>0&&(0,t.jsx)(h.f,{parts:q.parts.map(e=>e.dataUrl),busy:q.isBusy,onFinish:()=>void q.finishParts(),onDiscard:q.discardParts}),(0,t.jsx)(d.f,{onImageSelect:q.selectImage,isAnalyzing:q.isBusy})]}):(0,t.jsx)(m.f,{onSubmit:q.submitText,isAnalyzing:q.isBusy,defaultNotebookName:A.name,onCreateBatch:q.createTextBatch,creatingBatch:q.creatingBatch})]}),"review"===q.step&&q.parsedData&&(0,t.jsx)(r.f,{initialData:q.parsedData,imagePreview:q.currentImage,onSave:q.saveReviewed,onCancel:q.cancelReview,initialSubjectId:N,aiTimeout:q.aiTimeout})]}),(0,t.jsx)(o.f,{imageSrc:q.croppingImage||"",open:q.isCropperOpen,onClose:q.closeCropper,onRegionsSelected:q.cropRegions,allowMulti:0===q.parts.length,onAutoSplit:0===q.parts.length?q.autoSplitImage:void 0,onAddPart:q.parts.length<k.u-1?q.addPart:void 0,partCount:q.parts.length})]}):(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:M.common.loading})})}])},590546,e=>{var t=e.i(843476),n=e.i(618566),i=e.i(519455),l=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:s}){let a=(0,n.useRouter)();return(0,t.jsx)(i.f,{variant:"ghost",size:"icon",onClick:()=>{a.push(e)},className:s,children:(0,t.jsx)(l.f,{className:"h-5 w-5"})})}])},393842,e=>{var t=e.i(843476),n=e.i(590546),i=e.i(975157);e.s(["f",0,function({title:e,description:l,backHref:s,actions:a,titleAddon:r,className:o}){return(0,t.jsxs)("div",{className:(0,i.f)("flex items-start gap-3",o),children:[s&&(0,t.jsx)(n.f,{fallbackUrl:s,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),l&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:l})]}),a&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}])},185592,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({options:e,value:i,onChange:l,className:s}){return(0,t.jsx)("div",{className:(0,n.f)("grid gap-1 rounded-xl bg-muted p-1",s),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:s,icon:a})=>{let r=e===i;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":r,className:(0,n.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",r?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>l(e),children:[a&&(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:s})]},e)})})}])},499930,e=>{var t=e.i(213761);function n(e,t=.008){let i=Math.max(0,e.x-t),l=Math.max(0,e.y-t);return{x:i,y:l,width:Math.min(1,e.x+e.width+t)-i,height:Math.min(1,e.y+e.height+t)-l}}async function i(e){let t=new Image;if(t.decoding="async",t.src=e,await t.decode(),!t.naturalWidth||!t.naturalHeight)throw Error("IMAGE_EMPTY");return t}async function l(e,n){let i=function(e,t=16,n=!1){let i=Math.max(...e.map(e=>e.width)),l=0,s=e.map(e=>{let s=n?i/e.width:e.scale??1,a={x:0,y:l,width:Math.round(e.width*s),height:Math.round(e.height*s)};return l+=a.height+t,a});return{width:Math.max(...s.map(e=>e.width)),height:l-t,rects:s}}(e.map(e=>({width:e.sw,height:e.sh,scale:e.scale})),16,n),l=document.createElement("canvas");l.width=i.width,l.height=i.height;let s=l.getContext("2d");if(!s)throw Error("CANVAS_UNSUPPORTED");s.fillStyle="#ffffff",s.fillRect(0,0,l.width,l.height),e.forEach((e,t)=>{let n=i.rects[t];s.drawImage(e.source,e.sx,e.sy,e.sw,e.sh,n.x,n.y,n.width,n.height)});let a=await createImageBitmap(l);try{return await (0,t.X)({source:a,width:l.width,height:l.height})}finally{a.close()}}async function s(e,i){let s=e.naturalWidth,a=e.naturalHeight,r=i.map(e=>n(e));return 1===r.length?(0,t.X)({source:e,width:s,height:a},r[0]):l(r.map(t=>({source:e,sx:Math.round(t.x*s),sy:Math.round(t.y*a),sw:Math.max(1,Math.round(t.width*s)),sh:Math.max(1,Math.round(t.height*a))})),!1)}async function a(e){return l((await Promise.all(e.map(i))).map(e=>({source:e,sx:0,sy:0,sw:e.naturalWidth,sh:e.naturalHeight})),!0)}async function r(e,t,i){let s=e.naturalWidth,a=e.naturalHeight,r=i.width/s,o=t.map(e=>n(e)).map(t=>({source:e,sx:Math.round(t.x*s),sy:Math.round(t.y*a),sw:Math.max(1,Math.round(t.width*s)),sh:Math.max(1,Math.round(t.height*a)),scale:r}));return o.push({source:i.source,sx:0,sy:0,sw:i.width,sh:i.height}),l(o,!1)}e.s(["y",0,i,"k",0,r,"M",0,s,"v",0,a])},119472,e=>{var t=e.i(41931),n=e.i(127175);async function i(e){let t;for(let n=0;n<3;n++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===n)break;await new Promise(e=>setTimeout(e,1e3*(n+1)))}throw t}async function l(e,s=(0,n.c)()){let{batch:a}=await i(()=>t.k.post("/api/import-batches",{...e,clientRequestId:s,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0,items:e.items?.map(e=>({...e})),origin:e.origin},{timeout:12e4}));return(0,n.P)(),a}async function s(e,n={}){let i=n.image?"?include=image":"",{batch:l}=await t.k.get(`/api/import-batches/${encodeURIComponent(e)}${i}`);return l}async function a(e,n,i){let{batch:l}=await t.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:n,draft:i});return l}async function r(e,l,s,a){let{batch:r}=await i(()=>t.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:l,images:s,analysis:a},{timeout:12e4}));return(0,n.P)(),r}async function o(e){let{batch:i}=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,n.P)(),i}async function u(e){let i=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,n.P)(),i}async function c(e){await t.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,n.P)()}async function h(e){await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,n.P)()}async function f(e,n,i){return t.k.post(`/api/import-batches/${encodeURIComponent(e)}/fix-text`,{items:n},{timeout:6e5,recoverable:!0,requestId:i})}e.s(["J",0,u,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,l,"o",0,c,"w",0,s,"$",0,f,"f",0,h,"s",0,o,"S",0,a,"g",0,r])},25197,e=>{var t=e.i(41931);function n(e){return e.trim()?e:""}async function i(){try{return!!(await t.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function l(e,i){let l=await t.k.post("/api/error-items",{questionText:e.questionText,answerText:n(e.answerText),analysis:n(e.analysis),wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,questionType:e.questionType??null,subjectId:i.subjectId||void 0,subjectName:i.subjectId?void 0:e.subject,originalImageUrl:i.imageUrl||"",paperLevel:i.paperLevel||void 0});return{id:l.id,shortId:l.shortId??null,subjectId:l.subjectId??null,notebookName:l.subject?.name??null,duplicate:l.duplicate}}e.i(201276),e.s(["x",0,i,"a",0,l],25197)},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:i}=(0,n.b)(),l=[i.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=l},[l])}])},825624,e=>{let t=/^[\s ]+/,n="一二三四五六七八九十",i=[{family:"dot",pattern:/^(\d{1,3})\s*(?:.|\.(?!\d))\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function l(e){let l=e.replace(t,"");for(let{family:e,pattern:t}of i){let i=l.match(t);if(!i||l.length<=i[0].length)continue;let s=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?n.indexOf(e)+1:10*(0===t?1:n.indexOf(e[0])+1)+(t===e.length-1?0:n.indexOf(e[t+1])+1)}(i[1]);if(Number.isFinite(s)&&!(s<=0))return{value:s,family:e,prefixLength:i[0].length,label:i[1]}}return null}function s(e){let n=e.split("\n"),i=n[0]?.replace(t,"")??"",s=l(i);return s&&"cn"!==s.family&&(n[0]=i.slice(s.prefixLength)),n.join("\n")}function a(e){let t=[];for(let n of e)(n||0!==t.length&&""!==t[t.length-1])&&t.push(n);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let r=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,o=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,u=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,c=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,h=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,f=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,m=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function d(e){let t=[],n=[];for(let i of e)i?n.push(i):n.length&&(t.push(n.join("\n")),n=[]);return n.length&&t.push(n.join("\n")),t}function p(e,t=[]){let n=e.trim();return!(!n||n.length>12||/[。!?!?,,、;;::..()()【】\[\]{}]$/.test(n)||/\d/.test(n)||/[。!?!?;;,,]/.test(n))&&!!(/(篇|章|节|部分|组)$/.test(n)||/^(Part|Section)\s+[A-Z0-9]+$/i.test(n))&&(!t.length||t.some(e=>{let t=l(e);return null!==t&&1===t.value}))}function g(e,t){let n=[];for(let i=0;i<e.length;i++){let l=e[i],s=[l];for(let n=i+1;n<e.length;n++){let i=e[n],a=s[s.length-1];if(i.family!==l.family)continue;let r=1===i.value&&[...t].some(e=>e>a.line&&e<i.line);(i.value===a.value+1||r)&&s.push(i)}s.length>n.length&&(n=s)}return n}function x(e,t,n){return!!c.test(e)||!!t&&"cn"===t.family&&"cn"!==n&&null!==n&&(e.length<=40||h.test(e.slice(0,20)))}function y(e,t,n,i,l){for(let s=e-1;s>=0;s--)if(t[s]){if(l.has(s)||x(t[s],n[s],i)||p(t[s]))return t[s];break}return null}function w(e){let t=e.match(f);if(!t)return null;let n=Number(t[1]),i=Number(t[2]);return n<=i?{from:n,to:i}:null}let b={answer:/^(?:【\s*(?:参考答案|答案)\s*】|(?:参考答案|答案)\s*[::]|Answer\s*[::])\s*(.*)$/i,analysis:/^(?:【\s*(?:解析|分析|详解|解答|点评)\s*】|(?:解析|分析|详解|解答|点评)\s*[::])\s*(.*)$/,knowledge:/^(?:【\s*(?:知识点|考点)\s*】|(?:知识点|考点)\s*[::])\s*(.*)$/,difficulty:/^(?:【\s*难度\s*】|难度\s*[::])\s*(.*)$/,questionType:/^(?:【\s*题型\s*】|题型\s*[::])\s*(.*)$/,wrongAnswer:/^(?:【\s*错答\s*】|我的答案\s*[::]|学生答案\s*[::])\s*(.*)$/},j={易:1,较易:2,中等:3,较难:4,难:5};function v(e){return e.split(/[、,,;;]/).map(e=>e.trim()).filter(Boolean)}function k(e){let t={answer:[],analysis:[],knowledge:[],difficulty:[],questionType:[],wrongAnswer:[]},n=[],i=null;for(let l of e){let e=null;for(let n of Object.keys(b)){let s=l.match(b[n]);if(!s)continue;e=n,i=n;let a=s[1].trim();a&&t[n].push(a);break}e||(i&&l.trim()?t[i].push(l.trim()):n.push(l))}let l={},s=t.answer.join("\n").trim();s&&(l.answer=s);let r=t.analysis.join("\n").trim();r&&(l.analysis=r);let o=t.knowledge.flatMap(v);o.length&&(l.knowledgePoints=o);let u=t.difficulty.join(" ").trim(),c=u?function(e){let t=e.trim();if(!t)return null;let n=t.match(/^(\d{1,2})\s*(?:星|级)?$/);if(n){let e=Number(n[1]);return e>=1&&e<=5?e:null}if(/^[★☆]{1,5}$/.test(t)){let e=(t.match(/★/g)??[]).length;return e>=1?e:null}return t in j?j[t]:null}(u):null;null!==c&&(l.difficultyStars=c);let h=t.questionType.join(" ").trim();h&&(l.questionType=h);let f=t.wrongAnswer.join("\n").trim();return f&&(l.wrongAnswer=f),{text:a(n),fields:l}}let I=/^(\d{1,3})\s*[..、,,)]\s*(\S[\s\S]*)$/,$=/^(\d{1,3})\s*[~~—–-]\s*(\d{1,3})\s*[::..、]?\s*([A-Za-z]+)$/;function S(e){let t=e.trim();if(!t)return null;let n=function(e){let t=e.trim().match($);if(!t)return null;let n=Number(t[1]),i=Number(t[2]),l=t[3];if(!Number.isFinite(n)||!Number.isFinite(i)||n<=0||i<=n||i-n+1>60)return null;let s=i-n+1;return l.length!==s?null:Array.from({length:s},(e,t)=>({label:String(n+t),text:l[t]}))}(t);if(n)return n;let i=function(e){let t=e.trim(),n=[];for(let e of t.matchAll(/(\d{1,3})\s*[..、,,;;]\s*/g)){let i=e.index??0,l=t[i+e[0].length];l&&/\d/.test(l)||n.push({index:i,label:e[1],afterIndex:i+e[0].length})}if(n.length<2)return null;for(let e=1;e<n.length;e++)if(Number(n[e].label)<=Number(n[e-1].label))return null;let i=[];for(let e=0;e<n.length;e++){let l=n[e].afterIndex,s=e+1<n.length?n[e+1].index:t.length,a=t.slice(l,s).trim().replace(/[;;]+$/,"").trim();if(!a||a.length>30||/[。!?!?]/.test(a))return null;i.push({label:n[e].label,text:a})}return i}(t);if(i)return i.map(e=>({label:e.label??"",text:e.text})).filter(e=>e.label);let l=t.match(I);if(!l)return null;let s=Number(l[1]);return!Number.isFinite(s)||s<=0?null:[{label:l[1],text:l[2].trim()}]}function N(e){let t=e.match(/^(.*?)(?:【?\s*(?:解析|分析|详解|解答|点评)\s*】?\s*[::])([\s\S]*)$/);if(t){let n=t[1].replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim(),i=t[2].trim();return i?{answer:n,analysis:i}:{answer:e.trim()}}return{answer:e.replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim()||e.trim()}}function M(e,t){let n=[],i=!1;for(let l of e){let e={value:!1},s=[];for(let n of l.split("\n")){let i=n.trim()?S(n):null;if(!i){n.trim()&&s.push(n);continue}let l=!1;for(let a of i){let i=t.find(e=>e.label===a.label);if(!i){s.push(n);break}l=!0,e.value=!0;let r=N(a.text);r.answer&&!i.answer&&(i.answer=r.answer),r.analysis&&(i.analysis=i.analysis?`${i.analysis}
|
|
2
|
+
${r.analysis}`:r.analysis)}!l&&!s.includes(n)&&n.trim()&&!s.includes(n)&&s.push(n)}i=i||e.value,e.value?s.length&&n.push(s.join("\n")):n.push(l)}return[n,i]}e.s(["k",0,2e3,"f",0,1e6,"S",0,60,"i",0,2e4,"J",0,function(e,n={}){let i,h,b=void 0===n.maxLength?2e4:Math.min(Math.max(n.maxLength,1e3),1e6),j=void 0===n.maxQuestions?60:Math.min(Math.max(n.maxQuestions,2),2e3),v=e.length>b,I=e.slice(0,b).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),$=I.map(e=>e?l(e):null),A=I.length;for(let e=0;e<I.length;e++)if(u.test(I[e])){A=e;break}let T=[],P=[];for(let e=0;e<A;e++){let t=$[e];t&&("cn"===t.family?P:T).push({...t,line:e})}let C=new Set;for(let e=0;e<A;e++)(c.test(I[e])||$[e]?.family==="cn"||p(I[e],I.slice(e+1,e+5)))&&C.add(e);let q=[],R=g(T,C);if(R.length<2){let e=g(P,new Set);e.length>=2&&(q=[{chain:e,sectionHeading:null}])}else q=function(e,t,n,i){if(e.length<2)return[];let l=e[0].family,s=[0];for(let t=1;t<e.length;t++)1===e[t].value&&s.push(t);if(s.length<2){let s=y(e[0].line,t,n,l,i);return null!==s?[{chain:e,sectionHeading:s}]:[]}let a=[];for(let r=0;r<s.length;r++){let o=s[r],u=r+1<s.length?s[r+1]:e.length,c=e.slice(o,u),h=0===r?y(e[0].line,t,n,l,i):function(e,t,n,i,l,s){for(let a=e+1;a<t;a++)if(n[a]&&(s.has(a)||x(n[a],i[a],l)||p(n[a])))return n[a];return null}(e[o-1].line,e[o].line,t,n,l,i);if(null===h&&r>0){a[a.length-1].chain.push(...c);continue}a.push({chain:c,sectionHeading:h})}return a.filter(e=>e.chain.length>0)}(R,I,$,C);let E=q.length?q.flatMap(e=>e.chain):R,U=a(I.slice(0,A)),B=A<I.length?d(I.slice(A)):[],H=(h=l(I[E[0]?.line??0]??""))?h.label:null,z=e=>({questions:U?[{label:H,text:U,material:null,section:null,lineRange:{from:0,to:A}}]:[],ignored:B,detected:!1,ambiguous:e,candidateCount:e?E.length:+!!U,overflow:0,tooLong:v});if(E.length<2){if(!U)return z(!1);let e=k(U.split("\n")),t=z(!1);if(t.questions.length>0&&Object.keys(e.fields).length>0&&(t.questions[0]={...t.questions[0],text:s(e.text),...e.fields}),t.questions.length>0&&B.length){let[e,n]=M(B,t.questions);t.ignored=e,n||(t.ignored=B)}return t}let O=E[0].family;if(!n.forceNumbered&&function(e,t,n,i){let l=null;for(let s=t-1;s>=0;s--)if(e[s]){l=x(e[s],i[s],n)?null:e[s];break}return!(!l||r.test(l)||f.test(l))&&("paren"===n?l.length>=15||/[。?!?!::,,;;]$/.test(l):/[::]$/.test(l)&&m.test(l))}(I,E[0].line,O,$)){let e=z(!0);if(e.questions.length>0&&U){let t=k(U.split("\n"));Object.keys(t.fields).length>0&&(e.questions[0]={...e.questions[0],text:s(t.text),...t.fields})}return e}let D=new Set(E.map(e=>e.line)),F=[],L=[],_=null,Q=[],W=[],K=(e,t)=>{for(let n of d(e))(!r.test(n)||!(n.length<80))&&(o.test(n)||n.length>=80&&/[。!?.!?;;]/.test(n))?Q.push({text:n,range:w(n)}):t?F.push(n):_&&!L.some(e=>e.section===_)?_=`${_}
|
|
3
|
+
${n}`:F.push(n)},V=E[0].line,X=[];for(let e=0;e<V;e++)I[e]&&(x(I[e],$[e],O)||p(I[e],I.slice(e+1,e+5)))?(K(X.splice(0),!0),_=I[e],W=[]):X.push(I[e]);K(X,!0);let Z=q.length>1,G=e=>{if(!Z)return -1;let t=0;for(let n=0;n<q.length;n++)if(e<(t+=q[n].chain.length))return n;return q.length-1};for(let e=0;e<E.length;e++){let t=E[e].line,n=e+1<E.length?E[e+1].line:A,i=G(e);if(Z&&i>=0){let e=q[i].sectionHeading;null!==e&&(_=e,W=[])}Q.length&&(W=[...W.filter(e=>e.range),...Q],Q=[]);let l=n,r=null;for(let e=t+1;e<n;e++)if(I[e]&&!D.has(e)&&x(I[e],$[e],O)){l=e,r=I[e];break}let u=I.slice(t,l),c=d(u),h=[];for(;c.length>1&&o.test(c[c.length-1].slice(0,30));)h.unshift(c.pop());let f=h.length?c.join("\n"):a(u),m=E[e].value,p=W.filter(e=>!e.range||m>=e.range.from&&m<=e.range.to),g=k(s(f).split("\n"));for(let i of(L.push({label:E[e].label,text:g.text,material:p.length?p.map(e=>e.text).join("\n\n"):null,section:_,lineRange:{from:t,to:n},...g.fields}),h))Q.push({text:i,range:w(i)});null!==r&&(_=r,W=[],K(I.slice(l+1,n),!1))}if(Z&&B.length){let e=q.map(e=>e.sectionHeading).filter(e=>null!==e),t=B.join("\n");i=e.some(e=>t.includes(e))?function(e,t,n){let i=[],l=0,s=t.map(e=>{let t=n.slice(l,l+e.chain.length);return l+=e.chain.length,t}),a=-1;for(let l of e){let e=l.split("\n"),r=[],o=!1;for(let i of e){let e=i.trim();if(!e){r.push(i);continue}let l=t.findIndex(t=>t.sectionHeading&&e.includes(t.sectionHeading));if(l>=0){a=l;continue}let u=S(e);if(!u){r.push(i);continue}let c=a>=0?s[a]:n,h=!1;for(let e of u){let t=c.find(t=>t.label===e.label);if(!t){r.push(i);break}h=!0,o=!0;let n=N(e.text);n.answer&&!t.answer&&(t.answer=n.answer),n.analysis&&(t.analysis=t.analysis?`${t.analysis}
|
|
4
|
+
${n.analysis}`:n.analysis)}h||r.includes(i)||r.push(i)}o?r.length&&i.push(r.join("\n")):i.push(l)}return i}(B,q,L):B}else i=M(B,L)[0];let J=L.slice(j);return{questions:L.slice(0,j),ignored:[...F,...i,...J.map(e=>{var t;let n,i,l,s;return n=(t=e).text.trim(),l=(i=t.material?.trim())?`${i}
|
|
5
|
+
|
|
6
|
+
${n}`:n,s=[],(t.answer?.trim()&&s.push(`参考答案:${t.answer.trim()}`),t.analysis?.trim()&&s.push(`参考解析:${t.analysis.trim()}`),t.wrongAnswer?.trim()&&s.push(`学生作答:${t.wrongAnswer.trim()}`),s.length)?`${l}
|
|
7
|
+
|
|
8
|
+
${s.join("\n\n")}`:l})],detected:!0,ambiguous:!1,candidateCount:L.length,overflow:J.length,tooLong:v}}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,837817,232660,e=>{var t=e.i(456420);let n={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],837817);var r=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,n)=>Math.min(Math.max(e,t),n),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,n){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function h(e,t,n){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...a,...e,unit:"px"}}function c(e,t,n,i,r,a=0,o=0,l=i,s=r){let h={...e},d=Math.min(a,i),u=Math.min(o,r),m=Math.min(l,i),g=Math.min(s,r);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=s/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,d),h.x=0);let p=i-(h.x+h.width);p<0&&(h.x=Math.min(h.x,i-d),h.width+=p);let f=r-(h.y+h.height);if(f<0&&(h.y=Math.min(h.y,r-u),h.height+=f),h.width<d&&(("sw"===n||"nw"==n)&&(h.x-=d-h.width),h.width=d),h.height<u&&(("nw"===n||"ne"==n)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===n||"nw"==n)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===n||"ne"==n)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===n||"ne"==n)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,d);("sw"===n||"nw"==n)&&(h.x-=e-h.width),h.width=e}}return h}var d={capture:!0,passive:!1},u=0,m=class e extends r.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,r.createRef)();mediaRef=(0,r.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:i,height:r}=e.getBoundingClientRect();return{x:t,y:n,width:i,height:r}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&n(h(t,e,i),s(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,i=this.getBox();if(!t)return;let r=h(t,i.width,i.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,l=e.clientY,s=r.x,c=r.y;if(a){let t=e.clientX-i.x,n=e.clientY-i.y,h=0,d=0;"ne"===a||"e"==a?(h=t-(r.x+r.width),d=n-r.y,s=r.x,c=r.y+r.height):"se"===a||"s"===a?(h=t-(r.x+r.width),d=n-(r.y+r.height),s=r.x,c=r.y):"sw"===a||"w"==a?(h=t-r.x,d=n-(r.y+r.height),s=r.x+r.width,c=r.y):("nw"===a||"n"==a)&&(h=t-r.x,d=n-r.y,s=r.x+r.width,c=r.y+r.height),o=s+i.x+h,l=c+i.y+d}this.evData={startClientX:o,startClientY:l,startCropX:s,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:i,keepSelection:r,onChange:a}=this.props,o=this.getBox();if(n||i||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,c=e.clientY-o.y,d={unit:"px",x:l,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(h(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:n,disabled:i,onChange:r,onDragStart:a}=this.props,o=this.getBox();if(i||!n||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,l(n,t=c.isResize?this.resizeCrop():this.dragCrop())||r(h(t,o.width,o.height),s(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:n,disabled:i,onChange:r,onComplete:a}=this.props;if(i)return;let l=t.key,c=!1;if(!n)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===l?(u.x-=m,c=!0):"ArrowRight"===l?(u.x+=m,c=!0):"ArrowUp"===l?(u.y-=m,c=!0):"ArrowDown"===l&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=h(u,d.width,d.height),n=s(u,d.width,d.height);r(e,n),a&&a(e,n)}};onHandlerKeyDown=(t,n)=>{var i,r;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let v=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,b=c((i=h(d,y.width,y.height),r=t.key,a={...i},"ArrowLeft"===r?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"w"===n?(a.x-=v,a.width+=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"e"===n?a.width-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowRight"===r&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"w"===n?(a.x+=v,a.width-=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"e"===n?a.width+=v:"se"===n&&(a.width+=v,a.height+=v)),"ArrowUp"===r?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"n"===n?(a.y-=v,a.height+=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"s"===n?a.height-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowDown"===r&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"n"===n?(a.y+=v,a.height-=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"s"===n?a.height+=v:"se"===n&&(a.width+=v,a.height+=v)),a),o,n,y.width,y.height,m,g,p,f);if(!l(d,b)){let e=s(b,y.width,y.height);w(b,e),x&&x(b,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:i,onDragEnd:r}=this.props,a=this.getBox();this.unbindDocMove(),!(n||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),i&&i(h(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),i=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return n.x=o(e.startCropX+i,0,t.width-n.width),n.y=o(e.startCropY+r,0,t.height-n.height),n}getPointRegion(e,t,n,i){let{evData:r}=this,a=r.clientX-e.x,o=r.clientY-e.y,l;return l=i&&t?"nw"===t||"n"===t||"ne"===t:o<r.startCropY,(n&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,t,n=0,i=0){let r=Math.min(n,e.width),a=Math.min(i,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:i,maxHeight:r}=this.props,a=this.getBox(),[l,s]=this.resolveMinDimensions(a,n,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,l,s),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(s&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-s));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,n?p.height=p.width/n:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,n?p.height=p.width/n:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),n?p.height=p.width/n:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),n?(p.height=p.width/n,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=c(p,n,d,a.width,a.height,l,s,i,r);return n||e.xyOrds.indexOf(u)>-1?h=f:e.xOrds.indexOf(u)>-1?(h.x=f.x,h.width=f.width):e.yOrds.indexOf(u)>-1&&(h.y=f.y,h.height=f.height),h.x=o(h.x,0,a.width-h.width),h.y=o(h.y,0,a.height-h.height),h}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:n,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:l}=this.props,s=this.getCropStyle();if(l)return r.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!i&&r.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},r.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&r.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return h({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:n,className:i,crop:a,disabled:o,locked:l,style:s,ruleOfThirds:h}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",i,c&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return r.default.createElement("div",{ref:this.componentRef,className:m,style:s},r.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?r.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},r.default.createElement("defs",null,r.default.createElement("mask",{id:`hole-${this.instanceId}`},r.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?r.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):r.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),r.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},12130,271945,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(456420);let r={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};r.node;let a=(0,i.f)(r);var o=e.i(759659),l=e.i(837817),s=e.i(232660),h=e.i(519455),c=e.i(776639),d=e.i(263676),u=e.i(111110),m=e.i(895133);let g={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},p=(0,n.forwardRef)(function({imageSrc:e,regions:i,onChange:r,imageStyle:a=g,onImageLoad:o},l){let{t:s}=(0,u.b)(),h=(0,n.useRef)(null),c=(0,n.useRef)(null),[p,f]=(0,n.useState)(null),w=e=>{let t=h.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{p&&p.width>=.02&&p.height>=.02&&r([...i,p]),c.current=null,f(null)},y=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:l,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:h,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(h.current?.setPointerCapture(e.pointerId),c.current=w(e),f(null))},onPointerMove:e=>{if(!c.current)return;let t=w(e);f((0,m.w)(c.current.x,c.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[i.map((e,n)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:n+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(n+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(i.filter((e,t)=>t!==n)),children:(0,t.jsx)(d.X,{className:"h-3 w-3"})})]},n)),p&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(p)})]})]})}),f={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};f.node;let w=(0,i.f)(f),x={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};x.node;let y=(0,i.f)(x);function v({zoom:e,onZoomIn:n,onZoomOut:i,onReset:r}){let{t:a}=(0,u.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:i,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(y,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(w,{className:"h-4 w-4"})})]})}var b=e.i(201276),C=e.i(804536);let D="image-cropper-mode",k=["single","auto","multi"];e.s(["U",0,k,"p",0,D,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let M={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},E=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:i,onClose:r,onCropComplete:d,onMultiCropComplete:g,onRegionsSelected:f,allowMulti:w=!0,onAutoSplit:x,onAddPart:y,partCount:_=0,eraseEnabled:R=!0}){let{t:j}=(0,u.b)(),N=(0,m.f)(e),[S,I]=(0,n.useState)(),P=(0,n.useRef)(null),[L,H]=(0,C.y)(D,k,"single"),Y=["single",...x?["auto"]:[],...g||f&&w?["multi"]:[]],$=Y.includes(L)?L:"single",[A,X]=(0,n.useState)(null),O=null===A?M[$]:{...M[$],maxHeight:`${Math.max(0,A-16)}px`},{containerRef:z,container:B,zoom:U,imageStyle:K,measureImage:T,zoomIn:F,zoomOut:W,reset:q}=function(e){let[t,i]=(0,n.useState)(null),r=(0,n.useRef)(null),a=(0,n.useCallback)(e=>{r.current=e,i(e)},[]),[o,l]=(0,n.useState)(1),s=(0,n.useRef)(1),[h,c]=(0,n.useState)(null),d=(0,n.useRef)(null),u=(0,n.useRef)(!1),m=(0,n.useCallback)((e,t,n)=>{let i=r.current,a=s.current,o=Math.min(5,Math.max(1,e));if(!i||o===a)return;if(1===a){let e=i.querySelector("img");e&&c(e.clientWidth)}let h=i.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(n??h.top+h.height/2)-h.top;d.current={viewX:u,viewY:m,contentX:i.scrollLeft+u,contentY:i.scrollTop+m,ratio:o/a},s.current=o,l(o)},[]);(0,n.useLayoutEffect)(()=>{let e=r.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,n.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},n=null,i=e=>{let[t,n]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-n.clientX,t.clientY-n.clientY),centerX:(t.clientX+n.clientX)/2,centerY:(t.clientY+n.clientY)/2}},r=e=>{2===e.touches.length&&(n={distance:i(e.touches).distance,zoom:s.current},u.current=!0)},a=e=>{if(!n||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=i(e.touches);n.distance>0&&m(n.zoom*(t/n.distance),r,a)},o=e=>{e.touches.length<2&&(n=null,u.current=!1)},l=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",l,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",l,{capture:!0})}},[t,m]);let g=(0,n.useCallback)(e=>{e&&1===s.current&&c(e.clientWidth)},[]),p=(0,n.useCallback)(()=>m(1.25*s.current),[m]),f=(0,n.useCallback)(()=>m(s.current/1.25),[m]),w=(0,n.useCallback)(()=>{s.current=1,d.current=null,l(1)},[]),x=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(O);(0,n.useEffect)(()=>{q()},[e,q]),(0,n.useEffect)(()=>{if(!B)return;let e=new ResizeObserver(([e])=>X(e.contentRect.height));return e.observe(B),()=>e.disconnect()},[B]),(0,n.useEffect)(()=>{let e=B?.querySelector("img");T(e instanceof HTMLImageElement?e:null)},[B,O.maxHeight,U,T]);let[G,V]=(0,n.useState)({src:e,regions:[]}),Q=G.src===e?G.regions:[],Z=t=>V({src:e,regions:t}),J=(0,n.useRef)(null),[ee,et]=(0,n.useState)({src:e,strokes:[]}),en=(0,n.useMemo)(()=>ee.src===e?ee.strokes:[],[ee,e]),ei=t=>et(n=>({src:e,strokes:"function"==typeof t?t(n.strokes):t})),[er,ea]=(0,n.useState)(!1),[eo,el]=(0,n.useState)("medium"),[es,eh]=(0,n.useState)(0),ec=(0,n.useRef)(null),ed=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!R||"multi"===$)return;let e=ec.current,t=P.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let n=e.getContext("2d");n&&(n.clearRect(0,0,e.width,e.height),(0,m.c)(n,en,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[R,$,en,es,U,e,O.maxHeight]),(0,n.useEffect)(()=>{ea(!1),ed.current=null},[e]);let eu=E.find(e=>e.key===eo)?.pixels??7,em=e=>{let t=ec.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},eg=()=>{ed.current=null},ep={single:j.batchImport.singleMode,auto:j.batchImport.autoMode,multi:j.batchImport.multiMode},ef={thin:j.common.cropper.brushThin,medium:j.common.cropper.brushMedium,thick:j.common.cropper.brushThick},ew=async()=>{if(0!==Q.length){if(f){f(Q,!0),Z([]);return}if(J.current&&g)try{g(await (0,m.Y)(J.current,Q)),Z([])}catch(e){b.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},ex=()=>{let e=S&&S.width>0&&S.height>0?{x:S.x/100,y:S.y/100,width:S.width/100,height:S.height/100}:{x:0,y:0,width:1,height:1};return en.length?{...e,erase:en}:e},ey=async()=>{let e=ex();if("auto"===$&&x)return void x(e);if(f)return void f([e],!1);if(P.current&&d)try{let[t]=await (0,m.Y)(P.current,[e]);d(t)}catch(e){b.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(c.N,{open:i,onOpenChange:e=>!e&&r(),children:(0,t.jsxs)(c.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(c.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(c.F,{children:j.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:z,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===$?(0,t.jsx)(p,{ref:J,imageSrc:N,regions:Q,onChange:Z,imageStyle:K,onImageLoad:e=>T(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(s.f,{crop:S,onChange:(e,t)=>I(t),disabled:er,children:(0,t.jsx)("img",{ref:P,alt:"Crop me",src:N,onLoad:function(e){I({unit:"%",x:0,y:0,width:100,height:100}),T(e.currentTarget),eh(e=>e+1)},style:K,className:"block"})}),R&&(0,t.jsx)("canvas",{ref:ec,"aria-hidden":!0,className:`absolute inset-0 ${er?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!er||0!==e.button)return;e.preventDefault(),ec.current?.setPointerCapture(e.pointerId);let t=ec.current;ed.current=en.length,ei([...en,{points:[em(e)],radius:t?eu/t.clientWidth:.006}])},onPointerMove:e=>{let t=ed.current;if(null===t)return;let n=em(e);ei(e=>e.map((e,i)=>{if(i!==t)return e;let r=e.points[e.points.length-1];return r&&5e-4>Math.abs(r.x-n.x)&&5e-4>Math.abs(r.y-n.y)?e:{...e,points:[...e.points,n]}}))},onPointerUp:eg,onPointerCancel:eg})]})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(v,{zoom:U,onZoomIn:F,onZoomOut:W,onReset:q})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[Y.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===Y.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:Y.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":$===e,onClick:()=>{q(),H(e),"multi"===e&&(ea(!1),ei([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${$===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ep[e]},e))}),R&&"multi"!==$&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(h.f,{variant:er?"secondary":"outline",size:"sm",onClick:()=>{ea(e=>!e),ed.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),er?j.common.cropper.eraseDone:j.common.cropper.erase]}),er&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:E.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":eo===e,onClick:()=>el(e),className:`rounded px-2 py-1 text-xs font-medium ${eo===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ef[e]},e))}),en.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>ei(en.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),j.common.cropper.undoErase]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>ei([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(o.f,{className:"h-4 w-4"}),j.common.cropper.clearErase]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===$?`${j.batchImport.hint} ${j.batchImport.regionCount.replace("{count}",String(Q.length))}`:er?j.common.cropper.eraseHint:"auto"===$?j.batchImport.autoHint:_>0?j.upload.parts.cropHint.replace("{n}",String(_+1)):j.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===$&&Q.length>0&&(0,t.jsx)(h.f,{variant:"ghost",onClick:()=>Z([]),children:j.batchImport.clear}),(0,t.jsx)(h.f,{variant:"outline",onClick:r,children:j.common.cancel||"Cancel"}),"multi"===$?(0,t.jsx)(h.f,{onClick:ew,disabled:0===Q.length,children:j.batchImport.start.replace("{count}",String(Q.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===$&&y&&(0,t.jsx)(h.f,{variant:"secondary",onClick:()=>y(ex()),"data-testid":"crop-add-part",children:j.upload.parts.addNext}),(0,t.jsx)(h.f,{onClick:ey,children:"auto"===$?j.batchImport.autoStart:_>0?j.upload.parts.confirm.replace("{count}",String(_+1)):j.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},574041,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(263676),r=e.i(487486),a=e.i(793479),o=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:h="Enter tags...",className:c="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,n.useState)(""),[f,w]=(0,n.useState)([]),[x,y]=(0,n.useState)(!1),[v,b]=(0,n.useState)(0),C=(0,n.useRef)(null),D=(0,n.useRef)(null),k=(0,n.useCallback)(async t=>{try{let n=new URLSearchParams({q:t});u&&n.append("subject",u),m&&n.append("stage",m);let i=((await o.k.get(`/api/tags/suggestions?${n.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),y(i.length>0),b(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,n.useEffect)(()=>{g.trim()&&k(g)},[g,k]);let M=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),b(0))},E=t=>{s(e.filter(e=>e!==t))};return(0,n.useEffect)(()=>{let e=e=>{!D.current||D.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&f[v]?M(f[v]):g.trim()&&M(g)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?h:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:D,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,n)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${n===v?"bg-accent":""}`,onClick:()=>M(e),onMouseEnter:()=>b(n),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},804536,e=>{var t=e.i(271645);let n=new Map,i=new Set;function r(e){return i.add(e),window.addEventListener("storage",e),()=>{i.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let l=(0,t.useSyncExternalStore)(r,()=>(function(e){if(n.has(e))return n.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(l),[a,l]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),n.delete(e)}catch{n.set(e,t)}i.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,n,i){return a(e,(0,t.useCallback)(e=>n.includes(e??"")?e:i,[n,i]),o)},"x",0,a])},213761,895133,e=>{function t(e,t,n,i,r){if(0===t.length)return;let a=r.width/i.sw,o=r.height/i.sh;for(let r of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===r.points.length)continue;let t=r.points.map(e=>({x:(e.x*n.width-i.sx)*a,y:(e.y*n.height-i.sy)*o})),l=Math.max(.5,r.radius*n.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,l,0,2*Math.PI),e.fill();continue}for(let n of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(n.x,n.y);e.lineWidth=2*l,e.stroke()}e.restore()}async function n(e,n){let{naturalWidth:i,naturalHeight:r}=e;return Promise.all(n.map(n=>new Promise((a,o)=>{let l=document.createElement("canvas"),s=Math.round(n.x*i),h=Math.round(n.y*r),c=Math.max(1,Math.round(n.width*i)),d=Math.max(1,Math.round(n.height*r));l.width=c,l.height=d;let u=l.getContext("2d");u?(u.drawImage(e,s,h,c,d,0,0,c,d),t(u,n.erase??[],{width:i,height:r},{sx:s,sy:h,sw:c,sh:d},{width:c,height:d}),l.toBlob(e=>e?a(e):o(Error("Canvas is empty")),"image/jpeg",.95)):o(Error("Canvas is not supported"))})))}e.s(["c",0,t,"Y",0,n,"w",0,function(e,t,n,i){let r=e=>Math.min(1,Math.max(0,e)),a=r(Math.min(e,n)),o=r(Math.min(t,i));return{x:a,y:o,width:r(Math.max(e,n))-a,height:r(Math.max(t,i))-o}},"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let i={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class r extends Error{code;format;constructor(e,t,n){super(e,void 0===n?void 0:{cause:n}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let a=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),o=new Set(["mif1","msf1","mif2"]),l=new Set(["avif","avis"]);function s(e,t,n=i){let r=Math.min(1,n.maxLongEdge/Math.max(e,t),Math.sqrt(n.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(t*r)),scale:r}}async function h(e){let t,n;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let i=await (t=URL.createObjectURL(e),(n=new Image).decoding="async",new Promise((e,i)=>{n.onload=()=>e(n),n.onerror=()=>i(Error("IMAGE_ELEMENT_DECODE_FAILED")),n.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!i.naturalWidth||!i.naturalHeight)throw Error("IMAGE_EMPTY");return i}function c(e){return e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:{width:e.width,height:e.height}}async function d(t){let{heicTo:n}=await e.A(462684);return n({blob:t,type:"image/jpeg",quality:.95})}function u(e,t){return new Promise((n,i)=>{e.toBlob(e=>e?n(e):i(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function m(e,n,i,r,a,o,l,s){let h,d=((h=document.createElement("canvas")).width=o,h.height=l,h),u=d.getContext("2d");if(!u)throw Error("CANVAS_UNSUPPORTED");return u.fillStyle="#ffffff",u.fillRect(0,0,o,l),u.imageSmoothingEnabled=!0,u.imageSmoothingQuality="high",u.drawImage(e,n,i,r,a,0,0,o,l),s?.length&&t(u,s,c(e),{sx:n,sy:i,sw:r,sh:a},{width:o,height:l}),d}async function g(e,t){let n,i=performance.now(),g=await e.arrayBuffer(),p=performance.now()-i,f=function(e){let t=(t,n)=>String.fromCharCode(...e.subarray(t,n));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let n=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),i=[t(8,12)];for(let e=16;e+4<=n;e+=4)i.push(t(e,e+4));if(i.some(e=>a.has(e)))return"heic";if(i.some(e=>l.has(e)))return"avif";if(i.some(e=>o.has(e)))return"heic"}return"unknown"}(new Uint8Array(g,0,Math.min(g.byteLength,64))),w=e.type||"",x=performance.now(),y="native",v=new Blob([g],{type:w||"application/octet-stream"});try{n=await h(v)}catch(e){if("heic"!==f)throw new r("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{n=await h(await d(v)),y="heic"}catch(e){throw new r("HEIC_DECODE_FAILED",f,e)}}let{width:b,height:C}=c(n);if(!b||!C)throw new r("IMAGE_DECODE_FAILED",f);let D=s(b,C,{maxLongEdge:1600,maxPixels:1/0}),k=await u(m(n,0,0,b,C,D.width,D.height),.85),M=URL.createObjectURL(k),E=performance.now()-x;return{source:n,width:b,height:C,format:f,decoder:y,previewUrl:M,sourceType:w,sourceBytes:e.size,timings:{read:Math.round(p),convert:Math.round(E)},dispose:()=>{URL.revokeObjectURL(M),n instanceof HTMLImageElement||n.close()}}}let p={x:0,y:0,width:1,height:1};async function f(e,t=p,n=i){var r;let a=performance.now(),o=e=>Math.min(1,Math.max(0,e)),l=Math.round(o(t.x)*e.width),h=Math.round(o(t.y)*e.height),c=Math.max(1,Math.min(e.width-l,Math.round(o(t.width)*e.width))),d=Math.max(1,Math.min(e.height-h,Math.round(o(t.height)*e.height))),g=s(c,d,n),w=m(e.source,l,h,c,d,g.width,g.height,t.erase),x=performance.now()-a,y=performance.now(),v=n.startQuality,b=await u(w,v);for(let i=0;b.size>n.maxBytes&&i<12;i++)v-.05>=n.minQuality-1e-9?v=Math.round((v-.05)*100)/100:(g={width:Math.max(1,Math.floor(.85*g.width)),height:Math.max(1,Math.floor(.85*g.height)),scale:.85*g.scale},w=m(e.source,l,h,c,d,g.width,g.height,t.erase)),b=await u(w,v);return{dataUrl:await (r=b,new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error??Error("READ_FAILED")),n.readAsDataURL(r)})),width:g.width,height:g.height,bytes:b.size,quality:v,timings:{crop:Math.round(x),compress:Math.round(performance.now()-y)}}}e.s(["K",0,i,"o",0,r,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,g,"X",0,f],213761)},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let n=e.trim().toLowerCase();return n?t[n]??null:null}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let i={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],314381);var r=e.i(843476),a=e.i(271645),o=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let s=(0,t.f)(l),c={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};c.node;let h=(0,t.f)(c);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,i){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${i}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,i))}function v(e,t){let i=(0,x.L)(e,t);for(let e of i)w.V.warn("[GGB]","命令执行失败",{...e});return i.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:i=!1,showAlgebraInput:n=!1,showMenuBar:l=!1,className:c="",onRegenerate:C,onDelete:k}){let{t:j}=(0,p.b)(),M=(0,a.useRef)(null),E=(0,a.useRef)(null),D=(0,a.useRef)(void 0),N=(0,a.useId)(),_=(0,a.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,S]=(0,a.useState)(!0),[L,I]=(0,a.useState)(null),[P,z]=(0,a.useState)(!0),[H,$]=(0,a.useState)(!1),[A,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,r=_.current,a=M.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let i=document.createElement("script");i.src="https://www.geogebra.org/apps/deployggb.js",i.async=!0,i.onload=()=>e(),i.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(i)}))).then(()=>{if(e)return;let o=window.GGBApplet;if(!o){I(j.geogebra.notLoaded),S(!1);return}if(a){a.innerHTML=`<div id="${r}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:i,showAlgebraInput:n,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:i=>{e||(E.current=i,b(a,i,t),D.current=v(i,Y),S(!1))}},!0).inject(r)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(I(j.geogebra.initFailed),S(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(I(j.geogebra.scriptFailed),S(!1))}),()=>{e=!0;try{let e=E.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}E.current=null,a&&(a.innerHTML="")}},[Y,i,n,l]),(0,a.useEffect)(()=>{b(M.current,E.current,P?700:t)},[P,t]);let O=(0,a.useCallback)(()=>{let e=E.current;if(e)try{e.resetConstruction(),setTimeout(()=>{E.current&&(D.current=v(E.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),X=(0,a.useCallback)(async()=>{if(C&&!H){$(!0);try{await C(D.current)}finally{$(!1)}}},[C,H]),U=(0,a.useCallback)(async()=>{if(k&&!A&&await (0,f.u)(j.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await k()}catch{f.c.error(j.geogebra.deleteFailed)}finally{B(!1)}}},[k,A,j]);return 0===Y.length?null:(0,r.jsxs)("div",{className:`relative rounded-lg border bg-card ${c}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:j.geogebra.title}),R&&(0,r.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:X,title:j.geogebra.regenerate,disabled:H||R,children:[H?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.regenerate})]}),k&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:U,title:j.geogebra.delete,disabled:A||H,children:[A?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.delete})]}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:O,title:j.geogebra.reset,disabled:R,children:(0,r.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>z(e=>!e),title:P?j.geogebra.shrink:j.geogebra.enlarge,children:P?(0,r.jsx)(h,{className:"h-3.5 w-3.5"}):(0,r.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("div",{ref:M,style:{width:"100%"}}),R&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:j.geogebra.loading})]})}),L&&(0,r.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:L})]})}],3198)},856522,e=>{var t=e.i(456420);let i={name:"save",size:24,node:[["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"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],856522)},786563,e=>{var t=e.i(456420);let i={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],786563)},837817,232660,e=>{var t=e.i(456420);let i={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],837817);var r=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,i)=>Math.min(Math.max(e,t),i),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,i){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/i*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/i*100:0}}function c(e,t,i){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*i/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*i/100:0}:{...a,...e,unit:"px"}}function h(e,t,i,n,r,a=0,o=0,l=n,s=r){let c={...e},d=Math.min(a,n),u=Math.min(o,r),m=Math.min(l,n),g=Math.min(s,r);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=s/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let p=n-(c.x+c.width);p<0&&(c.x=Math.min(c.x,n-d),c.width+=p);let f=r-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,r-u),c.height+=f),c.width<d&&(("sw"===i||"nw"==i)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===i||"ne"==i)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===i||"nw"==i)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===i||"ne"==i)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===i||"ne"==i)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===i||"nw"==i)&&(c.x-=e-c.width),c.width=e}}return c}var d={capture:!0,passive:!1},u=0,m=class e extends r.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,r.createRef)();mediaRef=(0,r.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:i,width:n,height:r}=e.getBoundingClientRect();return{x:t,y:i,width:n,height:r}}componentDidUpdate(e){let{crop:t,onComplete:i}=this.props;if(i&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&i(c(t,e,n),s(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:i}=this.props,n=this.getBox();if(!t)return;let r=c(t,n.width,n.height);if(i)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,l=e.clientY,s=r.x,h=r.y;if(a){let t=e.clientX-n.x,i=e.clientY-n.y,c=0,d=0;"ne"===a||"e"==a?(c=t-(r.x+r.width),d=i-r.y,s=r.x,h=r.y+r.height):"se"===a||"s"===a?(c=t-(r.x+r.width),d=i-(r.y+r.height),s=r.x,h=r.y):"sw"===a||"w"==a?(c=t-r.x,d=i-(r.y+r.height),s=r.x+r.width,h=r.y):("nw"===a||"n"==a)&&(c=t-r.x,d=i-r.y,s=r.x+r.width,h=r.y+r.height),o=s+n.x+c,l=h+n.y+d}this.evData={startClientX:o,startClientY:l,startCropX:s,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:i,locked:n,keepSelection:r,onChange:a}=this.props,o=this.getBox();if(i||n||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,h=e.clientY-o.y,d={unit:"px",x:l,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:i,disabled:n,onChange:r,onDragStart:a}=this.props,o=this.getBox();if(n||!i||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,l(i,t=h.isResize?this.resizeCrop():this.dragCrop())||r(c(t,o.width,o.height),s(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:i,disabled:n,onChange:r,onComplete:a}=this.props;if(n)return;let l=t.key,h=!1;if(!i)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===l?(u.x-=m,h=!0):"ArrowRight"===l?(u.x+=m,h=!0):"ArrowUp"===l?(u.y-=m,h=!0):"ArrowDown"===l&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=c(u,d.width,d.height),i=s(u,d.width,d.height);r(e,i),a&&a(e,i)}};onHandlerKeyDown=(t,i)=>{var n,r;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=h((n=c(d,y.width,y.height),r=t.key,a={...n},"ArrowLeft"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===i?(a.x-=b,a.width+=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"e"===i?a.width-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowRight"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===i?(a.x+=b,a.width-=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"e"===i?a.width+=b:"se"===i&&(a.width+=b,a.height+=b)),"ArrowUp"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===i?(a.y-=b,a.height+=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"s"===i?a.height-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowDown"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===i?(a.y+=b,a.height-=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"s"===i?a.height+=b:"se"===i&&(a.width+=b,a.height+=b)),a),o,i,y.width,y.height,m,g,p,f);if(!l(d,v)){let e=s(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:i,onComplete:n,onDragEnd:r}=this.props,a=this.getBox();this.unbindDocMove(),!(i||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),n&&n(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),i=this.makePixelCrop(t),n=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return i.x=o(e.startCropX+n,0,t.width-i.width),i.y=o(e.startCropY+r,0,t.height-i.height),i}getPointRegion(e,t,i,n){let{evData:r}=this,a=r.clientX-e.x,o=r.clientY-e.y,l;return l=n&&t?"nw"===t||"n"===t||"ne"===t:o<r.startCropY,(i&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,t,i=0,n=0){let r=Math.min(i,e.width),a=Math.min(n,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:i=0,maxWidth:n,maxHeight:r}=this.props,a=this.getBox(),[l,s]=this.resolveMinDimensions(a,i,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,l,s),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(s&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-s));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,i?p.height=p.width/i:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,i?p.height=p.width/i:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),i?p.height=p.width/i:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),i?(p.height=p.width/i,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=h(p,i,d,a.width,a.height,l,s,n,r);return i||e.xyOrds.indexOf(u)>-1?c=f:e.xOrds.indexOf(u)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(u)>-1&&(c.y=f.y,c.height=f.height),c.x=o(c.x,0,a.width-c.width),c.y=o(c.y,0,a.height-c.height),c}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:i,locked:n,renderSelectionAddon:a,ruleOfThirds:o,crop:l}=this.props,s=this.getCropStyle();if(l)return r.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!n&&r.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},r.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&r.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return c({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:i,className:n,crop:a,disabled:o,locked:l,style:s,ruleOfThirds:c}=this.props,{cropIsActive:h,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,h&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&i&&"ReactCrop--circular-crop",a&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");return r.default.createElement("div",{ref:this.componentRef,className:m,style:s},r.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?r.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},r.default.createElement("defs",null,r.default.createElement("mask",{id:`hole-${this.instanceId}`},r.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),i?r.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):r.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),r.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},469937,e=>{var t=e.i(843476),i=e.i(786563),n=e.i(111110),r=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:l,size:s="sm",showUnrated:c=!0,className:h}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===s?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",h),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",h),children:d.difficulty.unrated}):null}])},12130,271945,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};r.node;let a=(0,n.f)(r);var o=e.i(759659),l=e.i(837817),s=e.i(232660),c=e.i(519455),h=e.i(776639),d=e.i(263676),u=e.i(111110),m=e.i(895133);let g={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},p=(0,i.forwardRef)(function({imageSrc:e,regions:n,onChange:r,imageStyle:a=g,onImageLoad:o},l){let{t:s}=(0,u.b)(),c=(0,i.useRef)(null),h=(0,i.useRef)(null),[p,f]=(0,i.useState)(null),w=e=>{let t=c.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{p&&p.width>=.02&&p.height>=.02&&r([...n,p]),h.current=null,f(null)},y=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:l,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:c,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(c.current?.setPointerCapture(e.pointerId),h.current=w(e),f(null))},onPointerMove:e=>{if(!h.current)return;let t=w(e);f((0,m.w)(h.current.x,h.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[n.map((e,i)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:i+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(i+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(n.filter((e,t)=>t!==i)),children:(0,t.jsx)(d.X,{className:"h-3 w-3"})})]},i)),p&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(p)})]})]})}),f={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};f.node;let w=(0,n.f)(f),x={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};x.node;let y=(0,n.f)(x);function b({zoom:e,onZoomIn:i,onZoomOut:n,onReset:r}){let{t:a}=(0,u.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(y,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:i,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(w,{className:"h-4 w-4"})})]})}var v=e.i(201276),C=e.i(804536);let k="image-cropper-mode",j=["single","auto","multi"];e.s(["U",0,j,"p",0,k,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let M={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},E=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:n,onClose:r,onCropComplete:d,onMultiCropComplete:g,onRegionsSelected:f,allowMulti:w=!0,onAutoSplit:x,onAddPart:y,partCount:D=0,eraseEnabled:N=!0}){let{t:_}=(0,u.b)(),R=(0,m.f)(e),[S,L]=(0,i.useState)(),I=(0,i.useRef)(null),[P,z]=(0,C.y)(k,j,"single"),H=["single",...x?["auto"]:[],...g||f&&w?["multi"]:[]],$=H.includes(P)?P:"single",[A,B]=(0,i.useState)(null),Y=null===A?M[$]:{...M[$],maxHeight:`${Math.max(0,A-16)}px`},{containerRef:O,container:X,zoom:U,imageStyle:T,measureImage:F,zoomIn:K,zoomOut:W,reset:G}=function(e){let[t,n]=(0,i.useState)(null),r=(0,i.useRef)(null),a=(0,i.useCallback)(e=>{r.current=e,n(e)},[]),[o,l]=(0,i.useState)(1),s=(0,i.useRef)(1),[c,h]=(0,i.useState)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(!1),m=(0,i.useCallback)((e,t,i)=>{let n=r.current,a=s.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&h(e.clientWidth)}let c=n.getBoundingClientRect(),u=(t??c.left+c.width/2)-c.left,m=(i??c.top+c.height/2)-c.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},s.current=o,l(o)},[]);(0,i.useLayoutEffect)(()=>{let e=r.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,i.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},i=null,n=e=>{let[t,i]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-i.clientX,t.clientY-i.clientY),centerX:(t.clientX+i.clientX)/2,centerY:(t.clientY+i.clientY)/2}},r=e=>{2===e.touches.length&&(i={distance:n(e.touches).distance,zoom:s.current},u.current=!0)},a=e=>{if(!i||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=n(e.touches);i.distance>0&&m(i.zoom*(t/i.distance),r,a)},o=e=>{e.touches.length<2&&(i=null,u.current=!1)},l=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",l,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",l,{capture:!0})}},[t,m]);let g=(0,i.useCallback)(e=>{e&&1===s.current&&h(e.clientWidth)},[]),p=(0,i.useCallback)(()=>m(1.25*s.current),[m]),f=(0,i.useCallback)(()=>m(s.current/1.25),[m]),w=(0,i.useCallback)(()=>{s.current=1,d.current=null,l(1)},[]),x=1!==o&&c?{...e,width:c*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(Y);(0,i.useEffect)(()=>{G()},[e,G]),(0,i.useEffect)(()=>{if(!X)return;let e=new ResizeObserver(([e])=>B(e.contentRect.height));return e.observe(X),()=>e.disconnect()},[X]),(0,i.useEffect)(()=>{let e=X?.querySelector("img");F(e instanceof HTMLImageElement?e:null)},[X,Y.maxHeight,U,F]);let[V,q]=(0,i.useState)({src:e,regions:[]}),Z=V.src===e?V.regions:[],Q=t=>q({src:e,regions:t}),J=(0,i.useRef)(null),[ee,et]=(0,i.useState)({src:e,strokes:[]}),ei=(0,i.useMemo)(()=>ee.src===e?ee.strokes:[],[ee,e]),en=t=>et(i=>({src:e,strokes:"function"==typeof t?t(i.strokes):t})),[er,ea]=(0,i.useState)(!1),[eo,el]=(0,i.useState)("medium"),[es,ec]=(0,i.useState)(0),eh=(0,i.useRef)(null),ed=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!N||"multi"===$)return;let e=eh.current,t=I.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let i=e.getContext("2d");i&&(i.clearRect(0,0,e.width,e.height),(0,m.c)(i,ei,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[N,$,ei,es,U,e,Y.maxHeight]),(0,i.useEffect)(()=>{ea(!1),ed.current=null},[e]);let eu=E.find(e=>e.key===eo)?.pixels??7,em=e=>{let t=eh.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},eg=()=>{ed.current=null},ep={single:_.batchImport.singleMode,auto:_.batchImport.autoMode,multi:_.batchImport.multiMode},ef={thin:_.common.cropper.brushThin,medium:_.common.cropper.brushMedium,thick:_.common.cropper.brushThick},ew=async()=>{if(0!==Z.length){if(f){f(Z,!0),Q([]);return}if(J.current&&g)try{g(await (0,m.Y)(J.current,Z)),Q([])}catch(e){v.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},ex=()=>{let e=S&&S.width>0&&S.height>0?{x:S.x/100,y:S.y/100,width:S.width/100,height:S.height/100}:{x:0,y:0,width:1,height:1};return ei.length?{...e,erase:ei}:e},ey=async()=>{let e=ex();if("auto"===$&&x)return void x(e);if(f)return void f([e],!1);if(I.current&&d)try{let[t]=await (0,m.Y)(I.current,[e]);d(t)}catch(e){v.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(h.N,{open:n,onOpenChange:e=>!e&&r(),children:(0,t.jsxs)(h.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(h.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(h.F,{children:_.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:O,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===$?(0,t.jsx)(p,{ref:J,imageSrc:R,regions:Z,onChange:Q,imageStyle:T,onImageLoad:e=>F(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(s.f,{crop:S,onChange:(e,t)=>L(t),disabled:er,children:(0,t.jsx)("img",{ref:I,alt:"Crop me",src:R,onLoad:function(e){L({unit:"%",x:0,y:0,width:100,height:100}),F(e.currentTarget),ec(e=>e+1)},style:T,className:"block"})}),N&&(0,t.jsx)("canvas",{ref:eh,"aria-hidden":!0,className:`absolute inset-0 ${er?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!er||0!==e.button)return;e.preventDefault(),eh.current?.setPointerCapture(e.pointerId);let t=eh.current;ed.current=ei.length,en([...ei,{points:[em(e)],radius:t?eu/t.clientWidth:.006}])},onPointerMove:e=>{let t=ed.current;if(null===t)return;let i=em(e);en(e=>e.map((e,n)=>{if(n!==t)return e;let r=e.points[e.points.length-1];return r&&5e-4>Math.abs(r.x-i.x)&&5e-4>Math.abs(r.y-i.y)?e:{...e,points:[...e.points,i]}}))},onPointerUp:eg,onPointerCancel:eg})]})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(b,{zoom:U,onZoomIn:K,onZoomOut:W,onReset:G})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[H.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===H.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:H.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":$===e,onClick:()=>{G(),z(e),"multi"===e&&(ea(!1),en([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${$===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ep[e]},e))}),N&&"multi"!==$&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(c.f,{variant:er?"secondary":"outline",size:"sm",onClick:()=>{ea(e=>!e),ed.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),er?_.common.cropper.eraseDone:_.common.cropper.erase]}),er&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:E.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":eo===e,onClick:()=>el(e),className:`rounded px-2 py-1 text-xs font-medium ${eo===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ef[e]},e))}),ei.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>en(ei.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),_.common.cropper.undoErase]}),(0,t.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>en([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(o.f,{className:"h-4 w-4"}),_.common.cropper.clearErase]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===$?`${_.batchImport.hint} ${_.batchImport.regionCount.replace("{count}",String(Z.length))}`:er?_.common.cropper.eraseHint:"auto"===$?_.batchImport.autoHint:D>0?_.upload.parts.cropHint.replace("{n}",String(D+1)):_.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===$&&Z.length>0&&(0,t.jsx)(c.f,{variant:"ghost",onClick:()=>Q([]),children:_.batchImport.clear}),(0,t.jsx)(c.f,{variant:"outline",onClick:r,children:_.common.cancel||"Cancel"}),"multi"===$?(0,t.jsx)(c.f,{onClick:ew,disabled:0===Z.length,children:_.batchImport.start.replace("{count}",String(Z.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===$&&y&&(0,t.jsx)(c.f,{variant:"secondary",onClick:()=>y(ex()),"data-testid":"crop-add-part",children:_.upload.parts.addNext}),(0,t.jsx)(c.f,{onClick:ey,children:"auto"===$?_.batchImport.autoStart:D>0?_.upload.parts.confirm.replace("{count}",String(D+1)):_.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};r.node;let a=(0,n.f)(r);var o=e.i(772382),l=e.i(511445),s=e.i(624687),c=e.i(111110),h=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:r,...d}){let{t:u}=(0,c.b)(),[m,g]=(0,i.useState)("source"),p=(0,i.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:i,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,h.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),i]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>n(e.target.value),className:r,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(967489),r=e.i(856423),a=e.i(41931),o=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:s,className:c}){let[h,d]=(0,i.useState)([]),{t:u}=(0,l.b)();return(0,i.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:s,children:[(0,t.jsx)(n.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],438465);var s=e.i(470279);e.s(["f",0,function({value:e,onChange:i,disabled:r}){let{groups:a,loading:o}=(0,s.f)(),l=a.filter(e=>e.isActive);return(0,t.jsxs)(n.d,{value:e,onValueChange:i,disabled:r||o,children:[(0,t.jsx)(n.P,{children:(0,t.jsx)(n.U,{placeholder:"选择卷别"})}),(0,t.jsx)(n.r,{children:l.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),i=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:s,className:c}){let{t:h}=(0,i.b)();if(!e)return null;let d=(0,r.V)(l),u=(0,r.o)(s);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:h.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(263676),r=e.i(487486),a=e.i(793479),o=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:c="Enter tags...",className:h="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,i.useState)(""),[f,w]=(0,i.useState)([]),[x,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(0),C=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useCallback)(async t=>{try{let i=new URLSearchParams({q:t});u&&i.append("subject",u),m&&i.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${i.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,i.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let M=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),v(0))},E=t=>{s(e.filter(e=>e!==t))};return(0,i.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?M(f[b]):g.trim()&&M(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,i)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${i===b?"bg-accent":""}`,onClick:()=>M(e),onMouseEnter:()=>v(i),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],i="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,i,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:i},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},804536,e=>{var t=e.i(271645);let i=new Map,n=new Set;function r(e){return n.add(e),window.addEventListener("storage",e),()=>{n.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let l=(0,t.useSyncExternalStore)(r,()=>(function(e){if(i.has(e))return i.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(l),[a,l]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),i.delete(e)}catch{i.set(e,t)}n.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,i,n){return a(e,(0,t.useCallback)(e=>i.includes(e??"")?e:n,[i,n]),o)},"x",0,a])},213761,895133,e=>{function t(e,t,i,n,r){if(0===t.length)return;let a=r.width/n.sw,o=r.height/n.sh;for(let r of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===r.points.length)continue;let t=r.points.map(e=>({x:(e.x*i.width-n.sx)*a,y:(e.y*i.height-n.sy)*o})),l=Math.max(.5,r.radius*i.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,l,0,2*Math.PI),e.fill();continue}for(let i of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(i.x,i.y);e.lineWidth=2*l,e.stroke()}e.restore()}async function i(e,i){let{naturalWidth:n,naturalHeight:r}=e;return Promise.all(i.map(i=>new Promise((a,o)=>{let l=document.createElement("canvas"),s=Math.round(i.x*n),c=Math.round(i.y*r),h=Math.max(1,Math.round(i.width*n)),d=Math.max(1,Math.round(i.height*r));l.width=h,l.height=d;let u=l.getContext("2d");u?(u.drawImage(e,s,c,h,d,0,0,h,d),t(u,i.erase??[],{width:n,height:r},{sx:s,sy:c,sw:h,sh:d},{width:h,height:d}),l.toBlob(e=>e?a(e):o(Error("Canvas is empty")),"image/jpeg",.95)):o(Error("Canvas is not supported"))})))}e.s(["c",0,t,"Y",0,i,"w",0,function(e,t,i,n){let r=e=>Math.min(1,Math.max(0,e)),a=r(Math.min(e,i)),o=r(Math.min(t,n));return{x:a,y:o,width:r(Math.max(e,i))-a,height:r(Math.max(t,n))-o}},"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let n={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class r extends Error{code;format;constructor(e,t,i){super(e,void 0===i?void 0:{cause:i}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let a=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),o=new Set(["mif1","msf1","mif2"]),l=new Set(["avif","avis"]);function s(e,t,i=n){let r=Math.min(1,i.maxLongEdge/Math.max(e,t),Math.sqrt(i.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(t*r)),scale:r}}async function c(e){let t,i;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(i=new Image).decoding="async",new Promise((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),i.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}function h(e){return e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:{width:e.width,height:e.height}}async function d(t){let{heicTo:i}=await e.A(462684);return i({blob:t,type:"image/jpeg",quality:.95})}function u(e,t){return new Promise((i,n)=>{e.toBlob(e=>e?i(e):n(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function m(e,i,n,r,a,o,l,s){let c,d=((c=document.createElement("canvas")).width=o,c.height=l,c),u=d.getContext("2d");if(!u)throw Error("CANVAS_UNSUPPORTED");return u.fillStyle="#ffffff",u.fillRect(0,0,o,l),u.imageSmoothingEnabled=!0,u.imageSmoothingQuality="high",u.drawImage(e,i,n,r,a,0,0,o,l),s?.length&&t(u,s,h(e),{sx:i,sy:n,sw:r,sh:a},{width:o,height:l}),d}async function g(e,t){let i,n=performance.now(),g=await e.arrayBuffer(),p=performance.now()-n,f=function(e){let t=(t,i)=>String.fromCharCode(...e.subarray(t,i));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let i=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),n=[t(8,12)];for(let e=16;e+4<=i;e+=4)n.push(t(e,e+4));if(n.some(e=>a.has(e)))return"heic";if(n.some(e=>l.has(e)))return"avif";if(n.some(e=>o.has(e)))return"heic"}return"unknown"}(new Uint8Array(g,0,Math.min(g.byteLength,64))),w=e.type||"",x=performance.now(),y="native",b=new Blob([g],{type:w||"application/octet-stream"});try{i=await c(b)}catch(e){if("heic"!==f)throw new r("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{i=await c(await d(b)),y="heic"}catch(e){throw new r("HEIC_DECODE_FAILED",f,e)}}let{width:v,height:C}=h(i);if(!v||!C)throw new r("IMAGE_DECODE_FAILED",f);let k=s(v,C,{maxLongEdge:1600,maxPixels:1/0}),j=await u(m(i,0,0,v,C,k.width,k.height),.85),M=URL.createObjectURL(j),E=performance.now()-x;return{source:i,width:v,height:C,format:f,decoder:y,previewUrl:M,sourceType:w,sourceBytes:e.size,timings:{read:Math.round(p),convert:Math.round(E)},dispose:()=>{URL.revokeObjectURL(M),i instanceof HTMLImageElement||i.close()}}}let p={x:0,y:0,width:1,height:1};async function f(e,t=p,i=n){var r;let a=performance.now(),o=e=>Math.min(1,Math.max(0,e)),l=Math.round(o(t.x)*e.width),c=Math.round(o(t.y)*e.height),h=Math.max(1,Math.min(e.width-l,Math.round(o(t.width)*e.width))),d=Math.max(1,Math.min(e.height-c,Math.round(o(t.height)*e.height))),g=s(h,d,i),w=m(e.source,l,c,h,d,g.width,g.height,t.erase),x=performance.now()-a,y=performance.now(),b=i.startQuality,v=await u(w,b);for(let n=0;v.size>i.maxBytes&&n<12;n++)b-.05>=i.minQuality-1e-9?b=Math.round((b-.05)*100)/100:(g={width:Math.max(1,Math.floor(.85*g.width)),height:Math.max(1,Math.floor(.85*g.height)),scale:.85*g.scale},w=m(e.source,l,c,h,d,g.width,g.height,t.erase)),v=await u(w,b);return{dataUrl:await (r=v,new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>t(i.error??Error("READ_FAILED")),i.readAsDataURL(r)})),width:g.width,height:g.height,bytes:v.size,quality:b,timings:{crop:Math.round(x),compress:Math.round(performance.now()-y)}}}e.s(["K",0,n,"o",0,r,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,g,"X",0,f],213761)},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,i="zh"){return("en"===i?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,i){return(i||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?t[i]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,462684,t=>{t.v(l=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(l=>t.l(l))).then(()=>l(506175)))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],711241)},562215,e=>{var s=e.i(456420);let t={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],562215)},590546,e=>{var s=e.i(843476),t=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let l=(0,t.useRouter)();return(0,s.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:n,children:(0,s.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,e=>{var s=e.i(843476),t=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:i,action:n,className:l}){return(0,s.jsxs)("div",{className:(0,t.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",l),children:[(0,s.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,s.jsx)(e,{className:"h-7 w-7"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),i&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),n&&(0,s.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var s=e.i(843476),t=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:l,titleAddon:r,className:c}){return(0,s.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[n&&(0,s.jsx)(t.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),i&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),l&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})}])},86963,e=>{var s=e.i(843476),t=e.i(632781);e.s(["f",0,function({label:e}){return(0,s.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,s.jsx)(t.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,s.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,t.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=i},[i])}])}],462684,e=>{e.v(s=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(s=>e.l(s))).then(()=>s(506175)))}]);
|
package/package.json
CHANGED
package/prisma/seed.db
CHANGED
|
Binary file
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[[97546,a=>{var b=a.i(164831);let c={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],97546)},308658,a=>{var b=a.i(164831);let c={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],308658)},391020,a=>{let b={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};a.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(a){if("string"!=typeof a)return null;let c=a.trim().toLowerCase();return c?b[c]??null:null}])}],627280,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js"].map(b=>a.l(b))).then(()=>b(469425)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0a0h6yv1_61zn._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[543569,a=>{var b=a.i(572131),c={x:0,y:0,width:0,height:0,unit:"px"},d=(a,b,c)=>Math.min(Math.max(a,b),c),e=(a,b)=>a===b||a.width===b.width&&a.height===b.height&&a.x===b.x&&a.y===b.y&&a.unit===b.unit;function f(a,b,d){return"%"===a.unit?{...c,...a,unit:"%"}:{unit:"%",x:a.x?a.x/b*100:0,y:a.y?a.y/d*100:0,width:a.width?a.width/b*100:0,height:a.height?a.height/d*100:0}}function g(a,b,d){return a.unit&&"px"!==a.unit?{unit:"px",x:a.x?a.x*b/100:0,y:a.y?a.y*d/100:0,width:a.width?a.width*b/100:0,height:a.height?a.height*d/100:0}:{...c,...a,unit:"px"}}function h(a,b,c,d,e,f=0,g=0,i=d,j=e){let k={...a},l=Math.min(f,d),m=Math.min(g,e),n=Math.min(i,d),o=Math.min(j,e);b&&(b>1?(m=(l=g?g*b:l)/b,n=i*b):(l=(m=f?f/b:m)*b,o=j/b)),k.y<0&&(k.height=Math.max(k.height+k.y,m),k.y=0),k.x<0&&(k.width=Math.max(k.width+k.x,l),k.x=0);let p=d-(k.x+k.width);p<0&&(k.x=Math.min(k.x,d-l),k.width+=p);let q=e-(k.y+k.height);if(q<0&&(k.y=Math.min(k.y,e-m),k.height+=q),k.width<l&&(("sw"===c||"nw"==c)&&(k.x-=l-k.width),k.width=l),k.height<m&&(("nw"===c||"ne"==c)&&(k.y-=m-k.height),k.height=m),k.width>n&&(("sw"===c||"nw"==c)&&(k.x-=n-k.width),k.width=n),k.height>o&&(("nw"===c||"ne"==c)&&(k.y-=o-k.height),k.height=o),b){let a=k.width/k.height;if(a<b){let a=Math.max(k.width/b,m);("nw"===c||"ne"==c)&&(k.y-=a-k.height),k.height=a}else if(a>b){let a=Math.max(k.height*b,l);("sw"===c||"nw"==c)&&(k.x-=a-k.width),k.width=a}}return k}var i={capture:!0,passive:!1},j=0,k=class a extends b.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,b.createRef)();mediaRef=(0,b.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${j++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let a=this.mediaRef.current;if(!a)return{x:0,y:0,width:0,height:0};let{x:b,y:c,width:d,height:e}=a.getBoundingClientRect();return{x:b,y:c,width:d,height:e}}componentDidUpdate(a){let{crop:b,onComplete:c}=this.props;if(c&&!a.crop&&b){let{width:a,height:d}=this.getBox();a&&d&&c(g(b,a,d),f(b,a,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,i),this.document.addEventListener("pointerup",this.onDocPointerDone,i),this.document.addEventListener("pointercancel",this.onDocPointerDone,i),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,i),this.document.removeEventListener("pointerup",this.onDocPointerDone,i),this.document.removeEventListener("pointercancel",this.onDocPointerDone,i),!1)}onCropPointerDown=a=>{let{crop:b,disabled:c}=this.props,d=this.getBox();if(!b)return;let e=g(b,d.width,d.height);if(c)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let f=a.target.dataset.ord,h=a.clientX,i=a.clientY,j=e.x,k=e.y;if(f){let b=a.clientX-d.x,c=a.clientY-d.y,g=0,l=0;"ne"===f||"e"==f?(g=b-(e.x+e.width),l=c-e.y,j=e.x,k=e.y+e.height):"se"===f||"s"===f?(g=b-(e.x+e.width),l=c-(e.y+e.height),j=e.x,k=e.y):"sw"===f||"w"==f?(g=b-e.x,l=c-(e.y+e.height),j=e.x+e.width,k=e.y):("nw"===f||"n"==f)&&(g=b-e.x,l=c-e.y,j=e.x+e.width,k=e.y+e.height),h=j+d.x+g,i=k+d.y+l}this.evData={startClientX:h,startClientY:i,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!!f,ord:f},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=a=>{let{crop:b,disabled:c,locked:d,keepSelection:e,onChange:h}=this.props,i=this.getBox();if(c||d||e&&b)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let j=a.clientX-i.x,k=a.clientY-i.y,l={unit:"px",x:j,y:k,width:0,height:0};this.evData={startClientX:a.clientX,startClientY:a.clientY,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!0},this.mouseDownOnCrop=!0,h(g(l,i.width,i.height),f(l,i.width,i.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=a=>{let b,{crop:c,disabled:d,onChange:h,onDragStart:i}=this.props,j=this.getBox();if(d||!c||!this.mouseDownOnCrop)return;a.cancelable&&a.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(a));let{evData:k}=this;k.clientX=a.clientX,k.clientY=a.clientY,e(c,b=k.isResize?this.resizeCrop():this.dragCrop())||h(g(b,j.width,j.height),f(b,j.width,j.height))};onComponentKeyDown=b=>{let{crop:c,disabled:e,onChange:h,onComplete:i}=this.props;if(e)return;let j=b.key,k=!1;if(!c)return;let l=this.getBox(),m=this.makePixelCrop(l),n=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep;if("ArrowLeft"===j?(m.x-=n,k=!0):"ArrowRight"===j?(m.x+=n,k=!0):"ArrowUp"===j?(m.y-=n,k=!0):"ArrowDown"===j&&(m.y+=n,k=!0),k){b.cancelable&&b.preventDefault(),m.x=d(m.x,0,l.width-m.width),m.y=d(m.y,0,l.height-m.height);let a=g(m,l.width,l.height),c=f(m,l.width,l.height);h(a,c),i&&i(a,c)}};onHandlerKeyDown=(b,c)=>{var d,i;let j,{aspect:k=0,crop:l,disabled:m,minWidth:n=0,minHeight:o=0,maxWidth:p,maxHeight:q,onChange:r,onComplete:s}=this.props,t=this.getBox();if(m||!l||"ArrowUp"!==b.key&&"ArrowDown"!==b.key&&"ArrowLeft"!==b.key&&"ArrowRight"!==b.key)return;b.stopPropagation(),b.preventDefault();let u=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep,v=h((d=g(l,t.width,t.height),i=b.key,j={...d},"ArrowLeft"===i?"nw"===c?(j.x-=u,j.y-=u,j.width+=u,j.height+=u):"w"===c?(j.x-=u,j.width+=u):"sw"===c?(j.x-=u,j.width+=u,j.height+=u):"ne"===c?(j.y+=u,j.width-=u,j.height-=u):"e"===c?j.width-=u:"se"===c&&(j.width-=u,j.height-=u):"ArrowRight"===i&&("nw"===c?(j.x+=u,j.y+=u,j.width-=u,j.height-=u):"w"===c?(j.x+=u,j.width-=u):"sw"===c?(j.x+=u,j.width-=u,j.height-=u):"ne"===c?(j.y-=u,j.width+=u,j.height+=u):"e"===c?j.width+=u:"se"===c&&(j.width+=u,j.height+=u)),"ArrowUp"===i?"nw"===c?(j.x-=u,j.y-=u,j.width+=u,j.height+=u):"n"===c?(j.y-=u,j.height+=u):"ne"===c?(j.y-=u,j.width+=u,j.height+=u):"sw"===c?(j.x+=u,j.width-=u,j.height-=u):"s"===c?j.height-=u:"se"===c&&(j.width-=u,j.height-=u):"ArrowDown"===i&&("nw"===c?(j.x+=u,j.y+=u,j.width-=u,j.height-=u):"n"===c?(j.y+=u,j.height-=u):"ne"===c?(j.y+=u,j.width-=u,j.height-=u):"sw"===c?(j.x-=u,j.width+=u,j.height+=u):"s"===c?j.height+=u:"se"===c&&(j.width+=u,j.height+=u)),j),k,c,t.width,t.height,n,o,p,q);if(!e(l,v)){let a=f(v,t.width,t.height);r(v,a),s&&s(v,a)}};onDocPointerDone=a=>{let{crop:b,disabled:c,onComplete:d,onDragEnd:e}=this.props,h=this.getBox();this.unbindDocMove(),!(c||!b)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,e&&e(a),d&&d(g(b,h.width,h.height),f(b,h.width,h.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:a}=this.props;if(a)return{top:`${a.y}${a.unit}`,left:`${a.x}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`}}dragCrop(){let{evData:a}=this,b=this.getBox(),c=this.makePixelCrop(b),e=a.clientX-a.startClientX,f=a.clientY-a.startClientY;return c.x=d(a.startCropX+e,0,b.width-c.width),c.y=d(a.startCropY+f,0,b.height-c.height),c}getPointRegion(a,b,c,d){let{evData:e}=this,f=e.clientX-a.x,g=e.clientY-a.y,h;return h=d&&b?"nw"===b||"n"===b||"ne"===b:g<e.startCropY,(c&&b?"nw"===b||"w"===b||"sw"===b:f<e.startCropX)?h?"nw":"sw":h?"ne":"se"}resolveMinDimensions(a,b,c=0,d=0){let e=Math.min(c,a.width),f=Math.min(d,a.height);return b&&(e||f)?b>1?e?[e,e/b]:[f*b,f]:f?[f*b,f]:[e,e/b]:[e,f]}resizeCrop(){let{evData:b}=this,{aspect:c=0,maxWidth:e,maxHeight:f}=this.props,g=this.getBox(),[i,j]=this.resolveMinDimensions(g,c,this.props.minWidth,this.props.minHeight),k=this.makePixelCrop(g),l=this.getPointRegion(g,b.ord,i,j),m=b.ord||l,n=b.clientX-b.startClientX,o=b.clientY-b.startClientY;(i&&"nw"===m||"w"===m||"sw"===m)&&(n=Math.min(n,-i)),(j&&"nw"===m||"n"===m||"ne"===m)&&(o=Math.min(o,-j));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===l?(p.x=b.startCropX,p.width=n,c?p.height=p.width/c:p.height=Math.abs(o),p.y=b.startCropY-p.height):"se"===l?(p.x=b.startCropX,p.y=b.startCropY,p.width=n,c?p.height=p.width/c:p.height=o):"sw"===l?(p.x=b.startCropX+n,p.y=b.startCropY,p.width=Math.abs(n),c?p.height=p.width/c:p.height=o):"nw"===l&&(p.x=b.startCropX+n,p.width=Math.abs(n),c?(p.height=p.width/c,p.y=b.startCropY-p.height):(p.height=Math.abs(o),p.y=b.startCropY+o));let q=h(p,c,l,g.width,g.height,i,j,e,f);return c||a.xyOrds.indexOf(m)>-1?k=q:a.xOrds.indexOf(m)>-1?(k.x=q.x,k.width=q.width):a.yOrds.indexOf(m)>-1&&(k.y=q.y,k.height=q.height),k.x=d(k.x,0,g.width-k.width),k.y=d(k.y,0,g.height-k.height),k}renderCropSelection(){let{ariaLabels:c=a.defaultProps.ariaLabels,disabled:d,locked:e,renderSelectionAddon:f,ruleOfThirds:g,crop:h}=this.props,i=this.getCropStyle();if(h)return b.default.createElement("div",{style:i,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":c.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!d&&!e&&b.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},b.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":c.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":c.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":c.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":c.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":c.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":c.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":c.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":c.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),f&&b.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:a=>a.stopPropagation()},f(this.state)),g&&b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),b.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(a){return g({...c,...this.props.crop||{}},a.width,a.height)}render(){let{aspect:a,children:c,circularCrop:d,className:e,crop:f,disabled:g,locked:h,style:i,ruleOfThirds:j}=this.props,{cropIsActive:k,newCropIsBeingDrawn:l}=this.state,m=f?this.renderCropSelection():null,n=((...a)=>a.filter(a=>a&&"string"==typeof a).join(" "))("ReactCrop",e,k&&"ReactCrop--active",g&&"ReactCrop--disabled",h&&"ReactCrop--locked",l&&"ReactCrop--new-crop",f&&a&&"ReactCrop--fixed-aspect",f&&d&&"ReactCrop--circular-crop",f&&j&&"ReactCrop--rule-of-thirds",!this.dragStarted&&f&&!f.width&&!f.height&&"ReactCrop--invisible-crop",d&&"ReactCrop--no-animate");return b.default.createElement("div",{ref:this.componentRef,className:n,style:i},b.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},c),f?b.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},b.default.createElement("defs",null,b.default.createElement("mask",{id:`hole-${this.instanceId}`},b.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),d?b.default.createElement("ellipse",{cx:`${f.x+f.width/2}${f.unit}`,cy:`${f.y+f.height/2}${f.unit}`,rx:`${f.width/2}${f.unit}`,ry:`${f.height/2}${f.unit}`,fill:"black"}):b.default.createElement("rect",{x:`${f.x}${f.unit}`,y:`${f.y}${f.unit}`,width:`${f.width}${f.unit}`,height:`${f.height}${f.unit}`,fill:"black"}))),b.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,m)}};a.s(["f",0,k])},560554,a=>{let b={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class c extends Error{code;format;constructor(a,b,c){super(a,void 0===c?void 0:{cause:c}),this.code=a,this.format=b,this.name="ImageDecodeError"}}let d=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),e=new Set(["mif1","msf1","mif2"]),f=new Set(["avif","avis"]);function g(a,c,d=b){let e=Math.min(1,d.maxLongEdge/Math.max(a,c),Math.sqrt(d.maxPixels/Math.max(1,a*c)));return{width:Math.max(1,Math.floor(a*e)),height:Math.max(1,Math.floor(c*e)),scale:e}}async function h(a){let b,c;if("function"==typeof createImageBitmap)try{return await createImageBitmap(a,{imageOrientation:"from-image"})}catch{}let d=await (b=URL.createObjectURL(a),(c=new Image).decoding="async",new Promise((a,d)=>{c.onload=()=>a(c),c.onerror=()=>d(Error("IMAGE_ELEMENT_DECODE_FAILED")),c.src=b}).finally(()=>URL.revokeObjectURL(b)));if(!d.naturalWidth||!d.naturalHeight)throw Error("IMAGE_EMPTY");return d}async function i(b){let{heicTo:c}=await a.A(627280);return c({blob:b,type:"image/jpeg",quality:.95})}function j(a,b){return new Promise((c,d)=>{a.toBlob(a=>a?c(a):d(Error("CANVAS_EMPTY")),"image/jpeg",b)})}function k(a,b,c,d,e,f,g){let h,i=((h=document.createElement("canvas")).width=f,h.height=g,h),j=i.getContext("2d");if(!j)throw Error("CANVAS_UNSUPPORTED");return j.fillStyle="#ffffff",j.fillRect(0,0,f,g),j.imageSmoothingEnabled=!0,j.imageSmoothingQuality="high",j.drawImage(a,b,c,d,e,0,0,f,g),i}async function l(a,b){var l;let m,n=performance.now(),o=await a.arrayBuffer(),p=performance.now()-n,q=function(a){let b=(b,c)=>String.fromCharCode(...a.subarray(b,c));if(a.length>=3&&255===a[0]&&216===a[1]&&255===a[2])return"jpeg";if(a.length>=8&&137===a[0]&&"PNG"===b(1,4))return"png";if(a.length>=12&&"RIFF"===b(0,4)&&"WEBP"===b(8,12))return"webp";if(a.length>=6&&("GIF87a"===b(0,6)||"GIF89a"===b(0,6)))return"gif";if(a.length>=2&&"BM"===b(0,2))return"bmp";if(a.length>=12&&"ftyp"===b(4,8)){let c=Math.min(a.length,(a[0]<<24|a[1]<<16|a[2]<<8|a[3])>>>0||a.length),g=[b(8,12)];for(let a=16;a+4<=c;a+=4)g.push(b(a,a+4));if(g.some(a=>d.has(a)))return"heic";if(g.some(a=>f.has(a)))return"avif";if(g.some(a=>e.has(a)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),r=a.type||"",s=performance.now(),t="native",u=new Blob([o],{type:r||"application/octet-stream"});try{m=await h(u)}catch(a){if("heic"!==q)throw new c("unknown"===q?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",q,a);b?.();try{m=await h(await i(u)),t="heic"}catch(a){throw new c("HEIC_DECODE_FAILED",q,a)}}let{width:v,height:w}=(l=m)instanceof HTMLImageElement?{width:l.naturalWidth,height:l.naturalHeight}:{width:l.width,height:l.height};if(!v||!w)throw new c("IMAGE_DECODE_FAILED",q);let x=g(v,w,{maxLongEdge:1600,maxPixels:1/0}),y=await j(k(m,0,0,v,w,x.width,x.height),.85),z=URL.createObjectURL(y),A=performance.now()-s;return{source:m,width:v,height:w,format:q,decoder:t,previewUrl:z,sourceType:r,sourceBytes:a.size,timings:{read:Math.round(p),convert:Math.round(A)},dispose:()=>{URL.revokeObjectURL(z),m instanceof HTMLImageElement||m.close()}}}let m={x:0,y:0,width:1,height:1};async function n(a,c=m,d=b){var e;let f=performance.now(),h=a=>Math.min(1,Math.max(0,a)),i=Math.round(h(c.x)*a.width),l=Math.round(h(c.y)*a.height),o=Math.max(1,Math.min(a.width-i,Math.round(h(c.width)*a.width))),p=Math.max(1,Math.min(a.height-l,Math.round(h(c.height)*a.height))),q=g(o,p,d),r=k(a.source,i,l,o,p,q.width,q.height),s=performance.now()-f,t=performance.now(),u=d.startQuality,v=await j(r,u);for(let b=0;v.size>d.maxBytes&&b<12;b++)u-.05>=d.minQuality-1e-9?u=Math.round((u-.05)*100)/100:(q={width:Math.max(1,Math.floor(.85*q.width)),height:Math.max(1,Math.floor(.85*q.height)),scale:.85*q.scale},r=k(a.source,i,l,o,p,q.width,q.height)),v=await j(r,u);return{dataUrl:await (e=v,new Promise((a,b)=>{let c=new FileReader;c.onload=()=>a(c.result),c.onerror=()=>b(c.error??Error("READ_FAILED")),c.readAsDataURL(e)})),width:q.width,height:q.height,bytes:v.size,quality:u,timings:{crop:Math.round(s),compress:Math.round(performance.now()-t)}}}a.s(["K",0,b,"o",0,c,"N",0,function(a,b){return{sourceType:a.sourceType||a.format,sourceBytes:a.sourceBytes,sourceWidth:a.width,sourceHeight:a.height,outputWidth:b.width,outputHeight:b.height,outputBytes:b.bytes,decoder:a.decoder,quality:b.quality}},"p",0,l,"X",0,n])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0m1jjbrzk71io._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[308311,a=>{var b=a.i(164831);let c={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],308311)},622418,a=>{var b=a.i(187924),c=a.i(79362),d=a.i(308311),e=a.i(519783),f=a.i(786304),g=a.i(550194);let h={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:d.f},reviewing:{className:"bg-primary/10 text-primary",icon:e.f},mastered:{className:"bg-success/15 text-success",icon:c.f}};a.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:a,className:c=""}){let{t:d}=(0,g.b)(),{className:e,icon:i}=h[a],j="mastered"===a?d.notebook.mastered:"reviewing"===a?d.notebook.reviewing:d.notebook.review;return(0,b.jsx)(f.f,{variant:"secondary",className:`${e} ${c}`,children:(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(i,{className:"h-3 w-3"})," ",j]})})}])},579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},506376,a=>{var b=a.i(187924),c=a.i(875160);a.s(["f",0,function({label:a}){return(0,b.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,b.jsx)(c.f,{className:"h-7 w-7 animate-spin text-primary"}),a&&(0,b.jsx)("p",{className:"text-sm",children:a})]})}])},794974,a=>{var b=a.i(572131);let c=new Map,d=new Set;function e(a){return d.add(a),window.addEventListener("storage",a),()=>{d.delete(a),window.removeEventListener("storage",a)}}function f(a,f,g){let h=(0,b.useSyncExternalStore)(e,()=>(function(a){if(c.has(a))return c.get(a)??null;try{return window.localStorage.getItem(a)}catch{return null}})(a),()=>null);return[(0,b.useMemo)(()=>f(h),[f,h]),(0,b.useCallback)(b=>(function(a,b){try{window.localStorage.setItem(a,b),c.delete(a)}catch{c.set(a,b)}d.forEach(a=>a())})(a,g(b)),[a,g])]}let g=a=>a;a.s(["y",0,function(a,c,d){return f(a,(0,b.useCallback)(a=>c.includes(a??"")?a:d,[c,d]),g)},"x",0,f])},843326,a=>{a.s(["f",0,function(a){if(a.tags&&a.tags.length>0)return a.tags.map(a=>a.name);if(!a.knowledgePoints)return[];try{let b=JSON.parse(a.knowledgePoints);return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_14h_732sdmo6b._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[543569,a=>{var b=a.i(572131),c={x:0,y:0,width:0,height:0,unit:"px"},d=(a,b,c)=>Math.min(Math.max(a,b),c),e=(a,b)=>a===b||a.width===b.width&&a.height===b.height&&a.x===b.x&&a.y===b.y&&a.unit===b.unit;function f(a,b,d){return"%"===a.unit?{...c,...a,unit:"%"}:{unit:"%",x:a.x?a.x/b*100:0,y:a.y?a.y/d*100:0,width:a.width?a.width/b*100:0,height:a.height?a.height/d*100:0}}function g(a,b,d){return a.unit&&"px"!==a.unit?{unit:"px",x:a.x?a.x*b/100:0,y:a.y?a.y*d/100:0,width:a.width?a.width*b/100:0,height:a.height?a.height*d/100:0}:{...c,...a,unit:"px"}}function h(a,b,c,d,e,f=0,g=0,i=d,j=e){let k={...a},l=Math.min(f,d),m=Math.min(g,e),n=Math.min(i,d),o=Math.min(j,e);b&&(b>1?(m=(l=g?g*b:l)/b,n=i*b):(l=(m=f?f/b:m)*b,o=j/b)),k.y<0&&(k.height=Math.max(k.height+k.y,m),k.y=0),k.x<0&&(k.width=Math.max(k.width+k.x,l),k.x=0);let p=d-(k.x+k.width);p<0&&(k.x=Math.min(k.x,d-l),k.width+=p);let q=e-(k.y+k.height);if(q<0&&(k.y=Math.min(k.y,e-m),k.height+=q),k.width<l&&(("sw"===c||"nw"==c)&&(k.x-=l-k.width),k.width=l),k.height<m&&(("nw"===c||"ne"==c)&&(k.y-=m-k.height),k.height=m),k.width>n&&(("sw"===c||"nw"==c)&&(k.x-=n-k.width),k.width=n),k.height>o&&(("nw"===c||"ne"==c)&&(k.y-=o-k.height),k.height=o),b){let a=k.width/k.height;if(a<b){let a=Math.max(k.width/b,m);("nw"===c||"ne"==c)&&(k.y-=a-k.height),k.height=a}else if(a>b){let a=Math.max(k.height*b,l);("sw"===c||"nw"==c)&&(k.x-=a-k.width),k.width=a}}return k}var i={capture:!0,passive:!1},j=0,k=class a extends b.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,b.createRef)();mediaRef=(0,b.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${j++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let a=this.mediaRef.current;if(!a)return{x:0,y:0,width:0,height:0};let{x:b,y:c,width:d,height:e}=a.getBoundingClientRect();return{x:b,y:c,width:d,height:e}}componentDidUpdate(a){let{crop:b,onComplete:c}=this.props;if(c&&!a.crop&&b){let{width:a,height:d}=this.getBox();a&&d&&c(g(b,a,d),f(b,a,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,i),this.document.addEventListener("pointerup",this.onDocPointerDone,i),this.document.addEventListener("pointercancel",this.onDocPointerDone,i),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,i),this.document.removeEventListener("pointerup",this.onDocPointerDone,i),this.document.removeEventListener("pointercancel",this.onDocPointerDone,i),!1)}onCropPointerDown=a=>{let{crop:b,disabled:c}=this.props,d=this.getBox();if(!b)return;let e=g(b,d.width,d.height);if(c)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let f=a.target.dataset.ord,h=a.clientX,i=a.clientY,j=e.x,k=e.y;if(f){let b=a.clientX-d.x,c=a.clientY-d.y,g=0,l=0;"ne"===f||"e"==f?(g=b-(e.x+e.width),l=c-e.y,j=e.x,k=e.y+e.height):"se"===f||"s"===f?(g=b-(e.x+e.width),l=c-(e.y+e.height),j=e.x,k=e.y):"sw"===f||"w"==f?(g=b-e.x,l=c-(e.y+e.height),j=e.x+e.width,k=e.y):("nw"===f||"n"==f)&&(g=b-e.x,l=c-e.y,j=e.x+e.width,k=e.y+e.height),h=j+d.x+g,i=k+d.y+l}this.evData={startClientX:h,startClientY:i,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!!f,ord:f},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=a=>{let{crop:b,disabled:c,locked:d,keepSelection:e,onChange:h}=this.props,i=this.getBox();if(c||d||e&&b)return;a.cancelable&&a.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let j=a.clientX-i.x,k=a.clientY-i.y,l={unit:"px",x:j,y:k,width:0,height:0};this.evData={startClientX:a.clientX,startClientY:a.clientY,startCropX:j,startCropY:k,clientX:a.clientX,clientY:a.clientY,isResize:!0},this.mouseDownOnCrop=!0,h(g(l,i.width,i.height),f(l,i.width,i.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=a=>{let b,{crop:c,disabled:d,onChange:h,onDragStart:i}=this.props,j=this.getBox();if(d||!c||!this.mouseDownOnCrop)return;a.cancelable&&a.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(a));let{evData:k}=this;k.clientX=a.clientX,k.clientY=a.clientY,e(c,b=k.isResize?this.resizeCrop():this.dragCrop())||h(g(b,j.width,j.height),f(b,j.width,j.height))};onComponentKeyDown=b=>{let{crop:c,disabled:e,onChange:h,onComplete:i}=this.props;if(e)return;let j=b.key,k=!1;if(!c)return;let l=this.getBox(),m=this.makePixelCrop(l),n=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep;if("ArrowLeft"===j?(m.x-=n,k=!0):"ArrowRight"===j?(m.x+=n,k=!0):"ArrowUp"===j?(m.y-=n,k=!0):"ArrowDown"===j&&(m.y+=n,k=!0),k){b.cancelable&&b.preventDefault(),m.x=d(m.x,0,l.width-m.width),m.y=d(m.y,0,l.height-m.height);let a=g(m,l.width,l.height),c=f(m,l.width,l.height);h(a,c),i&&i(a,c)}};onHandlerKeyDown=(b,c)=>{var d,i;let j,{aspect:k=0,crop:l,disabled:m,minWidth:n=0,minHeight:o=0,maxWidth:p,maxHeight:q,onChange:r,onComplete:s}=this.props,t=this.getBox();if(m||!l||"ArrowUp"!==b.key&&"ArrowDown"!==b.key&&"ArrowLeft"!==b.key&&"ArrowRight"!==b.key)return;b.stopPropagation(),b.preventDefault();let u=(navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)?a.nudgeStepLarge:b.shiftKey?a.nudgeStepMedium:a.nudgeStep,v=h((d=g(l,t.width,t.height),i=b.key,j={...d},"ArrowLeft"===i?"nw"===c?(j.x-=u,j.y-=u,j.width+=u,j.height+=u):"w"===c?(j.x-=u,j.width+=u):"sw"===c?(j.x-=u,j.width+=u,j.height+=u):"ne"===c?(j.y+=u,j.width-=u,j.height-=u):"e"===c?j.width-=u:"se"===c&&(j.width-=u,j.height-=u):"ArrowRight"===i&&("nw"===c?(j.x+=u,j.y+=u,j.width-=u,j.height-=u):"w"===c?(j.x+=u,j.width-=u):"sw"===c?(j.x+=u,j.width-=u,j.height-=u):"ne"===c?(j.y-=u,j.width+=u,j.height+=u):"e"===c?j.width+=u:"se"===c&&(j.width+=u,j.height+=u)),"ArrowUp"===i?"nw"===c?(j.x-=u,j.y-=u,j.width+=u,j.height+=u):"n"===c?(j.y-=u,j.height+=u):"ne"===c?(j.y-=u,j.width+=u,j.height+=u):"sw"===c?(j.x+=u,j.width-=u,j.height-=u):"s"===c?j.height-=u:"se"===c&&(j.width-=u,j.height-=u):"ArrowDown"===i&&("nw"===c?(j.x+=u,j.y+=u,j.width-=u,j.height-=u):"n"===c?(j.y+=u,j.height-=u):"ne"===c?(j.y+=u,j.width-=u,j.height-=u):"sw"===c?(j.x-=u,j.width+=u,j.height+=u):"s"===c?j.height+=u:"se"===c&&(j.width+=u,j.height+=u)),j),k,c,t.width,t.height,n,o,p,q);if(!e(l,v)){let a=f(v,t.width,t.height);r(v,a),s&&s(v,a)}};onDocPointerDone=a=>{let{crop:b,disabled:c,onComplete:d,onDragEnd:e}=this.props,h=this.getBox();this.unbindDocMove(),!(c||!b)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,e&&e(a),d&&d(g(b,h.width,h.height),f(b,h.width,h.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:a}=this.props;if(a)return{top:`${a.y}${a.unit}`,left:`${a.x}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`}}dragCrop(){let{evData:a}=this,b=this.getBox(),c=this.makePixelCrop(b),e=a.clientX-a.startClientX,f=a.clientY-a.startClientY;return c.x=d(a.startCropX+e,0,b.width-c.width),c.y=d(a.startCropY+f,0,b.height-c.height),c}getPointRegion(a,b,c,d){let{evData:e}=this,f=e.clientX-a.x,g=e.clientY-a.y,h;return h=d&&b?"nw"===b||"n"===b||"ne"===b:g<e.startCropY,(c&&b?"nw"===b||"w"===b||"sw"===b:f<e.startCropX)?h?"nw":"sw":h?"ne":"se"}resolveMinDimensions(a,b,c=0,d=0){let e=Math.min(c,a.width),f=Math.min(d,a.height);return b&&(e||f)?b>1?e?[e,e/b]:[f*b,f]:f?[f*b,f]:[e,e/b]:[e,f]}resizeCrop(){let{evData:b}=this,{aspect:c=0,maxWidth:e,maxHeight:f}=this.props,g=this.getBox(),[i,j]=this.resolveMinDimensions(g,c,this.props.minWidth,this.props.minHeight),k=this.makePixelCrop(g),l=this.getPointRegion(g,b.ord,i,j),m=b.ord||l,n=b.clientX-b.startClientX,o=b.clientY-b.startClientY;(i&&"nw"===m||"w"===m||"sw"===m)&&(n=Math.min(n,-i)),(j&&"nw"===m||"n"===m||"ne"===m)&&(o=Math.min(o,-j));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===l?(p.x=b.startCropX,p.width=n,c?p.height=p.width/c:p.height=Math.abs(o),p.y=b.startCropY-p.height):"se"===l?(p.x=b.startCropX,p.y=b.startCropY,p.width=n,c?p.height=p.width/c:p.height=o):"sw"===l?(p.x=b.startCropX+n,p.y=b.startCropY,p.width=Math.abs(n),c?p.height=p.width/c:p.height=o):"nw"===l&&(p.x=b.startCropX+n,p.width=Math.abs(n),c?(p.height=p.width/c,p.y=b.startCropY-p.height):(p.height=Math.abs(o),p.y=b.startCropY+o));let q=h(p,c,l,g.width,g.height,i,j,e,f);return c||a.xyOrds.indexOf(m)>-1?k=q:a.xOrds.indexOf(m)>-1?(k.x=q.x,k.width=q.width):a.yOrds.indexOf(m)>-1&&(k.y=q.y,k.height=q.height),k.x=d(k.x,0,g.width-k.width),k.y=d(k.y,0,g.height-k.height),k}renderCropSelection(){let{ariaLabels:c=a.defaultProps.ariaLabels,disabled:d,locked:e,renderSelectionAddon:f,ruleOfThirds:g,crop:h}=this.props,i=this.getCropStyle();if(h)return b.default.createElement("div",{style:i,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":c.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!d&&!e&&b.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},b.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),b.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":c.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":c.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":c.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":c.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":c.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":c.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":c.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),b.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":c.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),f&&b.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:a=>a.stopPropagation()},f(this.state)),g&&b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),b.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(a){return g({...c,...this.props.crop||{}},a.width,a.height)}render(){let{aspect:a,children:c,circularCrop:d,className:e,crop:f,disabled:g,locked:h,style:i,ruleOfThirds:j}=this.props,{cropIsActive:k,newCropIsBeingDrawn:l}=this.state,m=f?this.renderCropSelection():null,n=((...a)=>a.filter(a=>a&&"string"==typeof a).join(" "))("ReactCrop",e,k&&"ReactCrop--active",g&&"ReactCrop--disabled",h&&"ReactCrop--locked",l&&"ReactCrop--new-crop",f&&a&&"ReactCrop--fixed-aspect",f&&d&&"ReactCrop--circular-crop",f&&j&&"ReactCrop--rule-of-thirds",!this.dragStarted&&f&&!f.width&&!f.height&&"ReactCrop--invisible-crop",d&&"ReactCrop--no-animate");return b.default.createElement("div",{ref:this.componentRef,className:n,style:i},b.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},c),f?b.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},b.default.createElement("defs",null,b.default.createElement("mask",{id:`hole-${this.instanceId}`},b.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),d?b.default.createElement("ellipse",{cx:`${f.x+f.width/2}${f.unit}`,cy:`${f.y+f.height/2}${f.unit}`,rx:`${f.width/2}${f.unit}`,ry:`${f.height/2}${f.unit}`,fill:"black"}):b.default.createElement("rect",{x:`${f.x}${f.unit}`,y:`${f.y}${f.unit}`,width:`${f.width}${f.unit}`,height:`${f.height}${f.unit}`,fill:"black"}))),b.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,m)}};a.s(["f",0,k])},560554,a=>{let b={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class c extends Error{code;format;constructor(a,b,c){super(a,void 0===c?void 0:{cause:c}),this.code=a,this.format=b,this.name="ImageDecodeError"}}let d=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),e=new Set(["mif1","msf1","mif2"]),f=new Set(["avif","avis"]);function g(a,c,d=b){let e=Math.min(1,d.maxLongEdge/Math.max(a,c),Math.sqrt(d.maxPixels/Math.max(1,a*c)));return{width:Math.max(1,Math.floor(a*e)),height:Math.max(1,Math.floor(c*e)),scale:e}}async function h(a){let b,c;if("function"==typeof createImageBitmap)try{return await createImageBitmap(a,{imageOrientation:"from-image"})}catch{}let d=await (b=URL.createObjectURL(a),(c=new Image).decoding="async",new Promise((a,d)=>{c.onload=()=>a(c),c.onerror=()=>d(Error("IMAGE_ELEMENT_DECODE_FAILED")),c.src=b}).finally(()=>URL.revokeObjectURL(b)));if(!d.naturalWidth||!d.naturalHeight)throw Error("IMAGE_EMPTY");return d}async function i(b){let{heicTo:c}=await a.A(627280);return c({blob:b,type:"image/jpeg",quality:.95})}function j(a,b){return new Promise((c,d)=>{a.toBlob(a=>a?c(a):d(Error("CANVAS_EMPTY")),"image/jpeg",b)})}function k(a,b,c,d,e,f,g){let h,i=((h=document.createElement("canvas")).width=f,h.height=g,h),j=i.getContext("2d");if(!j)throw Error("CANVAS_UNSUPPORTED");return j.fillStyle="#ffffff",j.fillRect(0,0,f,g),j.imageSmoothingEnabled=!0,j.imageSmoothingQuality="high",j.drawImage(a,b,c,d,e,0,0,f,g),i}async function l(a,b){var l;let m,n=performance.now(),o=await a.arrayBuffer(),p=performance.now()-n,q=function(a){let b=(b,c)=>String.fromCharCode(...a.subarray(b,c));if(a.length>=3&&255===a[0]&&216===a[1]&&255===a[2])return"jpeg";if(a.length>=8&&137===a[0]&&"PNG"===b(1,4))return"png";if(a.length>=12&&"RIFF"===b(0,4)&&"WEBP"===b(8,12))return"webp";if(a.length>=6&&("GIF87a"===b(0,6)||"GIF89a"===b(0,6)))return"gif";if(a.length>=2&&"BM"===b(0,2))return"bmp";if(a.length>=12&&"ftyp"===b(4,8)){let c=Math.min(a.length,(a[0]<<24|a[1]<<16|a[2]<<8|a[3])>>>0||a.length),g=[b(8,12)];for(let a=16;a+4<=c;a+=4)g.push(b(a,a+4));if(g.some(a=>d.has(a)))return"heic";if(g.some(a=>f.has(a)))return"avif";if(g.some(a=>e.has(a)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),r=a.type||"",s=performance.now(),t="native",u=new Blob([o],{type:r||"application/octet-stream"});try{m=await h(u)}catch(a){if("heic"!==q)throw new c("unknown"===q?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",q,a);b?.();try{m=await h(await i(u)),t="heic"}catch(a){throw new c("HEIC_DECODE_FAILED",q,a)}}let{width:v,height:w}=(l=m)instanceof HTMLImageElement?{width:l.naturalWidth,height:l.naturalHeight}:{width:l.width,height:l.height};if(!v||!w)throw new c("IMAGE_DECODE_FAILED",q);let x=g(v,w,{maxLongEdge:1600,maxPixels:1/0}),y=await j(k(m,0,0,v,w,x.width,x.height),.85),z=URL.createObjectURL(y),A=performance.now()-s;return{source:m,width:v,height:w,format:q,decoder:t,previewUrl:z,sourceType:r,sourceBytes:a.size,timings:{read:Math.round(p),convert:Math.round(A)},dispose:()=>{URL.revokeObjectURL(z),m instanceof HTMLImageElement||m.close()}}}let m={x:0,y:0,width:1,height:1};async function n(a,c=m,d=b){var e;let f=performance.now(),h=a=>Math.min(1,Math.max(0,a)),i=Math.round(h(c.x)*a.width),l=Math.round(h(c.y)*a.height),o=Math.max(1,Math.min(a.width-i,Math.round(h(c.width)*a.width))),p=Math.max(1,Math.min(a.height-l,Math.round(h(c.height)*a.height))),q=g(o,p,d),r=k(a.source,i,l,o,p,q.width,q.height),s=performance.now()-f,t=performance.now(),u=d.startQuality,v=await j(r,u);for(let b=0;v.size>d.maxBytes&&b<12;b++)u-.05>=d.minQuality-1e-9?u=Math.round((u-.05)*100)/100:(q={width:Math.max(1,Math.floor(.85*q.width)),height:Math.max(1,Math.floor(.85*q.height)),scale:.85*q.scale},r=k(a.source,i,l,o,p,q.width,q.height)),v=await j(r,u);return{dataUrl:await (e=v,new Promise((a,b)=>{let c=new FileReader;c.onload=()=>a(c.result),c.onerror=()=>b(c.error??Error("READ_FAILED")),c.readAsDataURL(e)})),width:q.width,height:q.height,bytes:v.size,quality:u,timings:{crop:Math.round(s),compress:Math.round(performance.now()-t)}}}a.s(["K",0,b,"o",0,c,"N",0,function(a,b){return{sourceType:a.sourceType||a.format,sourceBytes:a.sourceBytes,sourceWidth:a.width,sourceHeight:a.height,outputWidth:b.width,outputHeight:b.height,outputBytes:b.bytes,decoder:a.decoder,quality:b.quality}},"p",0,l,"X",0,n])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_1hp3fw-gk2r-3._.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[218964,e=>{var l=e.i(456420);let i={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};i.node;let t=(0,l.f)(i);e.s(["f",0,t],218964)},697886,e=>{var l=e.i(456420);let i={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};i.node;let t=(0,l.f)(i);e.s(["f",0,t],697886)},86963,e=>{var l=e.i(843476),i=e.i(632781);e.s(["f",0,function({label:e}){return(0,l.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,l.jsx)(i.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,l.jsx)("p",{className:"text-sm",children:e})]})}])},185592,e=>{var l=e.i(843476),i=e.i(975157);e.s(["f",0,function({options:e,value:t,onChange:n,className:c}){return(0,l.jsx)("div",{className:(0,i.f)("grid gap-1 rounded-xl bg-muted p-1",c),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:c,icon:o})=>{let a=e===t;return(0,l.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:(0,i.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",a?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>n(e),children:[o&&(0,l.jsx)(o,{className:"h-4 w-4 shrink-0"}),(0,l.jsx)("span",{className:"truncate",children:c})]},e)})})}])},407198,e=>{let l=["题干","选项A","选项B","选项C","选项D","答案","解析","知识点","难度","题型","学科","年级学期","来源","大题","题号"],i=[["下列哪个选项是正确的?","选项一","选项二","选项三","选项四","A","这是解析内容。","知识点一、知识点二","3","单选题","数学","七年级上学期","2025 期中","第一大题","1"],["1+1=____。","","","","","2","基础加法运算。","基础运算","易","填空题","数学","一年级上学期","课堂练习","第一大题","2"]];async function t(){let{default:t}=await e.A(810068),n=[l,...i];return await t(n).toBlob()}e.s(["I",0,l,"j",0,function(){let e=e=>/[",\n\r]/.test(e)?`"${e.replace(/"/g,'""')}"`:e,t=[];for(let n of(t.push(l.map(e).join(",")),i))t.push(n.map(e).join(","));return`\uFEFF${t.join("\r\n")}\r
|
|
2
|
-
`},"n",0,t])},35209,e=>{var l=e.i(271645),i=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,i.b)(),n=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,l.useEffect)(()=>{document.title=n},[n])}])},401280,e=>{let l={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?l[i]??null:null}])}],462684,e=>{e.v(l=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(l=>e.l(l))).then(()=>l(506175)))},825834,e=>{e.v(l=>Promise.all(["static/chunks/3nq-bgq8lumv9.js","static/chunks/079f88y9j6sf-.js"].map(l=>e.l(l))).then(()=>l(918657)))},979463,e=>{e.q("/_next/static/media/pdf.worker.min.0zcq5mj7t-qsr.mjs")},84955,e=>{e.v(l=>Promise.all(["static/chunks/20f7m1txoey_w.js"].map(l=>e.l(l))).then(()=>l(742163)))},810068,e=>{e.v(l=>Promise.all(["static/chunks/0xbohpfp7x9jn.js"].map(l=>e.l(l))).then(()=>l(97292)))}]);
|