uni-answer-sheet 1.0.6 → 2.0.0

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.
@@ -0,0 +1,200 @@
1
+ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=>st in nt?kM(nt,st,{enumerable:!0,configurable:!0,writable:!0,value:It}):nt[st]=It;var Qh=(nt,st,It)=>HM(nt,typeof st!="symbol"?st+"":st,It),TS=(nt,st,It)=>st.has(nt)||ES("Cannot "+It);var Ht=(nt,st,It)=>(TS(nt,st,"read from private field"),It?It.call(nt):st.get(nt)),jS=(nt,st,It)=>st.has(nt)?ES("Cannot add the same private member more than once"):st instanceof WeakSet?st.add(nt):st.set(nt,It),Zh=(nt,st,It,jl)=>(TS(nt,st,"write to private field"),jl?jl.call(nt,It):st.set(nt,It),It);var UniAnswerSheet=(function(nt){"use strict";var pt,on;function st(n,r){for(var l=0;l<r.length;l++){const a=r[l];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in n)){const s=Object.getOwnPropertyDescriptor(a,c);s&&Object.defineProperty(n,c,s.get?s:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const It=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function jl(n){const r=n.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const l=r[0];if(l.apiVersion!==1||l.documentVersion!==1||It.some(a=>!l.capabilities?.includes(a))||typeof l.prepare!="function"||typeof l.create!="function"||typeof l.validateDocument!="function"||typeof l.html?.parse!="function"||typeof l.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return l}function Ol(n){const r=[],l=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,s)=>({id:c.attrs?.id,label:String.fromCharCode(65+s)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(l)};return l(n.content),r}class Uc extends Error{constructor(r,l){super(l),this.path=r}}const Hn=(n,r)=>{throw new Uc(n,r)},Rl={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},OS={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},RS=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((n,r)=>{const l=r<6?"P":r<9?"J":"S";return{label:n,value:`${l}0${r<6?r+1:(r-6)%3+1}`,classify:l}}),Xo=(n,r)=>typeof n=="string"&&n.trim()?n.trim():Hn(r,"字典编码和名称必须是非空字符串"),Nl=(n,r)=>n&&typeof n=="object"&&!Array.isArray(n)?n:Hn(r,"字典必须是对象"),Wh=n=>n.classify||(/^[PJS]/.test(n.value)?n.value[0]:void 0);function Pc(n={}){const r=Nl(n,"dictionaries"),l=(y,S)=>{if(!Array.isArray(y))return Hn(S,"字典选项必须是数组");const E=new Set;return y.map((R,N)=>{const T=Nl(R,`${S}.${N}`),O=Xo(T.value,`${S}.${N}.value`),D=Xo(T.label,`${S}.${N}.label`);return E.has(O)&&Hn(`${S}.${N}.value`,"字典编码重复"),E.add(O),{...T,value:O,label:D}})},a=l(r.grades===void 0?RS:r.grades,"dictionaries.grades").map((y,S)=>(y.classify!==void 0&&!["P","J","S"].includes(String(y.classify))&&Hn(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:y.value,label:y.label,classify:y.classify})),c=r.gradeCourseMap===void 0?void 0:Nl(r.gradeCourseMap,"dictionaries.gradeCourseMap"),s=r.courseCodeToSubjectCode===void 0?{}:Nl(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[y,S]of Object.entries(s))Xo(S,`dictionaries.courseCodeToSubjectCode.${y}`);const u=new Map,h=Object.fromEntries(a.map(y=>{const S=Wh(y),E=(S?OS[S]:[]).map(T=>({value:Rl[T],label:T,subjectCode:Rl[T]})),R=`dictionaries.gradeCourseMap.${y.value}`,N=l(c?c[y.value]??[]:E,R).map((T,O)=>{const D=s[T.value];T.subjectCode!==void 0&&D!==void 0&&T.subjectCode!==D&&Hn(`${R}.${O}.subjectCode`,"课程对应的学科编码冲突");const M=Xo(T.subjectCode??D??(Object.values(Rl).includes(T.value)?T.value:void 0),`${R}.${O}.subjectCode`);return u.has(T.value)&&u.get(T.value)!==M&&Hn(`${R}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(T.value,M),T.custom!==void 0&&typeof T.custom!="boolean"&&Hn(`${R}.${O}.custom`,"custom 必须是布尔值"),{value:T.value,label:T.label,subjectCode:M,...T.custom===void 0?{}:{custom:T.custom}}});return[y.value,N]})),g=a.filter(y=>h[y.value].length),m=r.defaultGradeCode===void 0?void 0:Xo(r.defaultGradeCode,"dictionaries.defaultGradeCode"),b=g.find(y=>y.value===m)?.value||g[0]?.value||"",v=r.defaultCourseCode===void 0?void 0:Xo(r.defaultCourseCode,"dictionaries.defaultCourseCode"),w=h[b]||[],C=w.find(y=>y.value===v)?.value||w[0]?.value||"";return{grades:g,gradeCourseMap:h,defaultGradeCode:b,defaultCourseCode:C}}function ni(n,r,l){const a=n.grades.find(s=>s.value===r);if(!a)return Hn("initialization.gradeCode","年级不在可用字典中");const c=n.gradeCourseMap[r]?.find(s=>s.value===l);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:l,subjectCode:c.subjectCode,phaseCode:Wh(a)}:Hn("initialization.courseCode","当前年级没有此课程")}function Jh(n,r={}){const a=n.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||n.defaultGradeCode,c=n.gradeCourseMap[a]||[],s=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===n.defaultGradeCode?n.defaultCourseCode:c[0]?.value)||"";return a&&s?ni(n,a,s):{grade:"",subject:"",gradeCode:"",courseCode:""}}function em(n){return n?.subjectCode||Rl[n?.subject||""]}const mn={questions:200,options:12,score:15},NS=n=>n.multiple?n.indefinite?"indefinite":"multiple":"single",Bn=n=>Number.isFinite(n)&&Number.isInteger(n*2),ri=n=>!!(em(n)==="MATHS"&&(n?.phaseCode?n.phaseCode==="S":n?.gradeCode?n.gradeCode.startsWith("S"):/^高[一二三]/.test(n?.grade||"")));function AS(n){const r=typeof n.score=="number"&&Bn(n.score)&&n.score>=.5&&n.score<=mn.score?n.score:null,l=[...new Set(n.correctIds)].filter(a=>n.options.some(c=>c.id===a));return{...n,indefinite:!!(n.multiple&&n.indefinite),score:r,scoreType:n.multiple&&n.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:n.multiple&&r!==null&&Bn(n.lessScore??0)?Math.max(0,Math.min(r,n.lessScore??0)):0,correctIds:n.multiple?l:l.slice(0,1)}}function $c(n,r,l){let a={...n};if(r.kind!==void 0){const c=r.kind!=="single";c&&!n.multiple&&(a.scoreType=ri(l)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&ri(l)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(mn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(s,u)=>n.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),AS(a)}function Gc(n){return typeof n.score=="number"&&(!Bn(n.score)||n.score<.5||n.score>mn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":n.multiple&&n.scoreType==="LESS_SCORE"&&typeof n.score=="number"&&(!Bn(n.lessScore??0)||(n.lessScore??0)<0||(n.lessScore??0)>n.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":n.multiple&&n.scoreType==="ITEM_SCORE"&&typeof n.score=="number"&&n.correctIds.length&&!Bn(n.score/n.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function MS(n){return n.multiple&&n.scoreType==="ITEM_SCORE"&&typeof n.score=="number"&&n.correctIds.length&&!Gc(n)?n.score/n.correctIds.length:null}function Vc(n){const r=n.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let l=String(Math.max(0,...r)+1);const a=new Set(n.map(c=>c.label));for(;a.has(l);)l=String(Number(l)+1);return l}function _S(n,r){const l=new Map(n.options.map(a=>[a.id,crypto.randomUUID()]));return{...n,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:n.options.map(a=>({...a,id:l.get(a.id)})),correctIds:n.correctIds.map(a=>l.get(a)).filter(Boolean)}}function tm(n,r,l){return l.trim()?n.some(a=>a.id!==r&&a.label.trim()===l.trim())?"题组内题号不能重复":null:"题号不能为空"}function DS(n,r,l,a){const c=n.questions.filter(g=>r.includes(g.id));if(!c.length)return{error:"请选择要修改的题目"};let s;if(l.type==="settings"){if(!Object.keys(l.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:g,score:m,lessScore:b}=l.patch;if(g!==void 0&&(!Number.isInteger(g)||g<2||g>mn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof m=="number"&&(!Bn(m)||m<.5||m>mn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(b!==void 0&&(!Bn(b)||b<0))return{error:"少选得分须为非负的 0.5 倍数"};if(s=c.map(v=>$c(v,l.patch,a)),b!==void 0&&s.some(v=>v.multiple&&v.scoreType!=="ITEM_SCORE"&&b>(v.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(l.type==="numbering"){if(!Number.isInteger(l.start)||l.start<1||l.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};s=c.map((g,m)=>({...g,label:String(l.start+m)}))}else if(l.type==="average"){const g=l.total/c.length;if(!Bn(g)||g<.5||g>mn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};s=c.map(m=>$c(m,{score:g}))}else{const g=l.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(g.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${g.length} 组`};s=[];for(let m=0;m<c.length;m++){const b=c[m],v=g[m];if(v!=="-"&&(!/^[A-T]+$/.test(v)||new Set(v).size!==v.length||[...v].some(C=>!b.options.some(y=>y.label===C))))return{error:`第 ${b.label} 题包含无效或重复选项`};const w=v==="-"?[]:[...v].map(C=>b.options.find(y=>y.label===C).id);if(!b.multiple&&w.length>1)return{error:`第 ${b.label} 题为单选,只能设置一个答案`};s.push({...b,correctIds:w})}}const u=new Map(s.map(g=>[g.id,g])),h=n.questions.map(g=>u.get(g.id)||g);for(const g of s){const m=tm(h,g.id,g.label)||Gc(g);if(m)return{error:`第 ${g.label} 题:${m}`}}return{value:{...n,questions:h}}}const IS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},qc=n=>`question:${n}`,Yc=n=>n.presentation==="stem"?"stem":["option","distributed"].includes(n.presentation)?"option":"concentrated";function Xc(n,r,l){const a=Ol(r),c=new Map,s=(h,g)=>{const m=h.attrs?.contentId||g;h.type==="choiceGroup"&&m&&c.set(h.attrs.id,m),h.content?.forEach(b=>s(b,m))};s(r.content);const u=new Set(n.questions.map(h=>h.contentTarget?.groupId));return{...n,presentation:l,questions:n.questions.map((h,g)=>{const m=a.find(b=>c.get(b.id)===h.id)||(c.size?void 0:a[g]);return l==="concentrated"||h.contentTarget!==void 0||!m||u.has(m.id)?h:(u.add(m.id),{...h,contentTarget:{groupId:m.id,optionIds:m.options.map(b=>b.id)}})})}}function Ko(n,r,l){const a=Yc(n),c=new Map(Ol(r).map(w=>[w.id,w])),s=new Set,u=new Map,h=new Map,g=(w,C)=>{const y=w.attrs?.contentId||C;w.type==="choiceGroup"&&y&&(u.set(y,[...u.get(y)||[],w.attrs.id]),h.set(w.attrs.id,y)),w.type==="choiceStemAnchor"&&typeof w.attrs?.groupId=="string"&&s.add(w.attrs.groupId),w.content?.forEach(S=>g(S,y))};g(r.content);const m=[],b=new Set,v=n.questions.filter(w=>{if(!l||a==="concentrated")return!0;if(a==="stem"&&s.has(qc(w.id)))return m.push({groupId:qc(w.id),questionId:w.id,options:w.options.map(N=>({...N,contentOptionId:N.id}))}),!1;const C=u.get(w.id),y=C?.length===1?c.get(C[0]):void 0,S=y?{groupId:y.id,optionIds:y.options.map(N=>N.id)}:w.contentTarget,E=S&&c.get(S.groupId);if(!S||!E||b.has(E.id)||a==="stem"&&!s.has(E.id)||h.has(E.id)&&h.get(E.id)!==w.id)return!0;const R=S.optionIds.slice(0,w.options.length);return R.length!==w.options.length||new Set(R).size!==R.length||R.some(N=>!E.options.some(T=>T.id===N))?!0:(b.add(E.id),m.push({groupId:E.id,questionId:w.id,options:w.options.map((N,T)=>({...N,contentOptionId:R[T]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:m,concentrated:{...n,questions:v}}}function Fo(n,r=4){return{id:crypto.randomUUID(),label:String(n+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(l,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function Kc(n=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:n},(r,l)=>Fo(l))}}function Fc(n){return new Set(n.questions.map(r=>r.options.length)).size>1?"column":n.direction}function zS(n){const r=[];for(const l of n.questions){const a=r.at(-1);(!a||a.length>=n.rowsPerColumn||l.breakBefore||a[0].options.length!==l.options.length)&&r.push([]),r[r.length-1].push(l)}return r}function LS(n){const r=[];for(const l of zS(n))(!r.length||l[0].breakBefore)&&r.push([]),r[r.length-1].push(l);return r}const kS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},HS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},nm=["reading","cloze","completion","composite","optional"],Bt=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),rm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Al=n=>["writing","english"].includes(n)?70:["answer","calculation","drawing","table","correction"].includes(n)?60:15,om=n=>n==="judge"?200:n==="fill"?50:["reading","cloze","completion"].includes(n)?20:n==="matching"?9:100;function am(n=0){return{id:crypto.randomUUID(),label:String(n+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function Qc(n,r="1"){const l=crypto.randomUUID();return{id:l,label:r,kind:n,document:Bt(),reference:Bt(),explanation:Bt(),score:null,choice:{...Fo(0,n==="judge"?2:4),id:l,label:r},presentation:"concentrated",blanks:[am()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:n==="writing"?"characters":n==="english"?"lines":n==="drawing"?"grid":"blank",rows:n==="writing"?20:6,columns:20,rowHeight:n==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function Zc(n){return["reading","cloze","chunk"].includes(n)?"choice":["matching","completion"].includes(n)?"fill":["ordering","composite","optional","practice"].includes(n)?"answer":n}function BS(n){return{items:[Qc(Zc(n))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Mr(n){return String(Math.max(0,...n.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function fo(n){const r=structuredClone(n),l=new Map,a=s=>{!s||typeof s!="object"||Object.entries(s).forEach(([u,h])=>{["id","answerId"].includes(u)&&typeof h=="string"?l.set(h,crypto.randomUUID()):a(h)})};a(r);const c=s=>typeof s=="string"?l.get(s)||s:Array.isArray(s)?s.map(c):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([u,h])=>[l.get(u)||u,c(h)])):s;return c(r)}function US(n,r){const l=fo(n);return{...l,label:r,choice:{...l.choice,label:r}}}function Qo(n,r,l){const a=n.findIndex(u=>u.id===r),c=a+l;if(a<0||c<0||c>=n.length)return n;const s=[...n];return s.splice(c,0,...s.splice(a,1)),s}function PS(n,r){return{...n,pool:n.pool.filter(l=>l.id!==r),sequence:n.sequence.filter(l=>l!==r),assignments:Object.fromEntries(Object.entries(n.assignments).filter(([l])=>l!==r)),items:n.items.map(l=>({...l,targets:l.targets.filter(a=>a!==r)}))}}function $S(n,r,l){const a=[...new Set(l)].filter(s=>n.pool.some(u=>u.id===s)),c=n.relation==="one"?a.slice(-1):a;return{...n,items:n.items.map(s=>s.id===r?{...s,targets:c}:n.reuseOptions?s:{...s,targets:s.targets.filter(u=>!c.includes(u))})}}function GS(n,r){let l=0;for(;l<r.length&&l<n.chunkText.length&&r[l]===n.chunkText[l];)l++;let a=0;for(;a<r.length-l&&a<n.chunkText.length-l&&r[r.length-1-a]===n.chunkText[n.chunkText.length-1-a];)a++;const c=n.chunkText.length-a,s=new Set,u=n.chunkPoints.filter(h=>h.offset<=l||h.offset>=c).map(h=>({...h,offset:h.offset<=l?h.offset:h.offset+r.length-n.chunkText.length})).filter(h=>h.offset<=0||h.offset>=r.length||s.has(h.offset)?!1:(s.add(h.offset),!0));return{...n,chunkText:r,chunkPoints:u,chunkCorrect:n.chunkCorrect.filter(h=>u.some(g=>g.id===h))}}function VS(n,r){const l=[],a=n.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&l.push("题号不能为空或重复");for(const c of n.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Al(c.kind)||!Number.isInteger(c.score*2))&&l.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(h=>h.score);u.length&&c.score!==null&&u.every(h=>h!==null)&&u.reduce((h,g)=>h+(g||0),0)!==c.score&&l.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=n.pool.map(s=>s.label.trim());(c.some(s=>!s)||new Set(c).size!==c.length)&&l.push("共享选项编号不能为空或重复")}return r==="optional"&&n.chooseCount>n.items.length&&l.push("选做数量不能超过题目数量"),r==="chunk"&&n.chunkCorrect.length>n.chunkMax&&l.push("正确断点数不能超过最多选择数"),l}function qS(n=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:n},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function pn(n){const r=l=>!!(l.text||l.type&&!["doc","paragraph","choiceStemAnchor"].includes(l.type)||l.content?.some(r));return!r(n.content)}const im={choice:"选择题",...kS};function lm(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function YS(n=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...n?{content:[{type:"text",text:n,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function Wc(n){return{...lm(),title:n.name,creation:n,paperTitle:YS(n.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function ho(n,r=96){return n*r/25.4}const oi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},mo=44,ai=16;function Jc(n,r){const l=oi[n.preset],a=ho(l.width),c=ho(l.height),s=ho(n.margin),u=ho(n.gap),h=n.header?.mifeng?ho(n.header.kaohao==="code"?26:14):0,g=a-s*2-h,m=(g-u*(l.columns-1))/l.columns,b=c-s*2,v=b-ai,w=n.header?m:g,C=r&&r.id===n.paperTitle?.id&&Math.abs(r.width-w)<1?r:void 0,y=n.paperTitle?Math.min(b,C?.height??n.paperTitle.height+(n.header?260:ai)):0,S=(T,O=0)=>!!n.paperTitle&&(n.header?T%2===0&&O===0:T===0),E=(T,O=0)=>S(T,O)?y:0;return{...l,width:a,height:c,margin:s,gap:u,sealWidth:h,contentWidth:g,contentHeight:b,columnWidth:m,columnX:(T,O)=>s+(T%2===0?h:0)+O*(m+u),titleWidth:w,titleMaxHeight:v,hasHeader:S,headerHeight:E,capacity:(T,O=0)=>b-E(T,O)}}function XS(n,r,l){const a=Jc(n,l);let c=0,s=0,u=0;const h=()=>{s++,s===a.columns&&(s=0,c++),u=0},g=n.blocks.map(b=>{const v=r[b.id],w=v&&Math.abs(v.width-a.columnWidth)<1?v.height:100+b.answerHeight,C=v&&Math.abs(v.width-a.columnWidth)<1?[...new Set([...v.breaks||[],w].filter(O=>Number.isFinite(O)&&O>0&&O<=w))].sort((O,D)=>O-D):[],y=b.reference?.type==="CCOMPOSITION",S=O=>y&&O>0?Math.max(0,6-Math.max(0,(v?.compositionStart||0)-O)):0;if(C.length>1&&C.every((O,D)=>{const M=C[D-1]||0;return O-M+S(M)<=a.capacity(1)+.5})){const O=[];let D=0;for(;D<w-.5;){const z=a.capacity(c,s)-u,H=D,G=S(D),X=C.filter(F=>F>H+.5&&F<=H+z-G+.5).at(-1);if(X===void 0){h();continue}const U=y&&X<w-.5?Math.max(0,z-G-(X-D)):0;O.push({page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,from:D,to:X,...G?{topPadding:G}:{},...U?{bottomPadding:U}:{}}),u+=X-D+G,D=X,D<w-.5&&h()}u+=ai;const M=O[0];return{id:b.id,...M,height:w,available:a.capacity(M.page,M.column),overflowing:!1,fragments:O}}for(;u+w>a.capacity(c,s)+.5&&(u>0||a.headerHeight(c,s)>0);)h();const R=a.capacity(c,s),N=w>R+.5,T={id:b.id,page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,height:w,available:R,overflowing:N,fragments:[{page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,from:0,to:Math.min(w,R)}]};return u+=Math.min(w,R)+ai,T}),m=new Map;return g.forEach((b,v)=>b.fragments.forEach(w=>{const C=`${w.page}/${w.column}`,y=m.get(C)||[];y.push({fragment:w,placement:b,blockIndex:v}),m.set(C,y)})),m.forEach(b=>{const v=b.filter(S=>["answer","writing","english","composite"].includes(n.blocks[S.blockIndex].kind)).at(-1);if(!v||n.blocks[v.blockIndex].reference?.type!=="CCOMPOSITION")return;const w=b.at(-1).fragment,y=w.page*(a.height+mo)+a.height-a.margin-w.y-(w.to-w.from)-(w.topPadding||0)-(w.bottomPadding||0);y<=0||y>30||(v.fragment.bottomPadding=(v.fragment.bottomPadding||0)+y,b.slice(b.indexOf(v)+1).forEach(({fragment:S,placement:E})=>{S.y+=y,E.fragments[0]===S&&(E.y=S.y)}))}),{geometry:a,placements:g,pageCount:c+1}}function ii(n,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${n}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r===null?[]:[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]]}]}}}function gn(n,r,l){const a=c=>{if(!c.content)return c;let s;const u=c.content.flatMap(h=>{const g=h.type==="text"&&h.marks?.find(v=>v.type==="documentLabel")?.attrs?.kind,m=g&&g===s;if(s=g,m)return[];if(!g)return[a(h)];const b=g==="number"?`${r}.`:l===null?"":`(${l}分)`;return b?[{...h,text:b}]:[]});return{...c,content:u}};return{...n,content:a(n.content)}}const Wn={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},sm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function cm(n,r=!1){const l=em(n),a=r?sm.filter(c=>c!=="MIXED"):sm;return r?["CHINESE","JAPANESE"].includes(l||"")?[...a,"CHUNK_CHOICE"]:a:l==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:l==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:l==="JAPANESE"?Object.keys(Wn):["POLITICAL","HISTORY"].includes(l||"")?[...a,"CCOMPOSITION"]:a}const KS=n=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(n),FS=n=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(n),_r=n=>({version:1,content:{type:"doc",content:n.length?n:[{type:"paragraph"}]}});function li(n,r,l=!1){return{content:Bt(),numbered:!l,groupId:`options:${r.id}`,layout:{...IS,columns:n==="CLOZE"?4:2,...n==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!l&&FS(n)?r.options.map(a=>({id:a.id,key:a.label,content:Bt()})):[]}}const Ml=n=>{if(n.type==="choiceStemAnchor"||n.type==="text"&&n.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...l}=n.attrs||{};return{...n,...n.attrs?{attrs:l}:{},...n.content?{content:n.content.map(Ml).filter(a=>a!==null)}:{}}};function _l(n,r,l){const c=(n.content.content.content||[{type:"paragraph"}]).map(s=>({...s,attrs:{...s.attrs,contentId:r}}));if(n.numbered){const s={type:"text",text:`${l}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]};["paragraph","heading"].includes(c[0]?.type||"")||c.unshift({type:"paragraph",attrs:{contentId:r},content:[]}),c[0]={...c[0],content:[s,...c[0].content||[]]}}return n.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:n.groupId,contentId:r,...n.layout},content:n.itemsContent.map(s=>({type:"choiceOption",attrs:{id:s.id,label:s.key,sourceKey:s.key,marker:"letter"},content:s.content.content.content||[{type:"paragraph"}]}))}),c}function um(n,r){const l=r.filter(h=>h.type==="choiceGroup"),a=l.find(h=>h.attrs?.id===n.groupId)||(l.length===1?l[0]:void 0),c=r.filter(h=>h!==a);let s=!1;const u=h=>{h.marks?.some(g=>g.type==="documentLabel"&&g.attrs?.kind==="number")&&(s=!0),h.content?.forEach(u)};return c.forEach(u),{...n,numbered:s,content:_r(c.map(Ml).filter(h=>h!==null)),groupId:a?.attrs?.id||n.groupId,layout:a?Object.fromEntries(Object.entries(n.layout).map(([h,g])=>[h,a.attrs?.[h]??g])):n.layout,itemsContent:(a?.content||[]).map((h,g)=>({id:h.attrs?.id||n.itemsContent[g]?.id||crypto.randomUUID(),key:h.attrs?.label||String.fromCharCode(65+g),content:_r((h.content||[]).map(Ml).filter(m=>m!==null))}))}}function dm(n,r,l,a){const c=new Map;r.content.content?.forEach(h=>{h.attrs?.contentId&&c.set(h.attrs.contentId,[...c.get(h.attrs.contentId)||[],h])});const s=new Set(a?.content.content?.map(h=>h.attrs?.contentId).filter(Boolean)),u=(h,g)=>g&&(c.has(h)||s.has(h))?um(g,c.get(h)||[]):g;return{...n,...c.has(l)?{material:_r(c.get(l).map(h=>Ml(h)))}:{},questions:n.questions.map(h=>({...h,text:u(h.id,h.text),parts:h.parts.map(g=>({...g,text:u(g.id,g.text)}))}))}}function eu(n){const r=n.reference,l=[];r.type==="MIXED"&&l.push(...(r.material||Bt()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:n.id}}))),r.questions.forEach(c=>{c.text&&l.push(..._l(c.text,c.id,c.label)),KS(c.type)&&c.parts.forEach(s=>{s.text&&l.push(..._l(s.text,s.id,s.label))})});const a=(n.document.content.content||[]).filter(c=>!c.attrs?.contentId);return pn(_r(a))||l.push(...a),_r(l)}function QS(n,r){const l=(a,c,s)=>!a||!s||c.options.map(u=>u.id).join()===s.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(h=>h.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(h=>h.id===u.id)?.content||Bt()}))};return{...n,questions:n.questions.map(a=>{const c=r.questions.find(s=>s.id===a.id);return{...a,text:l(a.text,a.choice,c?.choice),parts:a.parts.map(s=>({...s,text:l(s.text,s.choice,c?.parts.find(u=>u.id===s.id)?.choice)}))}})}}function ZS(n,r,l){if(n.reference?.textVersion!==1)return n;let a=n.reference;if(!r&&!pn(n.document)&&!n.document.content.content?.some(s=>s.attrs?.contentId))return{...n,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===n.document&&!pn(n.document))return n;if(n.document!==r?.document&&(!pn(n.document)||r)&&(a=dm(a,n.document,n.id,r?.document),r&&n.reference===r.reference))return{...n,reference:a};r?.reference&&n.reference!==r.reference&&(a=QS(a,r.reference));const c={...n,reference:a};return l||!pn(n.document)?{...c,document:eu(c)}:c}const Zo={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},Ct=n=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(n),ke=n=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(n),si=n=>n==="FILLBLANK"||n==="TEXT_COMPLETION",ci=n=>n==="CCOMPOSITION"||n==="ECOMPOSITION",WS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function tu(n){return{type:n,textVersion:1,questions:[],layout:Kc(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function fm(n){return{id:crypto.randomUUID(),kind:WS[n],title:Wn[n],answerHeight:0,document:Bt(),reference:tu(n)}}function nu(n,r=1,l){const a=n==="MCHOICE"&&ri(l);return{type:n,start:r,end:r,optionCount:n==="INFO_MATCHING"?null:n==="CHUNK_CHOICE"?12:n==="JUDGE"?2:4,partCount:ke(n)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function Wo(n,r,l){const a=Array.from({length:l},(c,s)=>({...n.options[s]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][s]:String.fromCharCode(65+s)}));return{...n,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:n.correctIds.filter(c=>a.some(s=>s.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?l:1)}}function ui(n,r,l,a=4){const c=crypto.randomUUID(),s={...Wo(Fo(0),l,a),id:c,label:n,score:r};return{id:c,label:n,score:r,width:25,breakAfter:!1,height:100,document:l==="SHORTANSWER"?ii(n,r):Bt(),choice:s,...ke(l)&&l!=="TEXT_COMPLETION"?{text:li(l,s)}:{}}}function ru(n,r){const l=crypto.randomUUID(),{type:a,score:c}=n,s=String(r),u=n.partCount||1,h=Array.from({length:ke(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(m,b)=>ui(ke(a)?String(r+b):u===1?s:`${s}.${b+1}`,c,a,n.optionCount||4)),g={...Wo(Fo(0),a,n.optionCount||4),id:l,label:s,score:c,scoreType:n.scoreType,lessScore:n.lessScore};return{id:l,type:a,label:s,score:h.length?Un(h):c,choice:g,text:li(a,g,ke(a)),parts:h,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...ii(s,c).content.content,...rC(n.lines,n.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?ii(s,c):Bt(),height:a==="ECOMPOSITION"?50*n.lines+40:100,contentHeight:38,characters:n.characters,lines:n.lines,halfPoint:!1,rightAnswers:n.rightAnswers,singleScore:n.singleScore}}const Un=n=>n.some(r=>r.score===null)?null:n.reduce((r,l)=>r+(l.score||0),0);function ou(n){return n.questions.flatMap(r=>ke(r.type)?r.parts.map(l=>l.label):[r.label])}function Dl(n){return Math.max(0,...ou(n).map(Number).filter(Number.isFinite))+1}function JS(n,r,l=!1){const a=Zo[r.type],c=ci(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(c)||c<1||c>a.count)return`题号须为 1–1000,单次题数为 1–${a.count}`;if(n.type==="CCOMPOSITION"&&n.questions.length)return"语文作文每组只能有一道题";if(n.optional)return"选做题组不能追加题目";const s=ou(n);if(Array.from({length:c},(u,h)=>String(r.start+h)).some(u=>s.includes(u)))return"同一分组内,题号不能重复";if(Ct(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<a.options[0]||r.optionCount>a.options[1]))return`选项个数须为 ${a.options[0]}–${a.options[1]}`;if((ke(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>a.parts))return`子题/空数须为 1–${a.parts}`;if(ke(r.type)&&c%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(l||n.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<.5||r.score>a.score||!Number.isInteger(r.score*2)))return`分值须为 0.5–${a.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function eC(n,r,l){const a=ke(r.type)?r.partCount:1,c=[];for(let h=r.start;h<=(ci(r.type)?r.start:r.end);h+=a)c.push(ru(r,h));const s=[...n.questions],u=s.findIndex(h=>h.id===l||h.parts.some(g=>g.id===l));return s.splice(u<0?s.length:u+1,0,...c),{...n,questions:s}}function Il(n){return n.questions.flatMap(r=>[r,...r.parts])}function Jo(n){return n.questions.filter(r=>Ct(r.type)).flatMap(r=>ke(r.type)?r.parts.map(l=>({...l.choice,label:l.label,score:l.score})):[{...r.choice,label:r.label,score:r.score}])}function tC(n,r){const l=fo(n);return l.referenceData&&(l.referenceData={...l.referenceData,questionId:l.id}),l.text&&(l.text.groupId=`options:${l.id}`),l.label=String(r),l.choice.label=l.label,l.choice.contentTarget=null,l.choice.breakBefore=!1,l.parts.forEach((a,c)=>{a.label=ke(l.type)?String(r+c):l.parts.length===1?l.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),l.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:l.id})}),l.document=gn(l.document,l.label,l.score),l.parts=l.parts.map(a=>({...a,document:gn(a.document,a.label,a.score)})),l}function nC(n){return Math.max(1,Math.floor((n-6)/31))}function rC(n,r){return{version:1,content:{type:"doc",content:Array.from({length:n},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function oC(n,r){const l=n.questions.reduce((c,s)=>c+(s.parts.length||1),0),a=r/l;return!l||!Number.isFinite(a)||a<.5||!Number.isInteger(a*2)||n.questions.some(c=>a>Zo[c.type].score||c.type==="CHUNK_CHOICE"&&(c.rightAnswers||0)*(c.singleScore||0)>a)?null:{...n,questions:n.questions.map(c=>({...c,score:a*(c.parts.length||1),document:gn(c.document,c.label,a*(c.parts.length||1)),choice:{...c.choice,score:a,lessScore:Math.min(c.choice.lessScore||0,a)},parts:c.parts.map(s=>({...s,score:a,document:gn(s.document,s.label,a),choice:{...s.choice,score:a}}))}))}}function aC(n,r){return[...n<=17?Array.from({length:18},(l,a)=>17-a<=n?String(17-a):""):[...Array.from({length:7},(l,a)=>7-a<=Math.floor(n/10)?`${7-a}0`:""),"",...Array.from({length:10},(l,a)=>String(9-a))],r?"0.5":""]}class di extends Error{constructor(l){super(l[0]?.message||"题卡数据无效");Qh(this,"issues");this.name="AnswerSheetDataError",this.issues=l}}function au(n,r){const l=(y,S="题卡数据结构无效")=>{throw new di([{code:"INVALID_DATA",path:y,message:S}])},a=(y,S)=>!y||typeof y!="object"||Array.isArray(y)?l(S):y,c=(y,S)=>Array.isArray(y)?y:l(S),s=(y,S)=>{typeof y!="string"&&l(S)},u=(y,S,E=0,R=1e5)=>{(typeof y!="number"||!Number.isFinite(y)||y<E||y>R)&&l(S)},h=(y,S)=>{a(y,S);const E=r.validateDocument(y);E.length&&l(S,E[0])},g=(y,S)=>{const E=a(y,S);if(s(E.id,`${S}.id`),s(E.label,`${S}.label`),(typeof E.multiple!="boolean"||typeof E.breakBefore!="boolean")&&l(S),E.contentTarget!==void 0&&E.contentTarget!==null){const R=a(E.contentTarget,`${S}.contentTarget`);s(R.groupId,`${S}.contentTarget.groupId`),c(R.optionIds,`${S}.contentTarget.optionIds`).forEach((N,T)=>s(N,`${S}.contentTarget.optionIds.${T}`))}c(E.options,`${S}.options`).forEach((R,N)=>{const T=a(R,`${S}.options.${N}`);s(T.id,`${S}.options.${N}.id`),s(T.label,`${S}.options.${N}.label`)}),c(E.correctIds,`${S}.correctIds`).forEach((R,N)=>s(R,`${S}.correctIds.${N}`))},m=(y,S)=>{const E=a(y,S);(!["row","column"].includes(String(E.direction))||!["concentrated","distributed","stem","option"].includes(String(E.presentation))||!["box","check","bubble"].includes(String(E.marker)))&&l(S),u(E.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(E.rowGap,`${S}.rowGap`,0,64),u(E.columnGap,`${S}.columnGap`,0,64),c(E.questions,`${S}.questions`).forEach((R,N)=>g(R,`${S}.questions.${N}`))},b=new WeakSet,v=(y,S)=>{if(!(!y||typeof y!="object")){if(b.has(y))return l(S,"题卡必须是无循环引用的 JSON 数据");b.add(y),Object.entries(y).forEach(([E,R])=>v(R,`${S}.${E}`)),b.delete(y)}},w=a(n,"");if(w.version!==1&&l("version","不支持的题卡数据版本"),s(w.title,"title"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(y=>{w[y]!==void 0&&typeof w[y]!="boolean"&&l(y)}),["a4","a3-two","a3-three"].includes(String(w.preset))||l("preset"),u(w.margin,"margin",0,100),u(w.gap,"gap",0,100),w.creation){const y=a(w.creation,"creation");["template","exam"].includes(String(y.mode))||l("creation.mode"),["name","grade","subject"].forEach(S=>s(y[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])y[S]!==void 0&&(typeof y[S]!="string"||!y[S].trim())&&l(`creation.${S}`);y.phaseCode!==void 0&&!["P","J","S"].includes(String(y.phaseCode))&&l("creation.phaseCode"),y.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(y.createMode))&&l("creation.createMode");for(const S of["id","exampaperId"])if(y[S]!==void 0){const E=y[S];typeof E=="string"&&E.trim()||typeof E=="number"&&Number.isSafeInteger(E)&&E>=0||l(`creation.${S}`)}}if(w.paperTitle){const y=a(w.paperTitle,"paperTitle");s(y.id,"paperTitle.id"),u(y.height,"paperTitle.height",1,1e3),h(y.document,"paperTitle.document")}if(w.header){const y=a(w.header,"header");["code","school"].includes(String(y.kaohao))||l("header.kaohao"),u(y.weishu,"header.weishu",1,20)}c(w.blocks,"blocks").forEach((y,S)=>{const E=`blocks.${S}`,R=a(y,E);if(s(R.id,`${E}.id`),s(R.title,`${E}.title`),u(R.answerHeight,`${E}.answerHeight`),h(R.document,`${E}.document`),!R.reference){if(R.choices){m(R.choices,`${E}.choices`);return}l(`${E}.reference`,"请使用包含 reference 题目结构的制卡数据")}const N=a(R.reference,`${E}.reference`);N.material!==void 0&&h(N.material,`${E}.reference.material`),N.textVersion!==void 0&&N.textVersion!==1&&l(`${E}.reference.textVersion`),Object.hasOwn(Wn,String(N.type))||l(`${E}.reference.type`),m(N.layout,`${E}.reference.layout`),u(N.optionalHeight,`${E}.reference.optionalHeight`),c(N.questions,`${E}.reference.questions`).forEach((T,O)=>{const D=`${E}.reference.questions.${O}`,M=a(T,D);Object.hasOwn(Zo,String(M.type))||l(`${D}.type`),s(M.id,`${D}.id`),s(M.label,`${D}.label`),g(M.choice,`${D}.choice`),["height","contentHeight","characters","lines"].forEach(H=>u(M[H],`${D}.${H}`)),h(M.document,`${D}.document`);const z=(H,G)=>{if(!H)return;const X=a(H,G);h(X.content,`${G}.content`),a(X.layout,`${G}.layout`),s(X.groupId,`${G}.groupId`),c(X.itemsContent,`${G}.itemsContent`).forEach((U,F)=>{const J=a(U,`${G}.itemsContent.${F}`);s(J.id,`${G}.itemsContent.${F}.id`),s(J.key,`${G}.itemsContent.${F}.key`),h(J.content,`${G}.itemsContent.${F}.content`)})};z(M.text,`${D}.text`),c(M.parts,`${D}.parts`).forEach((H,G)=>{const X=`${D}.parts.${G}`,U=a(H,X);s(U.id,`${X}.id`),s(U.label,`${X}.label`),u(U.width,`${X}.width`),u(U.height,`${X}.height`),h(U.document,`${X}.document`),g(U.choice,`${X}.choice`),z(U.text,`${X}.text`)})})}),v(n,"");const C=Jc(n);(C.columnWidth<100||C.contentHeight<100)&&l("margin","边距或栏间距过大,纸张没有足够的作答区域")}function zl(n){return!n||n.marks?.some(r=>r.type==="documentLabel")?!1:n.type==="text"?!!n.text?.trim():n.type==="image"?!!n.attrs?.src:n.type==="formula"||n.type==="blockFormula"?!!n.attrs?.latex?.trim():!!n.content?.some(zl)}function iC(n,r){try{au(n,r)}catch(C){return{valid:!1,issues:C instanceof di?C.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const l=[];let a={};const c=(C,y,S)=>l.push({code:C,path:y,message:S,...a}),s=new Set,u=(C,y)=>{(!C.trim()||s.has(C))&&c("DUPLICATE_ID",y,"题块、题目和选项 ID 必须非空且唯一"),s.add(C)},h=(C,y,S)=>{(C===null||!Number.isFinite(C)||C<.5||C>y||!Number.isInteger(C*2))&&c("INVALID_SCORE",S,`分值须为 0.5–${y} 分,按 0.5 分递增`)},g=(C,y,S)=>{(C.options.length<y[0]||C.options.length>y[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${y[0]}–${y[1]}`),C.options.forEach((E,R)=>u(E.id,`${S}.options.${R}.id`)),(new Set(C.correctIds).size!==C.correctIds.length||C.correctIds.some(E=>!C.options.some(R=>R.id===E)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},m=(C,y,S,E=0,R=!0)=>{R&&!zl(C?.content.content)&&c("MISSING_CONTENT",`${y}.content`,"请填写题干或材料"),S&&(C?.itemsContent.length!==E||C.itemsContent.some(N=>!zl(N.content.content)))&&c("MISSING_OPTION_CONTENT",`${y}.itemsContent`,"请补全每个选项的内容")};n.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),(!n.creation?.grade.trim()||!n.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!n.paperTitle||!zl(n.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),n.blocks.length||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),n.paperTitle&&u(n.paperTitle.id,"paperTitle.id"),n.blocks.forEach((C,y)=>{a={blockId:C.id};const S=`blocks.${y}`;u(C.id,`${S}.id`),C.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),C.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const E=C.reference;if(!E){C.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),C.choices?.questions.forEach((N,T)=>{a={blockId:C.id,questionId:N.id},u(N.id,`${S}.choices.questions.${T}.id`),g(N,[2,12],`${S}.choices.questions.${T}`),h(N.score??null,15,`${S}.choices.questions.${T}.score`)});return}E.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const R=ou(E);if((R.some(N=>!N.trim())||new Set(R).size!==R.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),E.optional&&(E.type!=="SHORTANSWER"||!Number.isInteger(E.choose)||E.choose<1||E.choose>=E.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),E.type==="CCOMPOSITION"&&E.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),E.questions.forEach((N,T)=>{a={blockId:C.id,questionId:N.id};const O=`${S}.reference.questions.${T}`,D=Zo[N.type];u(N.id,`${O}.id`),E.type!=="MIXED"&&E.type!==N.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),N.choice.id!==N.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const M=ke(N.type)||["FILLBLANK","SHORTANSWER"].includes(N.type);(M&&(N.parts.length<1||N.parts.length>D.parts)||!M&&N.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${M?`1–${D.parts}`:"0"}`),N.parts.length?N.score!==Un(N.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):h(N.score,D.score,`${O}.score`),Ct(N.type)&&!ke(N.type)&&g(N.choice,D.options,`${O}.choice`),N.type==="INFO_MATCHING"&&(g(N.choice,D.options,`${O}.choice`),N.parts.length>N.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),N.type==="MCHOICE"&&(!Number.isFinite(N.choice.lessScore)||N.choice.lessScore<0||N.choice.lessScore>(N.score||0)||!Number.isInteger(N.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),N.type==="CHUNK_CHOICE"&&(!N.rightAnswers||!Number.isInteger(N.rightAnswers)||N.rightAnswers>=N.choice.options.length||!N.singleScore||N.singleScore<.5||!Number.isInteger(N.singleScore*2)||N.singleScore*N.rightAnswers>(N.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),N.type==="CCOMPOSITION"&&(!Number.isInteger(N.characters)||N.characters<1||N.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),N.type==="ECOMPOSITION"&&(!Number.isInteger(N.lines)||N.lines<1||N.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),n.questionCard&&m(N.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(N.type),N.choice.options.length),N.parts.forEach((z,H)=>{const G=`${O}.parts.${H}`;a={blockId:C.id,questionId:z.id},u(z.id,`${G}.id`),h(z.score,D.score,`${G}.score`),ke(N.type)&&Ct(N.type)&&(g(z.choice,D.options,`${G}.choice`),z.choice.id!==z.id&&c("INVALID_BINDING",`${G}.choice.id`,"子题与填涂项 ID 不一致")),n.questionCard&&["CLOZE","READTHENANSWER"].includes(N.type)&&m(z.text,`${G}.text`,!0,z.choice.options.length,N.type==="READTHENANSWER")})}),a={blockId:C.id},n.questionCard&&E.layout.presentation!=="concentrated"){const N=E.questions.filter(O=>Ct(O.type)).flatMap(O=>ke(O.type)?O.parts.map(D=>D.choice):[O.choice]);Ko({...E.layout,questions:N},C.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const b=(C,y)=>{C.type==="image"&&(!C.attrs?.src||/^blob:/i.test(C.attrs.src))&&c("INVALID_IMAGE_URL",y,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(C.type||"")&&!String(C.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",y,"请填写公式或删除空公式"),C.content?.forEach((S,E)=>b(S,`${y}.content.${E}`))},v=(C,y)=>{C&&b(C.content,`${y}.content`)},w=(C,y)=>{v(C?.content,`${y}.content`),C?.itemsContent.forEach((S,E)=>v(S.content,`${y}.itemsContent.${E}.content`))};return v(n.paperTitle?.document,"paperTitle.document"),n.blocks.forEach((C,y)=>{a={blockId:C.id};const S=`blocks.${y}`;v(C.document,`${S}.document`),v(C.reference?.material,`${S}.reference.material`),C.reference?.questions.forEach((E,R)=>{a={blockId:C.id,questionId:E.id};const N=`blocks.${y}.reference.questions.${R}`;v(E.document,`${N}.document`),w(E.text,`${N}.text`),E.parts.forEach((T,O)=>{a={blockId:C.id,questionId:T.id},v(T.document,`${N}.parts.${O}.document`),w(T.text,`${N}.parts.${O}.text`)})})}),{valid:l.length===0,issues:l}}function iu(n){if(n!==void 0)try{const r=Pc(n);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof Uc?new di([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function lC(n,r){const l=(O,D)=>{throw new di([{code:"INVALID_INITIALIZATION",path:O,message:D}])},a=(O,D,M)=>{if(!O||typeof O!="object"||Array.isArray(O))return l(D,"初始化配置必须是对象");const z=Object.entries(O);for(const[H]of z)M.includes(H)||l(`${D}.${H}`,"不支持的初始化字段");return Object.fromEntries(z.filter(([,H])=>H!==void 0))},c=(O,D)=>typeof O!="string"||!O.trim()?l(D,"请提供非空的试卷名称、年级和学科"):O.trim(),s=(O,D,M)=>{O!==void 0&&!M.includes(O)&&l(D,`可选值为 ${M.join("、")}`)},u=(O,D)=>{O!==void 0&&typeof O!="boolean"&&l(D,"请使用布尔值")},h=(O,D,M,z)=>{O!==void 0&&(typeof O!="number"||!Number.isFinite(O)||O<M||O>z)&&l(D,`数值必须在 ${M}–${z} 之间`)},g=a(n,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header"]),m=c(g.name,"initialization.name");m.length>30&&l("initialization.name","试卷名称最多 30 个字符");const b=Pc(iu(r)),v=g.gradeCode!==void 0||g.courseCode!==void 0||g.subjectCode!==void 0;let w;if(v){try{w=ni(b,c(g.gradeCode,"initialization.gradeCode"),c(g.courseCode,"initialization.courseCode"))}catch(O){if(O instanceof Uc)return l(O.path,O.message);throw O}for(const O of["grade","subject","subjectCode"])g[O]!==void 0&&c(g[O],`initialization.${O}`)!==w[O]&&l(`initialization.${O}`,"名称或学科编码与课程字典不一致")}else{const O=c(g.grade,"initialization.grade"),D=c(g.subject,"initialization.subject"),M=b.grades.filter(G=>G.label===O);M.length>1&&l("initialization.grade","同名年级不唯一,请使用 gradeCode");const z=M[0],H=z?b.gradeCourseMap[z.value].filter(G=>G.label===D):[];H.length>1&&l("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!z||!H.length)&&l(z?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),w=z&&H.length?ni(b,z.value,H[0].value):{grade:O,subject:D}}s(g.mode,"initialization.mode",["template","exam"]),s(g.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const C={};for(const O of["id","exampaperId"])if(g[O]!==void 0){const D=g[O];typeof D=="string"?C[O]=c(D,`initialization.${O}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?C[O]=D:l(`initialization.${O}`,"ID 必须是非空字符串或非负安全整数")}g.createMode!==void 0&&(C.createMode=g.createMode);const y=g.layout===void 0?{}:a(g.layout,"initialization.layout",["preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(O,D,M)=>{y[O]!==void 0&&(y[D]!==void 0&&y[D]!==M&&l(`initialization.layout.${O}`,`与 ${D} 设置冲突`),y[D]=M,delete y[O])};y.pageNum!==void 0&&![1,2,3].includes(y.pageNum)&&l("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[y.pageNum]);for(const[O,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(y[O],`initialization.layout.${O}`),S(O,D,O==="choiceType"?y[O]?"column":"row":y[O]);s(y.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),s(y.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),h(y.margin,"initialization.layout.margin",0,100),h(y.gap,"initialization.layout.gap",0,100);for(const O of["questionCard","scanMarking","halfPoint","mergeObjective"])u(y[O],`initialization.layout.${O}`);const E=g.header===void 0?{}:a(g.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu"]);for(const O of["focusText","writeKaohao","missExam","mifeng"])u(E[O],`initialization.header.${O}`);s(E.kaohao,"initialization.header.kaohao",["school","code"]),h(E.weishu,"initialization.header.weishu",4,12),E.weishu!==void 0&&!Number.isInteger(E.weishu)&&l("initialization.header.weishu","考号位数必须是整数");const R=Wc({name:m,...w,...C,mode:g.mode??"template"}),N={...R,...y,header:{...R.header,...E}},T=Jc(N);return(T.columnWidth<100||T.contentHeight<100)&&l("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),N}function sC(n,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const l=jl(r?.plugins||[]),a=iu(r.dictionaries),c=typeof n=="string"?document.querySelector(n):n;if(!(c instanceof HTMLElement)||c.ownerDocument!==document||/^(INPUT|TEXTAREA|SELECT|BUTTON|IMG|CANVAS|IFRAME)$/.test(c.tagName))throw new Error("制卡需要一个空的 HTML 容器,例如 div");if(document.querySelector("[data-uni-answer-sheet-mount], #uni-answer-sheet"))throw new Error("当前文档已挂载制卡工作区;切换容器前请先 destroy()");if(c.textContent?.trim()||c.children.length)throw new Error("请提供空容器,已有题卡请通过 initialValue 传入");const s=document.createElement("div");s.className="uni-answer-sheet-host",s.dataset.uniAnswerSheetMount="",s.style.height="100%",c.append(s);let u=!1,h={...r,dictionaries:a},g,m,b;const v=new Promise((S,E)=>{m=S,b=E});v.catch(()=>{});const w=()=>{if(u)throw new Error("制卡实例已销毁");if(!g?.isReady())throw new Error("请先等待 sheet.ready");return g},C=async()=>(await v,w()),y={ready:v,async initialize(S){if(u)throw new Error("制卡实例已销毁");const E=lC(S,h.dictionaries);g||(h={...h,initialValue:E}),await(await C()).setDocument(E)},getDocument:()=>w().getDocument(),load:async S=>(await C()).setDocument(S),setDocument:async S=>(await C()).setDocument(S),newDocument:async S=>(await C()).newDocument(S),getReferenceData:()=>w().getReferenceData(),setReferenceData:async S=>(await C()).setReferenceData(S),validate:async()=>(await C()).validate(),save:async()=>(await C()).save(),focusIssue:S=>w().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const E=Object.hasOwn(S,"dictionaries")?iu(S.dictionaries):h.dictionaries;h={...h,...S,dictionaries:E},g?.update(h)},destroy(){u||(u=!0,g?.destroy(),s.remove(),b(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([l.prepare(),Promise.resolve().then(()=>EN)]).then(([,{mountAnswerSheet:S}])=>{u||(g=S(s,l,h,m,E=>{b(E),y.destroy(),h.onError?.(E instanceof Error?E:new Error(String(E)))}))}).catch(S=>{b(S),y.destroy(),h.onError?.(S instanceof Error?S:new Error(String(S)))}),y}function hm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lu={exports:{}},fi={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mm;function cC(){if(mm)return fi;mm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(a,c,s){var u=null;if(s!==void 0&&(u=""+s),c.key!==void 0&&(u=""+c.key),"key"in c){s={};for(var h in c)h!=="key"&&(s[h]=c[h])}else s=c;return c=s.ref,{$$typeof:n,type:a,key:u,ref:c!==void 0?c:null,props:s}}return fi.Fragment=r,fi.jsx=l,fi.jsxs=l,fi}var pm;function uC(){return pm||(pm=1,lu.exports=cC()),lu.exports}var f=uC(),su={exports:{}},Me={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var gm;function dC(){if(gm)return Me;gm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,S={};function E(A,V,K){this.props=A,this.context=V,this.refs=S,this.updater=K||C}E.prototype.isReactComponent={},E.prototype.setState=function(A,V){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,V,"setState")},E.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function R(){}R.prototype=E.prototype;function N(A,V,K){this.props=A,this.context=V,this.refs=S,this.updater=K||C}var T=N.prototype=new R;T.constructor=N,y(T,E.prototype),T.isPureReactComponent=!0;var O=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function z(A,V,K,ee,le,ce){return K=ce.ref,{$$typeof:n,type:A,key:V,ref:K!==void 0?K:null,props:ce}}function H(A,V){return z(A.type,V,void 0,void 0,void 0,A.props)}function G(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function X(A){var V={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(K){return V[K]})}var U=/\/+/g;function F(A,V){return typeof A=="object"&&A!==null&&A.key!=null?X(""+A.key):V.toString(36)}function J(){}function I(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(J,J):(A.status="pending",A.then(function(V){A.status==="pending"&&(A.status="fulfilled",A.value=V)},function(V){A.status==="pending"&&(A.status="rejected",A.reason=V)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Y(A,V,K,ee,le){var ce=typeof A;(ce==="undefined"||ce==="boolean")&&(A=null);var ie=!1;if(A===null)ie=!0;else switch(ce){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(A.$$typeof){case n:case r:ie=!0;break;case b:return ie=A._init,Y(ie(A._payload),V,K,ee,le)}}if(ie)return le=le(A),ie=ee===""?"."+F(A,0):ee,O(le)?(K="",ie!=null&&(K=ie.replace(U,"$&/")+"/"),Y(le,V,K,"",function(be){return be})):le!=null&&(G(le)&&(le=H(le,K+(le.key==null||A&&A.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+ie)),V.push(le)),1;ie=0;var ge=ee===""?".":ee+":";if(O(A))for(var je=0;je<A.length;je++)ee=A[je],ce=ge+F(ee,je),ie+=Y(ee,V,K,ce,le);else if(je=w(A),typeof je=="function")for(A=je.call(A),je=0;!(ee=A.next()).done;)ee=ee.value,ce=ge+F(ee,je++),ie+=Y(ee,V,K,ce,le);else if(ce==="object"){if(typeof A.then=="function")return Y(I(A),V,K,ee,le);throw V=String(A),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ie}function k(A,V,K){if(A==null)return A;var ee=[],le=0;return Y(A,ee,"","",function(ce){return V.call(K,ce,le++)}),ee}function $(A){if(A._status===-1){var V=A._result;V=V(),V.then(function(K){(A._status===0||A._status===-1)&&(A._status=1,A._result=K)},function(K){(A._status===0||A._status===-1)&&(A._status=2,A._result=K)}),A._status===-1&&(A._status=0,A._result=V)}if(A._status===1)return A._result.default;throw A._result}var L=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function Z(){}return Me.Children={map:k,forEach:function(A,V,K){k(A,function(){V.apply(this,arguments)},K)},count:function(A){var V=0;return k(A,function(){V++}),V},toArray:function(A){return k(A,function(V){return V})||[]},only:function(A){if(!G(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Me.Component=E,Me.Fragment=l,Me.Profiler=c,Me.PureComponent=N,Me.StrictMode=a,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Me.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},Me.cache=function(A){return function(){return A.apply(null,arguments)}},Me.cloneElement=function(A,V,K){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ee=y({},A.props),le=A.key,ce=void 0;if(V!=null)for(ie in V.ref!==void 0&&(ce=void 0),V.key!==void 0&&(le=""+V.key),V)!M.call(V,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&V.ref===void 0||(ee[ie]=V[ie]);var ie=arguments.length-2;if(ie===1)ee.children=K;else if(1<ie){for(var ge=Array(ie),je=0;je<ie;je++)ge[je]=arguments[je+2];ee.children=ge}return z(A.type,le,void 0,void 0,ce,ee)},Me.createContext=function(A){return A={$$typeof:u,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:s,_context:A},A},Me.createElement=function(A,V,K){var ee,le={},ce=null;if(V!=null)for(ee in V.key!==void 0&&(ce=""+V.key),V)M.call(V,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(le[ee]=V[ee]);var ie=arguments.length-2;if(ie===1)le.children=K;else if(1<ie){for(var ge=Array(ie),je=0;je<ie;je++)ge[je]=arguments[je+2];le.children=ge}if(A&&A.defaultProps)for(ee in ie=A.defaultProps,ie)le[ee]===void 0&&(le[ee]=ie[ee]);return z(A,ce,void 0,void 0,null,le)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(A){return{$$typeof:h,render:A}},Me.isValidElement=G,Me.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:$}},Me.memo=function(A,V){return{$$typeof:m,type:A,compare:V===void 0?null:V}},Me.startTransition=function(A){var V=D.T,K={};D.T=K;try{var ee=A(),le=D.S;le!==null&&le(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(Z,L)}catch(ce){L(ce)}finally{D.T=V}},Me.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Me.use=function(A){return D.H.use(A)},Me.useActionState=function(A,V,K){return D.H.useActionState(A,V,K)},Me.useCallback=function(A,V){return D.H.useCallback(A,V)},Me.useContext=function(A){return D.H.useContext(A)},Me.useDebugValue=function(){},Me.useDeferredValue=function(A,V){return D.H.useDeferredValue(A,V)},Me.useEffect=function(A,V,K){var ee=D.H;if(typeof K=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(A,V)},Me.useId=function(){return D.H.useId()},Me.useImperativeHandle=function(A,V,K){return D.H.useImperativeHandle(A,V,K)},Me.useInsertionEffect=function(A,V){return D.H.useInsertionEffect(A,V)},Me.useLayoutEffect=function(A,V){return D.H.useLayoutEffect(A,V)},Me.useMemo=function(A,V){return D.H.useMemo(A,V)},Me.useOptimistic=function(A,V){return D.H.useOptimistic(A,V)},Me.useReducer=function(A,V,K){return D.H.useReducer(A,V,K)},Me.useRef=function(A){return D.H.useRef(A)},Me.useState=function(A){return D.H.useState(A)},Me.useSyncExternalStore=function(A,V,K){return D.H.useSyncExternalStore(A,V,K)},Me.useTransition=function(){return D.H.useTransition()},Me.version="19.1.1",Me}var ym;function cu(){return ym||(ym=1,su.exports=dC()),su.exports}var x=cu();const hi=hm(x),po=st({__proto__:null,default:hi},[x]);var uu={exports:{}},mi={},du={exports:{}},fu={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var vm;function fC(){return vm||(vm=1,(function(n){function r(k,$){var L=k.length;k.push($);e:for(;0<L;){var Z=L-1>>>1,A=k[Z];if(0<c(A,$))k[Z]=$,k[L]=A,L=Z;else break e}}function l(k){return k.length===0?null:k[0]}function a(k){if(k.length===0)return null;var $=k[0],L=k.pop();if(L!==$){k[0]=L;e:for(var Z=0,A=k.length,V=A>>>1;Z<V;){var K=2*(Z+1)-1,ee=k[K],le=K+1,ce=k[le];if(0>c(ee,L))le<A&&0>c(ce,ee)?(k[Z]=ce,k[le]=L,Z=le):(k[Z]=ee,k[K]=L,Z=K);else if(le<A&&0>c(ce,L))k[Z]=ce,k[le]=L,Z=le;else break e}}return $}function c(k,$){var L=k.sortIndex-$.sortIndex;return L!==0?L:k.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var u=Date,h=u.now();n.unstable_now=function(){return u.now()-h}}var g=[],m=[],b=1,v=null,w=3,C=!1,y=!1,S=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(k){for(var $=l(m);$!==null;){if($.callback===null)a(m);else if($.startTime<=k)a(m),$.sortIndex=$.expirationTime,r(g,$);else break;$=l(m)}}function D(k){if(S=!1,O(k),!y)if(l(g)!==null)y=!0,M||(M=!0,F());else{var $=l(m);$!==null&&Y(D,$.startTime-k)}}var M=!1,z=-1,H=5,G=-1;function X(){return E?!0:!(n.unstable_now()-G<H)}function U(){if(E=!1,M){var k=n.unstable_now();G=k;var $=!0;try{e:{y=!1,S&&(S=!1,N(z),z=-1),C=!0;var L=w;try{t:{for(O(k),v=l(g);v!==null&&!(v.expirationTime>k&&X());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,w=v.priorityLevel;var A=Z(v.expirationTime<=k);if(k=n.unstable_now(),typeof A=="function"){v.callback=A,O(k),$=!0;break t}v===l(g)&&a(g),O(k)}else a(g);v=l(g)}if(v!==null)$=!0;else{var V=l(m);V!==null&&Y(D,V.startTime-k),$=!1}}break e}finally{v=null,w=L,C=!1}$=void 0}}finally{$?F():M=!1}}}var F;if(typeof T=="function")F=function(){T(U)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,I=J.port2;J.port1.onmessage=U,F=function(){I.postMessage(null)}}else F=function(){R(U,0)};function Y(k,$){z=R(function(){k(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(k){switch(w){case 1:case 2:case 3:var $=3;break;default:$=w}var L=w;w=$;try{return k()}finally{w=L}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var L=w;w=k;try{return $()}finally{w=L}},n.unstable_scheduleCallback=function(k,$,L){var Z=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?Z+L:Z):L=Z,k){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=L+A,k={id:b++,callback:$,priorityLevel:k,startTime:L,expirationTime:A,sortIndex:-1},L>Z?(k.sortIndex=L,r(m,k),l(g)===null&&k===l(m)&&(S?(N(z),z=-1):S=!0,Y(D,L-Z))):(k.sortIndex=A,r(g,k),y||C||(y=!0,M||(M=!0,F()))),k},n.unstable_shouldYield=X,n.unstable_wrapCallback=function(k){var $=w;return function(){var L=w;w=$;try{return k.apply(this,arguments)}finally{w=L}}}})(fu)),fu}var bm;function hC(){return bm||(bm=1,du.exports=fC()),du.exports}var hu={exports:{}},Ut={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var xm;function mC(){if(xm)return Ut;xm=1;var n=cu();function r(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var a={d:{f:l,r:function(){throw Error(r(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function s(g,m,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:g,containerInfo:m,implementation:b}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return s(g,m,null,b)},Ut.flushSync=function(g){var m=u.T,b=a.p;try{if(u.T=null,a.p=2,g)return g()}finally{u.T=m,a.p=b,a.d.f()}},Ut.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(g,m))},Ut.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},Ut.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,v=h(b,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,C=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:C}):b==="script"&&a.d.X(g,{crossOrigin:v,integrity:w,fetchPriority:C,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Ut.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);a.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(g)},Ut.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,v=h(b,m.crossOrigin);a.d.L(g,b,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Ut.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=h(m.as,m.crossOrigin);a.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(g)},Ut.requestFormReset=function(g){a.d.r(g)},Ut.unstable_batchedUpdates=function(g,m){return g(m)},Ut.useFormState=function(g,m,b){return u.H.useFormState(g,m,b)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.1.1",Ut}var Sm;function Cm(){if(Sm)return hu.exports;Sm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),hu.exports=mC(),hu.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var wm;function pC(){if(wm)return mi;wm=1;var n=hC(),r=cu(),l=Cm();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(s(e)!==e)throw Error(a(188))}function g(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t!==e?null:e}for(var o=e,i=t;;){var d=o.return;if(d===null)break;var p=d.alternate;if(p===null){if(i=d.return,i!==null){o=i;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===o)return h(d),e;if(p===i)return h(d),t;p=p.sibling}throw Error(a(188))}if(o.return!==i.return)o=d,i=p;else{for(var j=!1,_=d.child;_;){if(_===o){j=!0,o=d,i=p;break}if(_===i){j=!0,i=d,o=p;break}_=_.sibling}if(!j){for(_=p.child;_;){if(_===o){j=!0,o=p,i=d;break}if(_===i){j=!0,i=p,o=d;break}_=_.sibling}if(!j)throw Error(a(189))}}if(o.alternate!==i)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function I(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:I(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return I(e(t))}catch{}}return null}var Y=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},Z=[],A=-1;function V(e){return{current:e}}function K(e){0>A||(e.current=Z[A],Z[A]=null,A--)}function ee(e,t){A++,Z[A]=e.current,e.current=t}var le=V(null),ce=V(null),ie=V(null),ge=V(null);function je(e,t){switch(ee(ie,t),ee(ce,e),ee(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?W0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=W0(t),e=J0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(le),ee(le,e)}function be(){K(le),K(ce),K(ie)}function de(e){e.memoizedState!==null&&ee(ge,e);var t=le.current,o=J0(t,e.type);t!==o&&(ee(ce,e),ee(le,o))}function Se(e){ce.current===e&&(K(le),K(ce)),ge.current===e&&(K(ge),Sl._currentValue=L)}var _e=Object.prototype.hasOwnProperty,Ce=n.unstable_scheduleCallback,Ae=n.unstable_cancelCallback,$e=n.unstable_shouldYield,Dn=n.unstable_requestPaint,jt=n.unstable_now,pe=n.unstable_getCurrentPriorityLevel,ct=n.unstable_ImmediatePriority,ut=n.unstable_UserBlockingPriority,an=n.unstable_NormalPriority,hr=n.unstable_LowPriority,pa=n.unstable_IdlePriority,ga=n.log,Pr=n.unstable_setDisableYieldValue,mr=null,se=null;function Re(e){if(typeof ga=="function"&&Pr(e),se&&typeof se.setStrictMode=="function")try{se.setStrictMode(mr,e)}catch{}}var ye=Math.clz32?Math.clz32:Ne,ve=Math.log,Ke=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(ve(e)/Ke|0)|0}var Fe=256,Xt=4194304;function Yn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function No(e,t,o){var i=e.pendingLanes;if(i===0)return 0;var d=0,p=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var _=i&134217727;return _!==0?(i=_&~p,i!==0?d=Yn(i):(j&=_,j!==0?d=Yn(j):o||(o=_&~e,o!==0&&(d=Yn(o))))):(_=i&~p,_!==0?d=Yn(_):j!==0?d=Yn(j):o||(o=i&~e,o!==0&&(d=Yn(o)))),d===0?0:t!==0&&t!==d&&(t&p)===0&&(p=d&-d,o=t&-t,p>=o||p===32&&(o&4194048)!==0)?t:d}function In(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ns(){var e=Fe;return Fe<<=1,(Fe&4194048)===0&&(Fe=256),e}function Lv(){var e=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),e}function Hd(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function Mi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function TN(e,t,o,i,d,p){var j=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var _=e.entanglements,B=e.expirationTimes,W=e.hiddenUpdates;for(o=j&~o;0<o;){var re=31-ye(o),ae=1<<re;_[re]=0,B[re]=-1;var te=W[re];if(te!==null)for(W[re]=null,re=0;re<te.length;re++){var ne=te[re];ne!==null&&(ne.lane&=-536870913)}o&=~ae}i!==0&&kv(e,i,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(j&~t))}function kv(e,t,o){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-ye(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|o&4194090}function Hv(e,t){var o=e.entangledLanes|=t;for(e=e.entanglements;o;){var i=31-ye(o),d=1<<i;d&t|e[i]&t&&(e[i]|=t),o&=~d}}function Bd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ud(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Bv(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:vS(e.type))}function jN(e,t){var o=$.p;try{return $.p=e,t()}finally{$.p=o}}var $r=Math.random().toString(36).slice(2),$t="__reactFiber$"+$r,Zt="__reactProps$"+$r,ya="__reactContainer$"+$r,Pd="__reactEvents$"+$r,ON="__reactListeners$"+$r,RN="__reactHandles$"+$r,Uv="__reactResources$"+$r,_i="__reactMarker$"+$r;function $d(e){delete e[$t],delete e[Zt],delete e[Pd],delete e[ON],delete e[RN]}function va(e){var t=e[$t];if(t)return t;for(var o=e.parentNode;o;){if(t=o[ya]||o[$t]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=rS(e);e!==null;){if(o=e[$t])return o;e=rS(e)}return t}e=o,o=e.parentNode}return null}function ba(e){if(e=e[$t]||e[ya]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Di(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function xa(e){var t=e[Uv];return t||(t=e[Uv]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[_i]=!0}var Pv=new Set,$v={};function Ao(e,t){Sa(e,t),Sa(e+"Capture",t)}function Sa(e,t){for($v[e]=t,e=0;e<t.length;e++)Pv.add(t[e])}var NN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Gv={},Vv={};function AN(e){return _e.call(Vv,e)?!0:_e.call(Gv,e)?!1:NN.test(e)?Vv[e]=!0:(Gv[e]=!0,!1)}function As(e,t,o){if(AN(t))if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+o)}}function Ms(e,t,o){if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+o)}}function gr(e,t,o,i){if(i===null)e.removeAttribute(o);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(t,o,""+i)}}var Gd,qv;function Ca(e){if(Gd===void 0)try{throw Error()}catch(o){var t=o.stack.trim().match(/\n( *(at )?)/);Gd=t&&t[1]||"",qv=-1<o.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Gd+e+qv}var Vd=!1;function qd(e,t){if(!e||Vd)return"";Vd=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(ne){var te=ne}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(ne){te=ne}e.call(ae.prototype)}}else{try{throw Error()}catch(ne){te=ne}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=i.DetermineComponentFrameRoot(),j=p[0],_=p[1];if(j&&_){var B=j.split(`
44
+ `),W=_.split(`
45
+ `);for(d=i=0;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;for(;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;if(i===B.length||d===W.length)for(i=B.length-1,d=W.length-1;1<=i&&0<=d&&B[i]!==W[d];)d--;for(;1<=i&&0<=d;i--,d--)if(B[i]!==W[d]){if(i!==1||d!==1)do if(i--,d--,0>d||B[i]!==W[d]){var re=`
46
+ `+B[i].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=i&&0<=d);break}}}finally{Vd=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Ca(o):""}function MN(e){switch(e.tag){case 26:case 27:case 5:return Ca(e.type);case 16:return Ca("Lazy");case 13:return Ca("Suspense");case 19:return Ca("SuspenseList");case 0:case 15:return qd(e.type,!1);case 11:return qd(e.type.render,!1);case 1:return qd(e.type,!0);case 31:return Ca("Activity");default:return""}}function Yv(e){try{var t="";do t+=MN(e),e=e.return;while(e);return t}catch(o){return`
47
+ Error generating stack: `+o.message+`
48
+ `+o.stack}}function Sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _N(e){var t=Xv(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){i=""+j,p.call(this,j)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){e._valueTracker||(e._valueTracker=_N(e))}function Kv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),i="";return e&&(i=Xv(e)?e.checked?"true":"false":e.value),e=i,e!==o?(t.setValue(e),!0):!1}function Ds(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var DN=/[\n"\\]/g;function Cn(e){return e.replace(DN,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yd(e,t,o,i,d,p,j,_){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Sn(t)):e.value!==""+Sn(t)&&(e.value=""+Sn(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?Xd(e,j,Sn(t)):o!=null?Xd(e,j,Sn(o)):i!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Sn(_):e.removeAttribute("name")}function Fv(e,t,o,i,d,p,j,_){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||t!=null))return;o=o!=null?""+Sn(o):"",t=t!=null?""+Sn(t):o,_||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=_?e.checked:!!i,e.defaultChecked=!!i,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j)}function Xd(e,t,o){t==="number"&&Ds(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function wa(e,t,o,i){if(e=e.options,t){t={};for(var d=0;d<o.length;d++)t["$"+o[d]]=!0;for(o=0;o<e.length;o++)d=t.hasOwnProperty("$"+e[o].value),e[o].selected!==d&&(e[o].selected=d),d&&i&&(e[o].defaultSelected=!0)}else{for(o=""+Sn(o),t=null,d=0;d<e.length;d++){if(e[d].value===o){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Qv(e,t,o){if(t!=null&&(t=""+Sn(t),t!==e.value&&(e.value=t),o==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=o!=null?""+Sn(o):""}function Zv(e,t,o,i){if(t==null){if(i!=null){if(o!=null)throw Error(a(92));if(Y(i)){if(1<i.length)throw Error(a(93));i=i[0]}o=i}o==null&&(o=""),t=o}o=Sn(t),e.defaultValue=o,i=e.textContent,i===o&&i!==""&&i!==null&&(e.value=i)}function Ea(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var IN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Wv(e,t,o){var i=t.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,o):typeof o!="number"||o===0||IN.has(t)?t==="float"?e.cssFloat=o:e[t]=(""+o).trim():e[t]=o+"px"}function Jv(e,t,o){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,o!=null){for(var i in o)!o.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&o[d]!==i&&Wv(e,d,i)}else for(var p in t)t.hasOwnProperty(p)&&Wv(e,p,t[p])}function Kd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),LN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Is(e){return LN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Fd=null;function Qd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ta=null,ja=null;function eb(e){var t=ba(e);if(t&&(e=t.stateNode)){var o=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yd(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),t=o.name,o.type==="radio"&&t!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Cn(""+t)+'"][type="radio"]'),t=0;t<o.length;t++){var i=o[t];if(i!==e&&i.form===e.form){var d=i[Zt]||null;if(!d)throw Error(a(90));Yd(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<o.length;t++)i=o[t],i.form===e.form&&Kv(i)}break e;case"textarea":Qv(e,o.value,o.defaultValue);break e;case"select":t=o.value,t!=null&&wa(e,!!o.multiple,t,!1)}}}var Zd=!1;function tb(e,t,o){if(Zd)return e(t,o);Zd=!0;try{var i=e(t);return i}finally{if(Zd=!1,(Ta!==null||ja!==null)&&(bc(),Ta&&(t=Ta,e=ja,ja=Ta=null,eb(t),e)))for(t=0;t<e.length;t++)eb(e[t])}}function Ii(e,t){var o=e.stateNode;if(o===null)return null;var i=o[Zt]||null;if(i===null)return null;o=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,t,typeof o));return o}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wd=!1;if(yr)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Wd=!1}var Gr=null,Jd=null,zs=null;function nb(){if(zs)return zs;var e,t=Jd,o=t.length,i,d="value"in Gr?Gr.value:Gr.textContent,p=d.length;for(e=0;e<o&&t[e]===d[e];e++);var j=o-e;for(i=1;i<=j&&t[o-i]===d[p-i];i++);return zs=d.slice(e,1<i?1-i:void 0)}function Ls(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ks(){return!0}function rb(){return!1}function Wt(e){function t(o,i,d,p,j){this._reactName=o,this._targetInst=d,this.type=i,this.nativeEvent=p,this.target=j,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(o=e[_],this[_]=o?o(p):p[_]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?ks:rb,this.isPropagationStopped=rb,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var Mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hs=Wt(Mo),Li=b({},Mo,{view:0,detail:0}),kN=Wt(Li),ef,tf,ki,Bs=b({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ki&&(ki&&e.type==="mousemove"?(ef=e.screenX-ki.screenX,tf=e.screenY-ki.screenY):tf=ef=0,ki=e),ef)},movementY:function(e){return"movementY"in e?e.movementY:tf}}),ob=Wt(Bs),HN=b({},Bs,{dataTransfer:0}),BN=Wt(HN),UN=b({},Li,{relatedTarget:0}),nf=Wt(UN),PN=b({},Mo,{animationName:0,elapsedTime:0,pseudoElement:0}),$N=Wt(PN),GN=b({},Mo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VN=Wt(GN),qN=b({},Mo,{data:0}),ab=Wt(qN),YN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KN[e])?!!t[e]:!1}function rf(){return FN}var QN=b({},Li,{key:function(e){if(e.key){var t=YN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rf,charCode:function(e){return e.type==="keypress"?Ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZN=Wt(QN),WN=b({},Bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ib=Wt(WN),JN=b({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rf}),eA=Wt(JN),tA=b({},Mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),nA=Wt(tA),rA=b({},Bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oA=Wt(rA),aA=b({},Mo,{newState:0,oldState:0}),iA=Wt(aA),lA=[9,13,27,32],of=yr&&"CompositionEvent"in window,Hi=null;yr&&"documentMode"in document&&(Hi=document.documentMode);var sA=yr&&"TextEvent"in window&&!Hi,lb=yr&&(!of||Hi&&8<Hi&&11>=Hi),sb=" ",cb=!1;function ub(e,t){switch(e){case"keyup":return lA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function db(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oa=!1;function cA(e,t){switch(e){case"compositionend":return db(t);case"keypress":return t.which!==32?null:(cb=!0,sb);case"textInput":return e=t.data,e===sb&&cb?null:e;default:return null}}function uA(e,t){if(Oa)return e==="compositionend"||!of&&ub(e,t)?(e=nb(),zs=Jd=Gr=null,Oa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lb&&t.locale!=="ko"?null:t.data;default:return null}}var dA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dA[e.type]:t==="textarea"}function hb(e,t,o,i){Ta?ja?ja.push(i):ja=[i]:Ta=i,t=Tc(t,"onChange"),0<t.length&&(o=new Hs("onChange","change",null,o,i),e.push({event:o,listeners:t}))}var Bi=null,Ui=null;function fA(e){X0(e,0)}function Us(e){var t=Di(e);if(Kv(t))return e}function mb(e,t){if(e==="change")return t}var pb=!1;if(yr){var af;if(yr){var lf="oninput"in document;if(!lf){var gb=document.createElement("div");gb.setAttribute("oninput","return;"),lf=typeof gb.oninput=="function"}af=lf}else af=!1;pb=af&&(!document.documentMode||9<document.documentMode)}function yb(){Bi&&(Bi.detachEvent("onpropertychange",vb),Ui=Bi=null)}function vb(e){if(e.propertyName==="value"&&Us(Ui)){var t=[];hb(t,Ui,e,Qd(e)),tb(fA,t)}}function hA(e,t,o){e==="focusin"?(yb(),Bi=t,Ui=o,Bi.attachEvent("onpropertychange",vb)):e==="focusout"&&yb()}function mA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Us(Ui)}function pA(e,t){if(e==="click")return Us(t)}function gA(e,t){if(e==="input"||e==="change")return Us(t)}function yA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:yA;function Pi(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(i=0;i<o.length;i++){var d=o[i];if(!_e.call(t,d)||!ln(e[d],t[d]))return!1}return!0}function bb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xb(e,t){var o=bb(e);e=0;for(var i;o;){if(o.nodeType===3){if(i=e+o.textContent.length,e<=t&&i>=t)return{node:o,offset:t-e};e=i}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=bb(o)}}function Sb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ds(e.document);t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=Ds(e.document)}return t}function sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vA=yr&&"documentMode"in document&&11>=document.documentMode,Ra=null,cf=null,$i=null,uf=!1;function wb(e,t,o){var i=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;uf||Ra==null||Ra!==Ds(i)||(i=Ra,"selectionStart"in i&&sf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$i&&Pi($i,i)||($i=i,i=Tc(cf,"onSelect"),0<i.length&&(t=new Hs("onSelect","select",null,t,o),e.push({event:t,listeners:i}),t.target=Ra)))}function _o(e,t){var o={};return o[e.toLowerCase()]=t.toLowerCase(),o["Webkit"+e]="webkit"+t,o["Moz"+e]="moz"+t,o}var Na={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionrun:_o("Transition","TransitionRun"),transitionstart:_o("Transition","TransitionStart"),transitioncancel:_o("Transition","TransitionCancel"),transitionend:_o("Transition","TransitionEnd")},df={},Eb={};yr&&(Eb=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Do(e){if(df[e])return df[e];if(!Na[e])return e;var t=Na[e],o;for(o in t)if(t.hasOwnProperty(o)&&o in Eb)return df[e]=t[o];return e}var Tb=Do("animationend"),jb=Do("animationiteration"),Ob=Do("animationstart"),bA=Do("transitionrun"),xA=Do("transitionstart"),SA=Do("transitioncancel"),Rb=Do("transitionend"),Nb=new Map,ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ff.push("scrollEnd");function zn(e,t){Nb.set(e,t),Ao(t,[e])}var Ab=new WeakMap;function wn(e,t){if(typeof e=="object"&&e!==null){var o=Ab.get(e);return o!==void 0?o:(t={value:e,source:t,stack:Yv(t)},Ab.set(e,t),t)}return{value:e,source:t,stack:Yv(t)}}var En=[],Aa=0,hf=0;function Ps(){for(var e=Aa,t=hf=Aa=0;t<e;){var o=En[t];En[t++]=null;var i=En[t];En[t++]=null;var d=En[t];En[t++]=null;var p=En[t];if(En[t++]=null,i!==null&&d!==null){var j=i.pending;j===null?d.next=d:(d.next=j.next,j.next=d),i.pending=d}p!==0&&Mb(o,d,p)}}function $s(e,t,o,i){En[Aa++]=e,En[Aa++]=t,En[Aa++]=o,En[Aa++]=i,hf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function mf(e,t,o,i){return $s(e,t,o,i),Gs(e)}function Ma(e,t){return $s(e,null,null,t),Gs(e)}function Mb(e,t,o){e.lanes|=o;var i=e.alternate;i!==null&&(i.lanes|=o);for(var d=!1,p=e.return;p!==null;)p.childLanes|=o,i=p.alternate,i!==null&&(i.childLanes|=o),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&t!==null&&(d=31-ye(o),e=p.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=o|536870912),p):null}function Gs(e){if(50<hl)throw hl=0,xh=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _a={};function CA(e,t,o,i){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,o,i){return new CA(e,t,o,i)}function pf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vr(e,t){var o=e.alternate;return o===null?(o=sn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function _b(e,t){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,t=o.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vs(e,t,o,i,d,p){var j=0;if(i=e,typeof e=="function")pf(e)&&(j=1);else if(typeof e=="string")j=EM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=sn(31,o,t,d),e.elementType=G,e.lanes=p,e;case y:return Io(o.children,d,p,t);case S:j=8,d|=24;break;case E:return e=sn(12,o,t,d|2),e.elementType=E,e.lanes=p,e;case D:return e=sn(13,o,t,d),e.elementType=D,e.lanes=p,e;case M:return e=sn(19,o,t,d),e.elementType=M,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:case T:j=10;break e;case N:j=9;break e;case O:j=11;break e;case z:j=14;break e;case H:j=16,i=null;break e}j=29,o=Error(a(130,e===null?"null":typeof e,"")),i=null}return t=sn(j,o,t,d),t.elementType=e,t.type=i,t.lanes=p,t}function Io(e,t,o,i){return e=sn(7,e,i,t),e.lanes=o,e}function gf(e,t,o){return e=sn(6,e,null,t),e.lanes=o,e}function yf(e,t,o){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Da=[],Ia=0,qs=null,Ys=0,Tn=[],jn=0,zo=null,br=1,xr="";function Lo(e,t){Da[Ia++]=Ys,Da[Ia++]=qs,qs=e,Ys=t}function Db(e,t,o){Tn[jn++]=br,Tn[jn++]=xr,Tn[jn++]=zo,zo=e;var i=br;e=xr;var d=32-ye(i)-1;i&=~(1<<d),o+=1;var p=32-ye(t)+d;if(30<p){var j=d-d%5;p=(i&(1<<j)-1).toString(32),i>>=j,d-=j,br=1<<32-ye(t)+d|o<<d|i,xr=p+e}else br=1<<p|o<<d|i,xr=e}function vf(e){e.return!==null&&(Lo(e,1),Db(e,1,0))}function bf(e){for(;e===qs;)qs=Da[--Ia],Da[Ia]=null,Ys=Da[--Ia],Da[Ia]=null;for(;e===zo;)zo=Tn[--jn],Tn[jn]=null,xr=Tn[--jn],Tn[jn]=null,br=Tn[--jn],Tn[jn]=null}var Kt=null,dt=null,Xe=!1,ko=null,Xn=!1,xf=Error(a(519));function Ho(e){var t=Error(a(418,""));throw qi(wn(t,e)),xf}function Ib(e){var t=e.stateNode,o=e.type,i=e.memoizedProps;switch(t[$t]=e,t[Zt]=i,o){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(o=0;o<pl.length;o++)Ue(pl[o],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),Fv(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),_s(t);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Zv(t,i.value,i.defaultValue,i.children),_s(t)}o=i.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||t.textContent===""+o||i.suppressHydrationWarning===!0||Z0(t.textContent,o)?(i.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),i.onScroll!=null&&Ue("scroll",t),i.onScrollEnd!=null&&Ue("scrollend",t),i.onClick!=null&&(t.onclick=jc),t=!0):t=!1,t||Ho(e)}function zb(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:Kt=Kt.return}}function Gi(e){if(e!==Kt)return!1;if(!Xe)return zb(e),Xe=!0,!1;var t=e.tag,o;if((o=t!==3&&t!==27)&&((o=t===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||Lh(e.type,e.memoizedProps)),o=!o),o&&dt&&Ho(e),zb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(t===0){dt=kn(e.nextSibling);break e}t--}else o!=="$"&&o!=="$!"&&o!=="$?"||t++;e=e.nextSibling}dt=null}}else t===27?(t=dt,ao(e.type)?(e=Uh,Uh=null,dt=e):dt=t):dt=Kt?kn(e.stateNode.nextSibling):null;return!0}function Vi(){dt=Kt=null,Xe=!1}function Lb(){var e=ko;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),ko=null),e}function qi(e){ko===null?ko=[e]:ko.push(e)}var Sf=V(null),Bo=null,Sr=null;function Vr(e,t,o){ee(Sf,t._currentValue),t._currentValue=o}function Cr(e){e._currentValue=Sf.current,K(Sf)}function Cf(e,t,o){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===o)break;e=e.return}}function wf(e,t,o,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var j=d.child;p=p.firstContext;e:for(;p!==null;){var _=p;p=d;for(var B=0;B<t.length;B++)if(_.context===t[B]){p.lanes|=o,_=p.alternate,_!==null&&(_.lanes|=o),Cf(p.return,o,e),i||(j=null);break e}p=_.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(a(341));j.lanes|=o,p=j.alternate,p!==null&&(p.lanes|=o),Cf(j,o,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function Yi(e,t,o,i){e=null;for(var d=t,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=d.type;ln(d.pendingProps.value,j.value)||(e!==null?e.push(_):e=[_])}}else if(d===ge.current){if(j=d.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Sl):e=[Sl])}d=d.return}e!==null&&wf(t,e,o,i),t.flags|=262144}function Xs(e){for(e=e.firstContext;e!==null;){if(!ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Uo(e){Bo=e,Sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return kb(Bo,e)}function Ks(e,t){return Bo===null&&Uo(e),kb(e,t)}function kb(e,t){var o=t._currentValue;if(t={context:t,memoizedValue:o,next:null},Sr===null){if(e===null)throw Error(a(308));Sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sr=Sr.next=t;return o}var wA=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(o,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(o){return o()})}},EA=n.unstable_scheduleCallback,TA=n.unstable_NormalPriority,Ot={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ef(){return{controller:new wA,data:new Map,refCount:0}}function Xi(e){e.refCount--,e.refCount===0&&EA(TA,function(){e.controller.abort()})}var Ki=null,Tf=0,za=0,La=null;function jA(e,t){if(Ki===null){var o=Ki=[];Tf=0,za=Oh(),La={status:"pending",value:void 0,then:function(i){o.push(i)}}}return Tf++,t.then(Hb,Hb),t}function Hb(){if(--Tf===0&&Ki!==null){La!==null&&(La.status="fulfilled");var e=Ki;Ki=null,za=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function OA(e,t){var o=[],i={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<o.length;d++)(0,o[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),i}var Bb=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&jA(e,t),Bb!==null&&Bb(e,t)};var Po=V(null);function jf(){var e=Po.current;return e!==null?e:rt.pooledCache}function Fs(e,t){t===null?ee(Po,Po.current):ee(Po,t.pool)}function Ub(){var e=jf();return e===null?null:{parent:Ot._currentValue,pool:e}}var Fi=Error(a(460)),Pb=Error(a(474)),Qs=Error(a(542)),Of={then:function(){}};function $b(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zs(){}function Gb(e,t,o){switch(o=e[o],o===void 0?e.push(t):o!==t&&(t.then(Zs,Zs),t=o),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qb(e),e;default:if(typeof t.status=="string")t.then(Zs,Zs);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qb(e),e}throw Qi=t,Fi}}var Qi=null;function Vb(){if(Qi===null)throw Error(a(459));var e=Qi;return Qi=null,e}function qb(e){if(e===Fi||e===Qs)throw Error(a(483))}var qr=!1;function Rf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Yr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xr(e,t,o){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Qe&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Gs(e),Mb(e,null,o),t}return $s(e,i,t,o),Gs(e)}function Zi(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,o|=i,t.lanes=o,Hv(e,o)}}function Af(e,t){var o=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,o===i)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?d=p=j:p=p.next=j,o=o.next}while(o!==null);p===null?d=p=t:p=p.next=t}else d=p=t;o={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:i.shared,callbacks:i.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}var Mf=!1;function Wi(){if(Mf){var e=La;if(e!==null)throw e}}function Ji(e,t,o,i){Mf=!1;var d=e.updateQueue;qr=!1;var p=d.firstBaseUpdate,j=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,W=B.next;B.next=null,j===null?p=W:j.next=W,j=B;var re=e.alternate;re!==null&&(re=re.updateQueue,_=re.lastBaseUpdate,_!==j&&(_===null?re.firstBaseUpdate=W:_.next=W,re.lastBaseUpdate=B))}if(p!==null){var ae=d.baseState;j=0,re=W=B=null,_=p;do{var te=_.lane&-536870913,ne=te!==_.lane;if(ne?(Ge&te)===te:(i&te)===te){te!==0&&te===za&&(Mf=!0),re!==null&&(re=re.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Oe=e,Ee=_;te=t;var et=o;switch(Ee.tag){case 1:if(Oe=Ee.payload,typeof Oe=="function"){ae=Oe.call(et,ae,te);break e}ae=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ee.payload,te=typeof Oe=="function"?Oe.call(et,ae,te):Oe,te==null)break e;ae=b({},ae,te);break e;case 2:qr=!0}}te=_.callback,te!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=d.callbacks,ne===null?d.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:_.tag,payload:_.payload,callback:_.callback,next:null},re===null?(W=re=ne,B=ae):re=re.next=ne,j|=te;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;ne=_,_=ne.next,ne.next=null,d.lastBaseUpdate=ne,d.shared.pending=null}}while(!0);re===null&&(B=ae),d.baseState=B,d.firstBaseUpdate=W,d.lastBaseUpdate=re,p===null&&(d.shared.lanes=0),to|=j,e.lanes=j,e.memoizedState=ae}}function Yb(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Xb(e,t){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)Yb(o[e],t)}var ka=V(null),Ws=V(0);function Kb(e,t){e=Nr,ee(Ws,e),ee(ka,t),Nr=e|t.baseLanes}function _f(){ee(Ws,Nr),ee(ka,ka.current)}function Df(){Nr=Ws.current,K(ka),K(Ws)}var Kr=0,ze=null,We=null,xt=null,Js=!1,Ha=!1,$o=!1,ec=0,el=0,Ba=null,RA=0;function gt(){throw Error(a(321))}function If(e,t){if(t===null)return!1;for(var o=0;o<t.length&&o<e.length;o++)if(!ln(e[o],t[o]))return!1;return!0}function zf(e,t,o,i,d,p){return Kr=p,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Mx:_x,$o=!1,p=o(i,d),$o=!1,Ha&&(p=Qb(t,o,i,d)),Fb(e),p}function Fb(e){k.H=ic;var t=We!==null&&We.next!==null;if(Kr=0,xt=We=ze=null,Js=!1,el=0,Ba=null,t)throw Error(a(300));e===null||Mt||(e=e.dependencies,e!==null&&Xs(e)&&(Mt=!0))}function Qb(e,t,o,i){ze=e;var d=0;do{if(Ha&&(Ba=null),el=0,Ha=!1,25<=d)throw Error(a(301));if(d+=1,xt=We=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}k.H=zA,p=t(o,i)}while(Ha);return p}function NA(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?tl(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(ze.flags|=1024),t}function Lf(){var e=ec!==0;return ec=0,e}function kf(e,t,o){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o}function Hf(e){if(Js){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Js=!1}Kr=0,xt=We=ze=null,Ha=!1,el=ec=0,Ba=null}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ze.memoizedState=xt=e:xt=xt.next=e,xt}function St(){if(We===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=xt===null?ze.memoizedState:xt.next;if(t!==null)xt=t,We=e;else{if(e===null)throw ze.alternate===null?Error(a(467)):Error(a(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},xt===null?ze.memoizedState=xt=e:xt=xt.next=e}return xt}function Bf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(e){var t=el;return el+=1,Ba===null&&(Ba=[]),e=Gb(Ba,e,t),t=ze,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Mx:_x),e}function tc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tl(e);if(e.$$typeof===T)return Gt(e)}throw Error(a(438,String(e)))}function Uf(e){var t=null,o=ze.updateQueue;if(o!==null&&(t=o.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),o===null&&(o=Bf(),ze.updateQueue=o),o.memoCache=t,o=t.data[t.index],o===void 0)for(o=t.data[t.index]=Array(e),i=0;i<e;i++)o[i]=X;return t.index++,o}function wr(e,t){return typeof t=="function"?t(e):t}function nc(e){var t=St();return Pf(t,We,e)}function Pf(e,t,o){var i=e.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=o;var d=e.baseQueue,p=i.pending;if(p!==null){if(d!==null){var j=d.next;d.next=p.next,p.next=j}t.baseQueue=d=p,i.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{t=d.next;var _=j=null,B=null,W=t,re=!1;do{var ae=W.lane&-536870913;if(ae!==W.lane?(Ge&ae)===ae:(Kr&ae)===ae){var te=W.revertLane;if(te===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ae===za&&(re=!0);else if((Kr&te)===te){W=W.next,te===za&&(re=!0);continue}else ae={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},B===null?(_=B=ae,j=p):B=B.next=ae,ze.lanes|=te,to|=te;ae=W.action,$o&&o(p,ae),p=W.hasEagerState?W.eagerState:o(p,ae)}else te={lane:ae,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},B===null?(_=B=te,j=p):B=B.next=te,ze.lanes|=ae,to|=ae;W=W.next}while(W!==null&&W!==t);if(B===null?j=p:B.next=_,!ln(p,e.memoizedState)&&(Mt=!0,re&&(o=La,o!==null)))throw o;e.memoizedState=p,e.baseState=j,e.baseQueue=B,i.lastRenderedState=p}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function $f(e){var t=St(),o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var i=o.dispatch,d=o.pending,p=t.memoizedState;if(d!==null){o.pending=null;var j=d=d.next;do p=e(p,j.action),j=j.next;while(j!==d);ln(p,t.memoizedState)||(Mt=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),o.lastRenderedState=p}return[p,i]}function Zb(e,t,o){var i=ze,d=St(),p=Xe;if(p){if(o===void 0)throw Error(a(407));o=o()}else o=t();var j=!ln((We||d).memoizedState,o);j&&(d.memoizedState=o,Mt=!0),d=d.queue;var _=ex.bind(null,i,d,e);if(nl(2048,8,_,[e]),d.getSnapshot!==t||j||xt!==null&&xt.memoizedState.tag&1){if(i.flags|=2048,Ua(9,rc(),Jb.bind(null,i,d,o,t),null),rt===null)throw Error(a(349));p||(Kr&124)!==0||Wb(i,t,o)}return o}function Wb(e,t,o){e.flags|=16384,e={getSnapshot:t,value:o},t=ze.updateQueue,t===null?(t=Bf(),ze.updateQueue=t,t.stores=[e]):(o=t.stores,o===null?t.stores=[e]:o.push(e))}function Jb(e,t,o,i){t.value=o,t.getSnapshot=i,tx(t)&&nx(e)}function ex(e,t,o){return o(function(){tx(t)&&nx(e)})}function tx(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!ln(e,o)}catch{return!0}}function nx(e){var t=Ma(e,2);t!==null&&hn(t,e,2)}function Gf(e){var t=Jt();if(typeof e=="function"){var o=e;if(e=o(),$o){Re(!0);try{o()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:e},t}function rx(e,t,o,i){return e.baseState=o,Pf(e,We,typeof i=="function"?i:wr)}function AA(e,t,o,i,d){if(ac(e))throw Error(a(485));if(e=t.action,e!==null){var p={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){p.listeners.push(j)}};k.T!==null?o(!0):p.isTransition=!1,i(p),o=t.pending,o===null?(p.next=t.pending=p,ox(t,p)):(p.next=o.next,t.pending=o.next=p)}}function ox(e,t){var o=t.action,i=t.payload,d=e.state;if(t.isTransition){var p=k.T,j={};k.T=j;try{var _=o(d,i),B=k.S;B!==null&&B(j,_),ax(e,t,_)}catch(W){Vf(e,t,W)}finally{k.T=p}}else try{p=o(d,i),ax(e,t,p)}catch(W){Vf(e,t,W)}}function ax(e,t,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(i){ix(e,t,i)},function(i){return Vf(e,t,i)}):ix(e,t,o)}function ix(e,t,o){t.status="fulfilled",t.value=o,lx(t),e.state=o,t=e.pending,t!==null&&(o=t.next,o===t?e.pending=null:(o=o.next,t.next=o,ox(e,o)))}function Vf(e,t,o){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=o,lx(t),t=t.next;while(t!==i)}e.action=null}function lx(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sx(e,t){return t}function cx(e,t){if(Xe){var o=rt.formState;if(o!==null){e:{var i=ze;if(Xe){if(dt){t:{for(var d=dt,p=Xn;d.nodeType!==8;){if(!p){d=null;break t}if(d=kn(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){dt=kn(d.nextSibling),i=d.data==="F!";break e}}Ho(i)}i=!1}i&&(t=o[0])}}return o=Jt(),o.memoizedState=o.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sx,lastRenderedState:t},o.queue=i,o=Rx.bind(null,ze,i),i.dispatch=o,i=Gf(!1),p=Ff.bind(null,ze,!1,i.queue),i=Jt(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,o=AA.bind(null,ze,d,p,o),d.dispatch=o,i.memoizedState=e,[t,o,!1]}function ux(e){var t=St();return dx(t,We,e)}function dx(e,t,o){if(t=Pf(e,t,sx)[0],e=nc(wr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=tl(t)}catch(j){throw j===Fi?Qs:j}else i=t;t=St();var d=t.queue,p=d.dispatch;return o!==t.memoizedState&&(ze.flags|=2048,Ua(9,rc(),MA.bind(null,d,o),null)),[i,p,e]}function MA(e,t){e.action=t}function fx(e){var t=St(),o=We;if(o!==null)return dx(t,o,e);St(),t=t.memoizedState,o=St();var i=o.queue.dispatch;return o.memoizedState=e,[t,i,!1]}function Ua(e,t,o,i){return e={tag:e,create:o,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Bf(),ze.updateQueue=t),o=t.lastEffect,o===null?t.lastEffect=e.next=e:(i=o.next,o.next=e,e.next=i,t.lastEffect=e),e}function rc(){return{destroy:void 0,resource:void 0}}function hx(){return St().memoizedState}function oc(e,t,o,i){var d=Jt();i=i===void 0?null:i,ze.flags|=e,d.memoizedState=Ua(1|t,rc(),o,i)}function nl(e,t,o,i){var d=St();i=i===void 0?null:i;var p=d.memoizedState.inst;We!==null&&i!==null&&If(i,We.memoizedState.deps)?d.memoizedState=Ua(t,p,o,i):(ze.flags|=e,d.memoizedState=Ua(1|t,p,o,i))}function mx(e,t){oc(8390656,8,e,t)}function px(e,t){nl(2048,8,e,t)}function gx(e,t){return nl(4,2,e,t)}function yx(e,t){return nl(4,4,e,t)}function vx(e,t){if(typeof t=="function"){e=e();var o=t(e);return function(){typeof o=="function"?o():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bx(e,t,o){o=o!=null?o.concat([e]):null,nl(4,4,vx.bind(null,t,e),o)}function qf(){}function xx(e,t){var o=St();t=t===void 0?null:t;var i=o.memoizedState;return t!==null&&If(t,i[1])?i[0]:(o.memoizedState=[e,t],e)}function Sx(e,t){var o=St();t=t===void 0?null:t;var i=o.memoizedState;if(t!==null&&If(t,i[1]))return i[0];if(i=e(),$o){Re(!0);try{e()}finally{Re(!1)}}return o.memoizedState=[i,t],i}function Yf(e,t,o){return o===void 0||(Kr&1073741824)!==0?e.memoizedState=t:(e.memoizedState=o,e=E0(),ze.lanes|=e,to|=e,o)}function Cx(e,t,o,i){return ln(o,t)?o:ka.current!==null?(e=Yf(e,o,i),ln(e,t)||(Mt=!0),e):(Kr&42)===0?(Mt=!0,e.memoizedState=o):(e=E0(),ze.lanes|=e,to|=e,t)}function wx(e,t,o,i,d){var p=$.p;$.p=p!==0&&8>p?p:8;var j=k.T,_={};k.T=_,Ff(e,!1,t,o);try{var B=d(),W=k.S;if(W!==null&&W(_,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=OA(B,i);rl(e,t,re,fn(e))}else rl(e,t,i,fn(e))}catch(ae){rl(e,t,{then:function(){},status:"rejected",reason:ae},fn())}finally{$.p=p,k.T=j}}function _A(){}function Xf(e,t,o,i){if(e.tag!==5)throw Error(a(476));var d=Ex(e).queue;wx(e,d,t,L,o===null?_A:function(){return Tx(e),o(i)})}function Ex(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:L},next:null};var o={};return t.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:o},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Tx(e){var t=Ex(e).next.queue;rl(e,t,{},fn())}function Kf(){return Gt(Sl)}function jx(){return St().memoizedState}function Ox(){return St().memoizedState}function DA(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var o=fn();e=Yr(o);var i=Xr(t,e,o);i!==null&&(hn(i,t,o),Zi(i,t,o)),t={cache:Ef()},e.payload=t;return}t=t.return}}function IA(e,t,o){var i=fn();o={lane:i,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},ac(e)?Nx(t,o):(o=mf(e,t,o,i),o!==null&&(hn(o,e,i),Ax(o,t,i)))}function Rx(e,t,o){var i=fn();rl(e,t,o,i)}function rl(e,t,o,i){var d={lane:i,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(ac(e))Nx(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var j=t.lastRenderedState,_=p(j,o);if(d.hasEagerState=!0,d.eagerState=_,ln(_,j))return $s(e,t,d,0),rt===null&&Ps(),!1}catch{}finally{}if(o=mf(e,t,d,i),o!==null)return hn(o,e,i),Ax(o,t,i),!0}return!1}function Ff(e,t,o,i){if(i={lane:2,revertLane:Oh(),action:i,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(a(479))}else t=mf(e,o,i,2),t!==null&&hn(t,e,2)}function ac(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Nx(e,t){Ha=Js=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function Ax(e,t,o){if((o&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,o|=i,t.lanes=o,Hv(e,o)}}var ic={readContext:Gt,use:tc,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt},Mx={readContext:Gt,use:tc,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:mx,useImperativeHandle:function(e,t,o){o=o!=null?o.concat([e]):null,oc(4194308,4,vx.bind(null,t,e),o)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var o=Jt();t=t===void 0?null:t;var i=e();if($o){Re(!0);try{e()}finally{Re(!1)}}return o.memoizedState=[i,t],i},useReducer:function(e,t,o){var i=Jt();if(o!==void 0){var d=o(t);if($o){Re(!0);try{o(t)}finally{Re(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=IA.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:function(e){e=Gf(e);var t=e.queue,o=Rx.bind(null,ze,t);return t.dispatch=o,[e.memoizedState,o]},useDebugValue:qf,useDeferredValue:function(e,t){var o=Jt();return Yf(o,e,t)},useTransition:function(){var e=Gf(!1);return e=wx.bind(null,ze,e.queue,!0,!1),Jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,o){var i=ze,d=Jt();if(Xe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=t(),rt===null)throw Error(a(349));(Ge&124)!==0||Wb(i,t,o)}d.memoizedState=o;var p={value:o,getSnapshot:t};return d.queue=p,mx(ex.bind(null,i,p,e),[e]),i.flags|=2048,Ua(9,rc(),Jb.bind(null,i,p,o,t),null),o},useId:function(){var e=Jt(),t=rt.identifierPrefix;if(Xe){var o=xr,i=br;o=(i&~(1<<32-ye(i)-1)).toString(32)+o,t="«"+t+"R"+o,o=ec++,0<o&&(t+="H"+o.toString(32)),t+="»"}else o=RA++,t="«"+t+"r"+o.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Kf,useFormState:cx,useActionState:cx,useOptimistic:function(e){var t=Jt();t.memoizedState=t.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=o,t=Ff.bind(null,ze,!0,o),o.dispatch=t,[e,t]},useMemoCache:Uf,useCacheRefresh:function(){return Jt().memoizedState=DA.bind(null,ze)}},_x={readContext:Gt,use:tc,useCallback:xx,useContext:Gt,useEffect:px,useImperativeHandle:bx,useInsertionEffect:gx,useLayoutEffect:yx,useMemo:Sx,useReducer:nc,useRef:hx,useState:function(){return nc(wr)},useDebugValue:qf,useDeferredValue:function(e,t){var o=St();return Cx(o,We.memoizedState,e,t)},useTransition:function(){var e=nc(wr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Zb,useId:jx,useHostTransitionStatus:Kf,useFormState:ux,useActionState:ux,useOptimistic:function(e,t){var o=St();return rx(o,We,e,t)},useMemoCache:Uf,useCacheRefresh:Ox},zA={readContext:Gt,use:tc,useCallback:xx,useContext:Gt,useEffect:px,useImperativeHandle:bx,useInsertionEffect:gx,useLayoutEffect:yx,useMemo:Sx,useReducer:$f,useRef:hx,useState:function(){return $f(wr)},useDebugValue:qf,useDeferredValue:function(e,t){var o=St();return We===null?Yf(o,e,t):Cx(o,We.memoizedState,e,t)},useTransition:function(){var e=$f(wr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Zb,useId:jx,useHostTransitionStatus:Kf,useFormState:fx,useActionState:fx,useOptimistic:function(e,t){var o=St();return We!==null?rx(o,We,e,t):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:Uf,useCacheRefresh:Ox},Pa=null,ol=0;function lc(e){var t=ol;return ol+=1,Pa===null&&(Pa=[]),Gb(Pa,e,t)}function al(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sc(e,t){throw t.$$typeof===v?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Dx(e){var t=e._init;return t(e._payload)}function Ix(e){function t(q,P){if(e){var Q=q.deletions;Q===null?(q.deletions=[P],q.flags|=16):Q.push(P)}}function o(q,P){if(!e)return null;for(;P!==null;)t(q,P),P=P.sibling;return null}function i(q){for(var P=new Map;q!==null;)q.key!==null?P.set(q.key,q):P.set(q.index,q),q=q.sibling;return P}function d(q,P){return q=vr(q,P),q.index=0,q.sibling=null,q}function p(q,P,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<P?(q.flags|=67108866,P):Q):(q.flags|=67108866,P)):(q.flags|=1048576,P)}function j(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function _(q,P,Q,oe){return P===null||P.tag!==6?(P=gf(Q,q.mode,oe),P.return=q,P):(P=d(P,Q),P.return=q,P)}function B(q,P,Q,oe){var me=Q.type;return me===y?re(q,P,Q.props.children,oe,Q.key):P!==null&&(P.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===H&&Dx(me)===P.type)?(P=d(P,Q.props),al(P,Q),P.return=q,P):(P=Vs(Q.type,Q.key,Q.props,null,q.mode,oe),al(P,Q),P.return=q,P)}function W(q,P,Q,oe){return P===null||P.tag!==4||P.stateNode.containerInfo!==Q.containerInfo||P.stateNode.implementation!==Q.implementation?(P=yf(Q,q.mode,oe),P.return=q,P):(P=d(P,Q.children||[]),P.return=q,P)}function re(q,P,Q,oe,me){return P===null||P.tag!==7?(P=Io(Q,q.mode,oe,me),P.return=q,P):(P=d(P,Q),P.return=q,P)}function ae(q,P,Q){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=gf(""+P,q.mode,Q),P.return=q,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return Q=Vs(P.type,P.key,P.props,null,q.mode,Q),al(Q,P),Q.return=q,Q;case C:return P=yf(P,q.mode,Q),P.return=q,P;case H:var oe=P._init;return P=oe(P._payload),ae(q,P,Q)}if(Y(P)||F(P))return P=Io(P,q.mode,Q,null),P.return=q,P;if(typeof P.then=="function")return ae(q,lc(P),Q);if(P.$$typeof===T)return ae(q,Ks(q,P),Q);sc(q,P)}return null}function te(q,P,Q,oe){var me=P!==null?P.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return me!==null?null:_(q,P,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===me?B(q,P,Q,oe):null;case C:return Q.key===me?W(q,P,Q,oe):null;case H:return me=Q._init,Q=me(Q._payload),te(q,P,Q,oe)}if(Y(Q)||F(Q))return me!==null?null:re(q,P,Q,oe,null);if(typeof Q.then=="function")return te(q,P,lc(Q),oe);if(Q.$$typeof===T)return te(q,P,Ks(q,Q),oe);sc(q,Q)}return null}function ne(q,P,Q,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return q=q.get(Q)||null,_(P,q,""+oe,me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return q=q.get(oe.key===null?Q:oe.key)||null,B(P,q,oe,me);case C:return q=q.get(oe.key===null?Q:oe.key)||null,W(P,q,oe,me);case H:var Le=oe._init;return oe=Le(oe._payload),ne(q,P,Q,oe,me)}if(Y(oe)||F(oe))return q=q.get(Q)||null,re(P,q,oe,me,null);if(typeof oe.then=="function")return ne(q,P,Q,lc(oe),me);if(oe.$$typeof===T)return ne(q,P,Q,Ks(P,oe),me);sc(P,oe)}return null}function Oe(q,P,Q,oe){for(var me=null,Le=null,xe=P,Te=P=0,Dt=null;xe!==null&&Te<Q.length;Te++){xe.index>Te?(Dt=xe,xe=null):Dt=xe.sibling;var Ye=te(q,xe,Q[Te],oe);if(Ye===null){xe===null&&(xe=Dt);break}e&&xe&&Ye.alternate===null&&t(q,xe),P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye,xe=Dt}if(Te===Q.length)return o(q,xe),Xe&&Lo(q,Te),me;if(xe===null){for(;Te<Q.length;Te++)xe=ae(q,Q[Te],oe),xe!==null&&(P=p(xe,P,Te),Le===null?me=xe:Le.sibling=xe,Le=xe);return Xe&&Lo(q,Te),me}for(xe=i(xe);Te<Q.length;Te++)Dt=ne(xe,q,Te,Q[Te],oe),Dt!==null&&(e&&Dt.alternate!==null&&xe.delete(Dt.key===null?Te:Dt.key),P=p(Dt,P,Te),Le===null?me=Dt:Le.sibling=Dt,Le=Dt);return e&&xe.forEach(function(uo){return t(q,uo)}),Xe&&Lo(q,Te),me}function Ee(q,P,Q,oe){if(Q==null)throw Error(a(151));for(var me=null,Le=null,xe=P,Te=P=0,Dt=null,Ye=Q.next();xe!==null&&!Ye.done;Te++,Ye=Q.next()){xe.index>Te?(Dt=xe,xe=null):Dt=xe.sibling;var uo=te(q,xe,Ye.value,oe);if(uo===null){xe===null&&(xe=Dt);break}e&&xe&&uo.alternate===null&&t(q,xe),P=p(uo,P,Te),Le===null?me=uo:Le.sibling=uo,Le=uo,xe=Dt}if(Ye.done)return o(q,xe),Xe&&Lo(q,Te),me;if(xe===null){for(;!Ye.done;Te++,Ye=Q.next())Ye=ae(q,Ye.value,oe),Ye!==null&&(P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye);return Xe&&Lo(q,Te),me}for(xe=i(xe);!Ye.done;Te++,Ye=Q.next())Ye=ne(xe,q,Te,Ye.value,oe),Ye!==null&&(e&&Ye.alternate!==null&&xe.delete(Ye.key===null?Te:Ye.key),P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye);return e&&xe.forEach(function(LM){return t(q,LM)}),Xe&&Lo(q,Te),me}function et(q,P,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===y&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:e:{for(var me=Q.key;P!==null;){if(P.key===me){if(me=Q.type,me===y){if(P.tag===7){o(q,P.sibling),oe=d(P,Q.props.children),oe.return=q,q=oe;break e}}else if(P.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===H&&Dx(me)===P.type){o(q,P.sibling),oe=d(P,Q.props),al(oe,Q),oe.return=q,q=oe;break e}o(q,P);break}else t(q,P);P=P.sibling}Q.type===y?(oe=Io(Q.props.children,q.mode,oe,Q.key),oe.return=q,q=oe):(oe=Vs(Q.type,Q.key,Q.props,null,q.mode,oe),al(oe,Q),oe.return=q,q=oe)}return j(q);case C:e:{for(me=Q.key;P!==null;){if(P.key===me)if(P.tag===4&&P.stateNode.containerInfo===Q.containerInfo&&P.stateNode.implementation===Q.implementation){o(q,P.sibling),oe=d(P,Q.children||[]),oe.return=q,q=oe;break e}else{o(q,P);break}else t(q,P);P=P.sibling}oe=yf(Q,q.mode,oe),oe.return=q,q=oe}return j(q);case H:return me=Q._init,Q=me(Q._payload),et(q,P,Q,oe)}if(Y(Q))return Oe(q,P,Q,oe);if(F(Q)){if(me=F(Q),typeof me!="function")throw Error(a(150));return Q=me.call(Q),Ee(q,P,Q,oe)}if(typeof Q.then=="function")return et(q,P,lc(Q),oe);if(Q.$$typeof===T)return et(q,P,Ks(q,Q),oe);sc(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,P!==null&&P.tag===6?(o(q,P.sibling),oe=d(P,Q),oe.return=q,q=oe):(o(q,P),oe=gf(Q,q.mode,oe),oe.return=q,q=oe),j(q)):o(q,P)}return function(q,P,Q,oe){try{ol=0;var me=et(q,P,Q,oe);return Pa=null,me}catch(xe){if(xe===Fi||xe===Qs)throw xe;var Le=sn(29,xe,null,q.mode);return Le.lanes=oe,Le.return=q,Le}finally{}}}var $a=Ix(!0),zx=Ix(!1),On=V(null),Kn=null;function Fr(e){var t=e.alternate;ee(Rt,Rt.current&1),ee(On,e),Kn===null&&(t===null||ka.current!==null||t.memoizedState!==null)&&(Kn=e)}function Lx(e){if(e.tag===22){if(ee(Rt,Rt.current),ee(On,e),Kn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Kn=e)}}else Qr()}function Qr(){ee(Rt,Rt.current),ee(On,On.current)}function Er(e){K(On),Kn===e&&(Kn=null),K(Rt)}var Rt=V(0);function cc(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||Bh(o)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Qf(e,t,o,i){t=e.memoizedState,o=o(i,t),o=o==null?t:b({},t,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Zf={enqueueSetState:function(e,t,o){e=e._reactInternals;var i=fn(),d=Yr(i);d.payload=t,o!=null&&(d.callback=o),t=Xr(e,d,i),t!==null&&(hn(t,e,i),Zi(t,e,i))},enqueueReplaceState:function(e,t,o){e=e._reactInternals;var i=fn(),d=Yr(i);d.tag=1,d.payload=t,o!=null&&(d.callback=o),t=Xr(e,d,i),t!==null&&(hn(t,e,i),Zi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var o=fn(),i=Yr(o);i.tag=2,t!=null&&(i.callback=t),t=Xr(e,i,o),t!==null&&(hn(t,e,o),Zi(t,e,o))}};function kx(e,t,o,i,d,p,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,j):t.prototype&&t.prototype.isPureReactComponent?!Pi(o,i)||!Pi(d,p):!0}function Hx(e,t,o,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(o,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(o,i),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function Go(e,t){var o=t;if("ref"in t){o={};for(var i in t)i!=="ref"&&(o[i]=t[i])}if(e=e.defaultProps){o===t&&(o=b({},o));for(var d in e)o[d]===void 0&&(o[d]=e[d])}return o}var uc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Bx(e){uc(e)}function Ux(e){console.error(e)}function Px(e){uc(e)}function dc(e,t){try{var o=e.onUncaughtError;o(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function $x(e,t,o){try{var i=e.onCaughtError;i(o.value,{componentStack:o.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Wf(e,t,o){return o=Yr(o),o.tag=3,o.payload={element:null},o.callback=function(){dc(e,t)},o}function Gx(e){return e=Yr(e),e.tag=3,e}function Vx(e,t,o,i){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;e.payload=function(){return d(p)},e.callback=function(){$x(t,o,i)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){$x(t,o,i),typeof d!="function"&&(no===null?no=new Set([this]):no.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})})}function LA(e,t,o,i,d){if(o.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=o.alternate,t!==null&&Yi(t,o,d,!0),o=On.current,o!==null){switch(o.tag){case 13:return Kn===null?Ch():o.alternate===null&&ft===0&&(ft=3),o.flags&=-257,o.flags|=65536,o.lanes=d,i===Of?o.flags|=16384:(t=o.updateQueue,t===null?o.updateQueue=new Set([i]):t.add(i),Eh(e,i,d)),!1;case 22:return o.flags|=65536,i===Of?o.flags|=16384:(t=o.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},o.updateQueue=t):(o=t.retryQueue,o===null?t.retryQueue=new Set([i]):o.add(i)),Eh(e,i,d)),!1}throw Error(a(435,o.tag))}return Eh(e,i,d),Ch(),!1}if(Xe)return t=On.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==xf&&(e=Error(a(422),{cause:i}),qi(wn(e,o)))):(i!==xf&&(t=Error(a(423),{cause:i}),qi(wn(t,o))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=wn(i,o),d=Wf(e.stateNode,i,d),Af(e,d),ft!==4&&(ft=2)),!1;var p=Error(a(520),{cause:i});if(p=wn(p,o),fl===null?fl=[p]:fl.push(p),ft!==4&&(ft=2),t===null)return!0;i=wn(i,o),o=t;do{switch(o.tag){case 3:return o.flags|=65536,e=d&-d,o.lanes|=e,e=Wf(o.stateNode,i,e),Af(o,e),!1;case 1:if(t=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(no===null||!no.has(p))))return o.flags|=65536,d&=-d,o.lanes|=d,d=Gx(d),Vx(d,e,o,i),Af(o,d),!1}o=o.return}while(o!==null);return!1}var qx=Error(a(461)),Mt=!1;function zt(e,t,o,i){t.child=e===null?zx(t,null,o,i):$a(t,e.child,o,i)}function Yx(e,t,o,i,d){o=o.render;var p=t.ref;if("ref"in i){var j={};for(var _ in i)_!=="ref"&&(j[_]=i[_])}else j=i;return Uo(t),i=zf(e,t,o,j,p,d),_=Lf(),e!==null&&!Mt?(kf(e,t,d),Tr(e,t,d)):(Xe&&_&&vf(t),t.flags|=1,zt(e,t,i,d),t.child)}function Xx(e,t,o,i,d){if(e===null){var p=o.type;return typeof p=="function"&&!pf(p)&&p.defaultProps===void 0&&o.compare===null?(t.tag=15,t.type=p,Kx(e,t,p,i,d)):(e=Vs(o.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!ih(e,d)){var j=p.memoizedProps;if(o=o.compare,o=o!==null?o:Pi,o(j,i)&&e.ref===t.ref)return Tr(e,t,d)}return t.flags|=1,e=vr(p,i),e.ref=t.ref,e.return=t,t.child=e}function Kx(e,t,o,i,d){if(e!==null){var p=e.memoizedProps;if(Pi(p,i)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=i=p,ih(e,d))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Tr(e,t,d)}return Jf(e,t,o,i,d)}function Fx(e,t,o){var i=t.pendingProps,d=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if((t.flags&128)!==0){if(i=p!==null?p.baseLanes|o:o,e!==null){for(d=t.child=e.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;t.childLanes=p&~i}else t.childLanes=0,t.child=null;return Qx(e,t,i,o)}if((o&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fs(t,p!==null?p.cachePool:null),p!==null?Kb(t,p):_f(),Lx(t);else return t.lanes=t.childLanes=536870912,Qx(e,t,p!==null?p.baseLanes|o:o,o)}else p!==null?(Fs(t,p.cachePool),Kb(t,p),Qr(),t.memoizedState=null):(e!==null&&Fs(t,null),_f(),Qr());return zt(e,t,d,o),t.child}function Qx(e,t,o,i){var d=jf();return d=d===null?null:{parent:Ot._currentValue,pool:d},t.memoizedState={baseLanes:o,cachePool:d},e!==null&&Fs(t,null),_f(),Lx(t),e!==null&&Yi(e,t,i,!0),null}function fc(e,t){var o=t.ref;if(o===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(t.flags|=4194816)}}function Jf(e,t,o,i,d){return Uo(t),o=zf(e,t,o,i,void 0,d),i=Lf(),e!==null&&!Mt?(kf(e,t,d),Tr(e,t,d)):(Xe&&i&&vf(t),t.flags|=1,zt(e,t,o,d),t.child)}function Zx(e,t,o,i,d,p){return Uo(t),t.updateQueue=null,o=Qb(t,i,o,d),Fb(e),i=Lf(),e!==null&&!Mt?(kf(e,t,p),Tr(e,t,p)):(Xe&&i&&vf(t),t.flags|=1,zt(e,t,o,p),t.child)}function Wx(e,t,o,i,d){if(Uo(t),t.stateNode===null){var p=_a,j=o.contextType;typeof j=="object"&&j!==null&&(p=Gt(j)),p=new o(i,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Zf,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=i,p.state=t.memoizedState,p.refs={},Rf(t),j=o.contextType,p.context=typeof j=="object"&&j!==null?Gt(j):_a,p.state=t.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&(Qf(t,o,j,i),p.state=t.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(j=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),j!==p.state&&Zf.enqueueReplaceState(p,p.state,null),Ji(t,i,p,d),Wi(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){p=t.stateNode;var _=t.memoizedProps,B=Go(o,_);p.props=B;var W=p.context,re=o.contextType;j=_a,typeof re=="object"&&re!==null&&(j=Gt(re));var ae=o.getDerivedStateFromProps;re=typeof ae=="function"||typeof p.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,re||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(_||W!==j)&&Hx(t,p,i,j),qr=!1;var te=t.memoizedState;p.state=te,Ji(t,i,p,d),Wi(),W=t.memoizedState,_||te!==W||qr?(typeof ae=="function"&&(Qf(t,o,ae,i),W=t.memoizedState),(B=qr||kx(t,o,B,i,te,W,j))?(re||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=W),p.props=i,p.state=W,p.context=j,i=B):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{p=t.stateNode,Nf(e,t),j=t.memoizedProps,re=Go(o,j),p.props=re,ae=t.pendingProps,te=p.context,W=o.contextType,B=_a,typeof W=="object"&&W!==null&&(B=Gt(W)),_=o.getDerivedStateFromProps,(W=typeof _=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j!==ae||te!==B)&&Hx(t,p,i,B),qr=!1,te=t.memoizedState,p.state=te,Ji(t,i,p,d),Wi();var ne=t.memoizedState;j!==ae||te!==ne||qr||e!==null&&e.dependencies!==null&&Xs(e.dependencies)?(typeof _=="function"&&(Qf(t,o,_,i),ne=t.memoizedState),(re=qr||kx(t,o,re,i,te,ne,B)||e!==null&&e.dependencies!==null&&Xs(e.dependencies))?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(i,ne,B),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(i,ne,B)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),p.props=i,p.state=ne,p.context=B,i=re):(typeof p.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),i=!1)}return p=i,fc(e,t),i=(t.flags&128)!==0,p||i?(p=t.stateNode,o=i&&typeof o.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&i?(t.child=$a(t,e.child,null,d),t.child=$a(t,null,o,d)):zt(e,t,o,d),t.memoizedState=p.state,e=t.child):e=Tr(e,t,d),e}function Jx(e,t,o,i){return Vi(),t.flags|=256,zt(e,t,o,i),t.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(e){return{baseLanes:e,cachePool:Ub()}}function nh(e,t,o){return e=e!==null?e.childLanes&~o:0,t&&(e|=Rn),e}function e0(e,t,o){var i=t.pendingProps,d=!1,p=(t.flags&128)!==0,j;if((j=p)||(j=e!==null&&e.memoizedState===null?!1:(Rt.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(d?Fr(t):Qr(),Xe){var _=dt,B;if(B=_){e:{for(B=_,_=Xn;B.nodeType!==8;){if(!_){_=null;break e}if(B=kn(B.nextSibling),B===null){_=null;break e}}_=B}_!==null?(t.memoizedState={dehydrated:_,treeContext:zo!==null?{id:br,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},B=sn(18,null,null,0),B.stateNode=_,B.return=t,t.child=B,Kt=t,dt=null,B=!0):B=!1}B||Ho(t)}if(_=t.memoizedState,_!==null&&(_=_.dehydrated,_!==null))return Bh(_)?t.lanes=32:t.lanes=536870912,null;Er(t)}return _=i.children,i=i.fallback,d?(Qr(),d=t.mode,_=hc({mode:"hidden",children:_},d),i=Io(i,d,o,null),_.return=t,i.return=t,_.sibling=i,t.child=_,d=t.child,d.memoizedState=th(o),d.childLanes=nh(e,j,o),t.memoizedState=eh,i):(Fr(t),rh(t,_))}if(B=e.memoizedState,B!==null&&(_=B.dehydrated,_!==null)){if(p)t.flags&256?(Fr(t),t.flags&=-257,t=oh(e,t,o)):t.memoizedState!==null?(Qr(),t.child=e.child,t.flags|=128,t=null):(Qr(),d=i.fallback,_=t.mode,i=hc({mode:"visible",children:i.children},_),d=Io(d,_,o,null),d.flags|=2,i.return=t,d.return=t,i.sibling=d,t.child=i,$a(t,e.child,null,o),i=t.child,i.memoizedState=th(o),i.childLanes=nh(e,j,o),t.memoizedState=eh,t=d);else if(Fr(t),Bh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var W=j.dgst;j=W,i=Error(a(419)),i.stack="",i.digest=j,qi({value:i,source:null,stack:null}),t=oh(e,t,o)}else if(Mt||Yi(e,t,o,!1),j=(o&e.childLanes)!==0,Mt||j){if(j=rt,j!==null&&(i=o&-o,i=(i&42)!==0?1:Bd(i),i=(i&(j.suspendedLanes|o))!==0?0:i,i!==0&&i!==B.retryLane))throw B.retryLane=i,Ma(e,i),hn(j,e,i),qx;_.data==="$?"||Ch(),t=oh(e,t,o)}else _.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=B.treeContext,dt=kn(_.nextSibling),Kt=t,Xe=!0,ko=null,Xn=!1,e!==null&&(Tn[jn++]=br,Tn[jn++]=xr,Tn[jn++]=zo,br=e.id,xr=e.overflow,zo=t),t=rh(t,i.children),t.flags|=4096);return t}return d?(Qr(),d=i.fallback,_=t.mode,B=e.child,W=B.sibling,i=vr(B,{mode:"hidden",children:i.children}),i.subtreeFlags=B.subtreeFlags&65011712,W!==null?d=vr(W,d):(d=Io(d,_,o,null),d.flags|=2),d.return=t,i.return=t,i.sibling=d,t.child=i,i=d,d=t.child,_=e.child.memoizedState,_===null?_=th(o):(B=_.cachePool,B!==null?(W=Ot._currentValue,B=B.parent!==W?{parent:W,pool:W}:B):B=Ub(),_={baseLanes:_.baseLanes|o,cachePool:B}),d.memoizedState=_,d.childLanes=nh(e,j,o),t.memoizedState=eh,i):(Fr(t),o=e.child,e=o.sibling,o=vr(o,{mode:"visible",children:i.children}),o.return=t,o.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=o,t.memoizedState=null,o)}function rh(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=sn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function oh(e,t,o){return $a(t,e.child,null,o),e=rh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function t0(e,t,o){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Cf(e.return,t,o)}function ah(e,t,o,i,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:o,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=o,p.tailMode=d)}function n0(e,t,o){var i=t.pendingProps,d=i.revealOrder,p=i.tail;if(zt(e,t,i.children,o),i=Rt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&t0(e,o,t);else if(e.tag===19)t0(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(ee(Rt,i),d){case"forwards":for(o=t.child,d=null;o!==null;)e=o.alternate,e!==null&&cc(e)===null&&(d=o),o=o.sibling;o=d,o===null?(d=t.child,t.child=null):(d=o.sibling,o.sibling=null),ah(t,!1,d,o,p);break;case"backwards":for(o=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&cc(e)===null){t.child=d;break}e=d.sibling,d.sibling=o,o=d,d=e}ah(t,!0,o,null,p);break;case"together":ah(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tr(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,(o&t.childLanes)===0)if(e!==null){if(Yi(e,t,o,!1),(o&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,o=vr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=vr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function ih(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xs(e)))}function kA(e,t,o){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),Vr(t,Ot,e.memoizedState.cache),Vi();break;case 27:case 5:de(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:Vr(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Fr(t),t.flags|=128,null):(o&t.child.childLanes)!==0?e0(e,t,o):(Fr(t),e=Tr(e,t,o),e!==null?e.sibling:null);Fr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(o&t.childLanes)!==0,i||(Yi(e,t,o,!1),i=(o&t.childLanes)!==0),d){if(i)return n0(e,t,o);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ee(Rt,Rt.current),i)break;return null;case 22:case 23:return t.lanes=0,Fx(e,t,o);case 24:Vr(t,Ot,e.memoizedState.cache)}return Tr(e,t,o)}function r0(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!ih(e,o)&&(t.flags&128)===0)return Mt=!1,kA(e,t,o);Mt=(e.flags&131072)!==0}else Mt=!1,Xe&&(t.flags&1048576)!==0&&Db(t,Ys,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,d=i._init;if(i=d(i._payload),t.type=i,typeof i=="function")pf(i)?(e=Go(i,e),t.tag=1,t=Wx(null,t,i,e,o)):(t.tag=0,t=Jf(null,t,i,e,o));else{if(i!=null){if(d=i.$$typeof,d===O){t.tag=11,t=Yx(null,t,i,e,o);break e}else if(d===z){t.tag=14,t=Xx(null,t,i,e,o);break e}}throw t=I(i)||i,Error(a(306,t,""))}}return t;case 0:return Jf(e,t,t.type,t.pendingProps,o);case 1:return i=t.type,d=Go(i,t.pendingProps),Wx(e,t,i,d,o);case 3:e:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(a(387));i=t.pendingProps;var p=t.memoizedState;d=p.element,Nf(e,t),Ji(t,i,null,o);var j=t.memoizedState;if(i=j.cache,Vr(t,Ot,i),i!==p.cache&&wf(t,[Ot],o,!0),Wi(),i=j.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=Jx(e,t,i,o);break e}else if(i!==d){d=wn(Error(a(424)),t),qi(d),t=Jx(e,t,i,o);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(dt=kn(e.firstChild),Kt=t,Xe=!0,ko=null,Xn=!0,o=zx(t,null,i,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Vi(),i===d){t=Tr(e,t,o);break e}zt(e,t,i,o)}t=t.child}return t;case 26:return fc(e,t),e===null?(o=lS(t.type,null,t.pendingProps,null))?t.memoizedState=o:Xe||(o=t.type,e=t.pendingProps,i=Oc(ie.current).createElement(o),i[$t]=t,i[Zt]=e,kt(i,o,e),At(i),t.stateNode=i):t.memoizedState=lS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Xe&&(i=t.stateNode=oS(t.type,t.pendingProps,ie.current),Kt=t,Xn=!0,d=dt,ao(t.type)?(Uh=d,dt=kn(i.firstChild)):dt=d),zt(e,t,t.pendingProps.children,o),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((d=i=dt)&&(i=dM(i,t.type,t.pendingProps,Xn),i!==null?(t.stateNode=i,Kt=t,dt=kn(i.firstChild),Xn=!1,d=!0):d=!1),d||Ho(t)),de(t),d=t.type,p=t.pendingProps,j=e!==null?e.memoizedProps:null,i=p.children,Lh(d,p)?i=null:j!==null&&Lh(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=zf(e,t,NA,null,null,o),Sl._currentValue=d),fc(e,t),zt(e,t,i,o),t.child;case 6:return e===null&&Xe&&((e=o=dt)&&(o=fM(o,t.pendingProps,Xn),o!==null?(t.stateNode=o,Kt=t,dt=null,e=!0):e=!1),e||Ho(t)),null;case 13:return e0(e,t,o);case 4:return je(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=$a(t,null,i,o):zt(e,t,i,o),t.child;case 11:return Yx(e,t,t.type,t.pendingProps,o);case 7:return zt(e,t,t.pendingProps,o),t.child;case 8:return zt(e,t,t.pendingProps.children,o),t.child;case 12:return zt(e,t,t.pendingProps.children,o),t.child;case 10:return i=t.pendingProps,Vr(t,t.type,i.value),zt(e,t,i.children,o),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,Uo(t),d=Gt(d),i=i(d),t.flags|=1,zt(e,t,i,o),t.child;case 14:return Xx(e,t,t.type,t.pendingProps,o);case 15:return Kx(e,t,t.type,t.pendingProps,o);case 19:return n0(e,t,o);case 31:return i=t.pendingProps,o=t.mode,i={mode:i.mode,children:i.children},e===null?(o=hc(i,o),o.ref=t.ref,t.child=o,o.return=t,t=o):(o=vr(e.child,i),o.ref=t.ref,t.child=o,o.return=t,t=o),t;case 22:return Fx(e,t,o);case 24:return Uo(t),i=Gt(Ot),e===null?(d=jf(),d===null&&(d=rt,p=Ef(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=o),d=p),t.memoizedState={parent:i,cache:d},Rf(t),Vr(t,Ot,d)):((e.lanes&o)!==0&&(Nf(e,t),Ji(t,null,null,o),Wi()),d=e.memoizedState,p=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Vr(t,Ot,i)):(i=p.cache,Vr(t,Ot,i),i!==d.cache&&wf(t,[Ot],o,!0))),zt(e,t,t.pendingProps.children,o),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function jr(e){e.flags|=4}function o0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fS(t)){if(t=On.current,t!==null&&((Ge&4194048)===Ge?Kn!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||t!==Kn))throw Qi=Of,Pb;e.flags|=8192}}function mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lv():536870912,e.lanes|=t,Ya|=t)}function il(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var i=null;o!==null;)o.alternate!==null&&(i=o),o=o.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,i=0;if(t)for(var d=e.child;d!==null;)o|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)o|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=o,t}function HA(e,t,o){var i=t.pendingProps;switch(bf(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return o=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cr(Ot),be(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Gi(t)?jr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lb())),lt(t),null;case 26:return o=t.memoizedState,e===null?(jr(t),o!==null?(lt(t),o0(t,o)):(lt(t),t.flags&=-16777217)):o?o!==e.memoizedState?(jr(t),lt(t),o0(t,o)):(lt(t),t.flags&=-16777217):(e.memoizedProps!==i&&jr(t),lt(t),t.flags&=-16777217),null;case 27:Se(t),o=ie.current;var d=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return lt(t),null}e=le.current,Gi(t)?Ib(t):(e=oS(d,i,o),t.stateNode=e,jr(t))}return lt(t),null;case 5:if(Se(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return lt(t),null}if(e=le.current,Gi(t))Ib(t);else{switch(d=Oc(ie.current),e){case 1:e=d.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=d.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=d.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?d.createElement("select",{is:i.is}):d.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?d.createElement(o,{is:i.is}):d.createElement(o)}}e[$t]=t,e[Zt]=i;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)e.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=e;e:switch(kt(e,o,i),o){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&jr(t)}}return lt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(a(166));if(e=ie.current,Gi(t)){if(e=t.stateNode,o=t.memoizedProps,i=null,d=Kt,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[$t]=t,e=!!(e.nodeValue===o||i!==null&&i.suppressHydrationWarning===!0||Z0(e.nodeValue,o)),e||Ho(t)}else e=Oc(e).createTextNode(i),e[$t]=t,t.stateNode=e}return lt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Gi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(a(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[$t]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),d=!1}else d=Lb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Er(t),t):(Er(t),null)}if(Er(t),(t.flags&128)!==0)return t.lanes=o,t;if(o=i!==null,e=e!==null&&e.memoizedState!==null,o){i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool);var p=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==d&&(i.flags|=2048)}return o!==e&&o&&(t.child.flags|=8192),mc(t,t.updateQueue),lt(t),null;case 4:return be(),e===null&&Mh(t.stateNode.containerInfo),lt(t),null;case 10:return Cr(t.type),lt(t),null;case 19:if(K(Rt),d=t.memoizedState,d===null)return lt(t),null;if(i=(t.flags&128)!==0,p=d.rendering,p===null)if(i)il(d,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=cc(e),p!==null){for(t.flags|=128,il(d,!1),e=p.updateQueue,t.updateQueue=e,mc(t,e),t.subtreeFlags=0,e=o,o=t.child;o!==null;)_b(o,e),o=o.sibling;return ee(Rt,Rt.current&1|2),t.child}e=e.sibling}d.tail!==null&&jt()>yc&&(t.flags|=128,i=!0,il(d,!1),t.lanes=4194304)}else{if(!i)if(e=cc(p),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,mc(t,e),il(d,!0),d.tail===null&&d.tailMode==="hidden"&&!p.alternate&&!Xe)return lt(t),null}else 2*jt()-d.renderingStartTime>yc&&o!==536870912&&(t.flags|=128,i=!0,il(d,!1),t.lanes=4194304);d.isBackwards?(p.sibling=t.child,t.child=p):(e=d.last,e!==null?e.sibling=p:t.child=p,d.last=p)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=jt(),t.sibling=null,e=Rt.current,ee(Rt,i?e&1|2:e&1),t):(lt(t),null);case 22:case 23:return Er(t),Df(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(o&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),o=t.updateQueue,o!==null&&mc(t,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==o&&(t.flags|=2048),e!==null&&K(Po),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Cr(Ot),lt(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function BA(e,t){switch(bf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cr(Ot),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 13:if(Er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Rt),null;case 4:return be(),null;case 10:return Cr(t.type),null;case 22:case 23:return Er(t),Df(),e!==null&&K(Po),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cr(Ot),null;case 25:return null;default:return null}}function a0(e,t){switch(bf(t),t.tag){case 3:Cr(Ot),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 13:Er(t);break;case 19:K(Rt);break;case 10:Cr(t.type);break;case 22:case 23:Er(t),Df(),e!==null&&K(Po);break;case 24:Cr(Ot)}}function ll(e,t){try{var o=t.updateQueue,i=o!==null?o.lastEffect:null;if(i!==null){var d=i.next;o=d;do{if((o.tag&e)===e){i=void 0;var p=o.create,j=o.inst;i=p(),j.destroy=i}o=o.next}while(o!==d)}}catch(_){tt(t,t.return,_)}}function Zr(e,t,o){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var p=d.next;i=p;do{if((i.tag&e)===e){var j=i.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,d=t;var B=o,W=_;try{W()}catch(re){tt(d,B,re)}}}i=i.next}while(i!==p)}}catch(re){tt(t,t.return,re)}}function i0(e){var t=e.updateQueue;if(t!==null){var o=e.stateNode;try{Xb(t,o)}catch(i){tt(e,e.return,i)}}}function l0(e,t,o){o.props=Go(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(i){tt(e,t,i)}}function sl(e,t){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof o=="function"?e.refCleanup=o(i):o.current=i}}catch(d){tt(e,t,d)}}function Fn(e,t){var o=e.ref,i=e.refCleanup;if(o!==null)if(typeof i=="function")try{i()}catch(d){tt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){tt(e,t,d)}else o.current=null}function s0(e){var t=e.type,o=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":o.autoFocus&&i.focus();break e;case"img":o.src?i.src=o.src:o.srcSet&&(i.srcset=o.srcSet)}}catch(d){tt(e,e.return,d)}}function lh(e,t,o){try{var i=e.stateNode;iM(i,e.type,o,t),i[Zt]=t}catch(d){tt(e,e.return,d)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ao(e.type)||e.tag===4}function sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ao(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ch(e,t,o){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,t):(t=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,t.appendChild(e),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=jc));else if(i!==4&&(i===27&&ao(e.type)&&(o=e.stateNode,t=null),e=e.child,e!==null))for(ch(e,t,o),e=e.sibling;e!==null;)ch(e,t,o),e=e.sibling}function pc(e,t,o){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(i!==4&&(i===27&&ao(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(pc(e,t,o),e=e.sibling;e!==null;)pc(e,t,o),e=e.sibling}function u0(e){var t=e.stateNode,o=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);kt(t,i,o),t[$t]=e,t[Zt]=o}catch(p){tt(e,e.return,p)}}var Or=!1,yt=!1,uh=!1,d0=typeof WeakSet=="function"?WeakSet:Set,_t=null;function UA(e,t){if(e=e.containerInfo,Ih=Dc,e=Cb(e),sf(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var i=o.getSelection&&o.getSelection();if(i&&i.rangeCount!==0){o=i.anchorNode;var d=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var j=0,_=-1,B=-1,W=0,re=0,ae=e,te=null;t:for(;;){for(var ne;ae!==o||d!==0&&ae.nodeType!==3||(_=j+d),ae!==p||i!==0&&ae.nodeType!==3||(B=j+i),ae.nodeType===3&&(j+=ae.nodeValue.length),(ne=ae.firstChild)!==null;)te=ae,ae=ne;for(;;){if(ae===e)break t;if(te===o&&++W===d&&(_=j),te===p&&++re===i&&(B=j),(ne=ae.nextSibling)!==null)break;ae=te,te=ae.parentNode}ae=ne}o=_===-1||B===-1?null:{start:_,end:B}}else o=null}o=o||{start:0,end:0}}else o=null;for(zh={focusedElem:e,selectionRange:o},Dc=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,p=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,o=t,d=p.memoizedProps,p=p.memoizedState,i=o.stateNode;try{var Oe=Go(o.type,d,o.elementType===o.type);e=i.getSnapshotBeforeUpdate(Oe,p),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){tt(o,o.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,o=e.nodeType,o===9)Hh(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function f0(e,t,o){var i=o.flags;switch(o.tag){case 0:case 11:case 15:Wr(e,o),i&4&&ll(5,o);break;case 1:if(Wr(e,o),i&4)if(e=o.stateNode,t===null)try{e.componentDidMount()}catch(j){tt(o,o.return,j)}else{var d=Go(o.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(o,o.return,j)}}i&64&&i0(o),i&512&&sl(o,o.return);break;case 3:if(Wr(e,o),i&64&&(e=o.updateQueue,e!==null)){if(t=null,o.child!==null)switch(o.child.tag){case 27:case 5:t=o.child.stateNode;break;case 1:t=o.child.stateNode}try{Xb(e,t)}catch(j){tt(o,o.return,j)}}break;case 27:t===null&&i&4&&u0(o);case 26:case 5:Wr(e,o),t===null&&i&4&&s0(o),i&512&&sl(o,o.return);break;case 12:Wr(e,o);break;case 13:Wr(e,o),i&4&&p0(e,o),i&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=FA.bind(null,o),hM(e,o))));break;case 22:if(i=o.memoizedState!==null||Or,!i){t=t!==null&&t.memoizedState!==null||yt,d=Or;var p=yt;Or=i,(yt=t)&&!p?Jr(e,o,(o.subtreeFlags&8772)!==0):Wr(e,o),Or=d,yt=p}break;case 30:break;default:Wr(e,o)}}function h0(e){var t=e.alternate;t!==null&&(e.alternate=null,h0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$d(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var at=null,en=!1;function Rr(e,t,o){for(o=o.child;o!==null;)m0(e,t,o),o=o.sibling}function m0(e,t,o){if(se&&typeof se.onCommitFiberUnmount=="function")try{se.onCommitFiberUnmount(mr,o)}catch{}switch(o.tag){case 26:yt||Fn(o,t),Rr(e,t,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:yt||Fn(o,t);var i=at,d=en;ao(o.type)&&(at=o.stateNode,en=!1),Rr(e,t,o),yl(o.stateNode),at=i,en=d;break;case 5:yt||Fn(o,t);case 6:if(i=at,d=en,at=null,Rr(e,t,o),at=i,en=d,at!==null)if(en)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(o.stateNode)}catch(p){tt(o,t,p)}else try{at.removeChild(o.stateNode)}catch(p){tt(o,t,p)}break;case 18:at!==null&&(en?(e=at,nS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Tl(e)):nS(at,o.stateNode));break;case 4:i=at,d=en,at=o.stateNode.containerInfo,en=!0,Rr(e,t,o),at=i,en=d;break;case 0:case 11:case 14:case 15:yt||Zr(2,o,t),yt||Zr(4,o,t),Rr(e,t,o);break;case 1:yt||(Fn(o,t),i=o.stateNode,typeof i.componentWillUnmount=="function"&&l0(o,t,i)),Rr(e,t,o);break;case 21:Rr(e,t,o);break;case 22:yt=(i=yt)||o.memoizedState!==null,Rr(e,t,o),yt=i;break;default:Rr(e,t,o)}}function p0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Tl(e)}catch(o){tt(t,t.return,o)}}function PA(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new d0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new d0),t;default:throw Error(a(435,e.tag))}}function dh(e,t){var o=PA(e);t.forEach(function(i){var d=QA.bind(null,e,i);o.has(i)||(o.add(i),i.then(d,d))})}function cn(e,t){var o=t.deletions;if(o!==null)for(var i=0;i<o.length;i++){var d=o[i],p=e,j=t,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(ao(_.type)){at=_.stateNode,en=!1;break e}break;case 5:at=_.stateNode,en=!1;break e;case 3:case 4:at=_.stateNode.containerInfo,en=!0;break e}_=_.return}if(at===null)throw Error(a(160));m0(p,j,d),at=null,en=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)g0(t,e),t=t.sibling}var Ln=null;function g0(e,t){var o=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(t,e),un(e),i&4&&(Zr(3,e,e.return),ll(3,e),Zr(5,e,e.return));break;case 1:cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),i&64&&Or&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?i:o.concat(i))));break;case 26:var d=Ln;if(cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),i&4){var p=o!==null?o.memoizedState:null;if(i=e.memoizedState,o===null)if(i===null)if(e.stateNode===null){e:{i=e.type,o=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":p=d.getElementsByTagName("title")[0],(!p||p[_i]||p[$t]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(i),d.head.insertBefore(p,d.querySelector("head > title"))),kt(p,i,o),p[$t]=e,At(p),i=p;break e;case"link":var j=uS("link","href",d).get(i+(o.href||""));if(j){for(var _=0;_<j.length;_++)if(p=j[_],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){j.splice(_,1);break t}}p=d.createElement(i),kt(p,i,o),d.head.appendChild(p);break;case"meta":if(j=uS("meta","content",d).get(i+(o.content||""))){for(_=0;_<j.length;_++)if(p=j[_],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){j.splice(_,1);break t}}p=d.createElement(i),kt(p,i,o),d.head.appendChild(p);break;default:throw Error(a(468,i))}p[$t]=e,At(p),i=p}e.stateNode=i}else dS(d,e.type,e.stateNode);else e.stateNode=cS(d,i,e.memoizedProps);else p!==i?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,i===null?dS(d,e.type,e.stateNode):cS(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&lh(e,e.memoizedProps,o.memoizedProps)}break;case 27:cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),o!==null&&i&4&&lh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),e.flags&32){d=e.stateNode;try{Ea(d,"")}catch(ne){tt(e,e.return,ne)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,lh(e,d,o!==null?o.memoizedProps:d)),i&1024&&(uh=!0);break;case 6:if(cn(t,e),un(e),i&4){if(e.stateNode===null)throw Error(a(162));i=e.memoizedProps,o=e.stateNode;try{o.nodeValue=i}catch(ne){tt(e,e.return,ne)}}break;case 3:if(Ac=null,d=Ln,Ln=Rc(t.containerInfo),cn(t,e),Ln=d,un(e),i&4&&o!==null&&o.memoizedState.isDehydrated)try{Tl(t.containerInfo)}catch(ne){tt(e,e.return,ne)}uh&&(uh=!1,y0(e));break;case 4:i=Ln,Ln=Rc(e.stateNode.containerInfo),cn(t,e),un(e),Ln=i;break;case 12:cn(t,e),un(e);break;case 13:cn(t,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(yh=jt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dh(e,i)));break;case 22:d=e.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,W=Or,re=yt;if(Or=W||d,yt=re||B,cn(t,e),yt=re,Or=W,un(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(o===null||B||Or||yt||Vo(e)),o=null,t=e;;){if(t.tag===5||t.tag===26){if(o===null){B=o=t;try{if(p=B.stateNode,d)j=p.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=B.stateNode;var ae=B.memoizedProps.style,te=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;_.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ne){tt(B,B.return,ne)}}}else if(t.tag===6){if(o===null){B=t;try{B.stateNode.nodeValue=d?"":B.memoizedProps}catch(ne){tt(B,B.return,ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;o===t&&(o=null),t=t.return}o===t&&(o=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(o=i.retryQueue,o!==null&&(i.retryQueue=null,dh(e,o))));break;case 19:cn(t,e),un(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dh(e,i)));break;case 30:break;case 21:break;default:cn(t,e),un(e)}}function un(e){var t=e.flags;if(t&2){try{for(var o,i=e.return;i!==null;){if(c0(i)){o=i;break}i=i.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var d=o.stateNode,p=sh(e);pc(e,p,d);break;case 5:var j=o.stateNode;o.flags&32&&(Ea(j,""),o.flags&=-33);var _=sh(e);pc(e,_,j);break;case 3:case 4:var B=o.stateNode.containerInfo,W=sh(e);ch(e,W,B);break;default:throw Error(a(161))}}catch(re){tt(e,e.return,re)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;y0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)f0(e,t.alternate,t),t=t.sibling}function Vo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zr(4,t,t.return),Vo(t);break;case 1:Fn(t,t.return);var o=t.stateNode;typeof o.componentWillUnmount=="function"&&l0(t,t.return,o),Vo(t);break;case 27:yl(t.stateNode);case 26:case 5:Fn(t,t.return),Vo(t);break;case 22:t.memoizedState===null&&Vo(t);break;case 30:Vo(t);break;default:Vo(t)}e=e.sibling}}function Jr(e,t,o){for(o=o&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,p=t,j=p.flags;switch(p.tag){case 0:case 11:case 15:Jr(d,p,o),ll(4,p);break;case 1:if(Jr(d,p,o),i=p,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){tt(i,i.return,W)}if(i=p,d=i.updateQueue,d!==null){var _=i.stateNode;try{var B=d.shared.hiddenCallbacks;if(B!==null)for(d.shared.hiddenCallbacks=null,d=0;d<B.length;d++)Yb(B[d],_)}catch(W){tt(i,i.return,W)}}o&&j&64&&i0(p),sl(p,p.return);break;case 27:u0(p);case 26:case 5:Jr(d,p,o),o&&i===null&&j&4&&s0(p),sl(p,p.return);break;case 12:Jr(d,p,o);break;case 13:Jr(d,p,o),o&&j&4&&p0(d,p);break;case 22:p.memoizedState===null&&Jr(d,p,o),sl(p,p.return);break;case 30:break;default:Jr(d,p,o)}t=t.sibling}}function fh(e,t){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&Xi(o))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xi(e))}function Qn(e,t,o,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)v0(e,t,o,i),t=t.sibling}function v0(e,t,o,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Qn(e,t,o,i),d&2048&&ll(9,t);break;case 1:Qn(e,t,o,i);break;case 3:Qn(e,t,o,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xi(e)));break;case 12:if(d&2048){Qn(e,t,o,i),e=t.stateNode;try{var p=t.memoizedProps,j=p.id,_=p.onPostCommit;typeof _=="function"&&_(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){tt(t,t.return,B)}}else Qn(e,t,o,i);break;case 13:Qn(e,t,o,i);break;case 23:break;case 22:p=t.stateNode,j=t.alternate,t.memoizedState!==null?p._visibility&2?Qn(e,t,o,i):cl(e,t):p._visibility&2?Qn(e,t,o,i):(p._visibility|=2,Ga(e,t,o,i,(t.subtreeFlags&10256)!==0)),d&2048&&fh(j,t);break;case 24:Qn(e,t,o,i),d&2048&&hh(t.alternate,t);break;default:Qn(e,t,o,i)}}function Ga(e,t,o,i,d){for(d=d&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var p=e,j=t,_=o,B=i,W=j.flags;switch(j.tag){case 0:case 11:case 15:Ga(p,j,_,B,d),ll(8,j);break;case 23:break;case 22:var re=j.stateNode;j.memoizedState!==null?re._visibility&2?Ga(p,j,_,B,d):cl(p,j):(re._visibility|=2,Ga(p,j,_,B,d)),d&&W&2048&&fh(j.alternate,j);break;case 24:Ga(p,j,_,B,d),d&&W&2048&&hh(j.alternate,j);break;default:Ga(p,j,_,B,d)}t=t.sibling}}function cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var o=e,i=t,d=i.flags;switch(i.tag){case 22:cl(o,i),d&2048&&fh(i.alternate,i);break;case 24:cl(o,i),d&2048&&hh(i.alternate,i);break;default:cl(o,i)}t=t.sibling}}var ul=8192;function Va(e){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)b0(e),e=e.sibling}function b0(e){switch(e.tag){case 26:Va(e),e.flags&ul&&e.memoizedState!==null&&jM(Ln,e.memoizedState,e.memoizedProps);break;case 5:Va(e);break;case 3:case 4:var t=Ln;Ln=Rc(e.stateNode.containerInfo),Va(e),Ln=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ul,ul=16777216,Va(e),ul=t):Va(e));break;default:Va(e)}}function x0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var i=t[o];_t=i,C0(i,e)}x0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)S0(e),e=e.sibling}function S0(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Zr(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gc(e)):dl(e);break;default:dl(e)}}function gc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var i=t[o];_t=i,C0(i,e)}x0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zr(8,t,t.return),gc(t);break;case 22:o=t.stateNode,o._visibility&2&&(o._visibility&=-3,gc(t));break;default:gc(t)}e=e.sibling}}function C0(e,t){for(;_t!==null;){var o=_t;switch(o.tag){case 0:case 11:case 15:Zr(8,o,t);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var i=o.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Xi(o.memoizedState.cache)}if(i=o.child,i!==null)i.return=o,_t=i;else e:for(o=e;_t!==null;){i=_t;var d=i.sibling,p=i.return;if(h0(i),i===o){_t=null;break e}if(d!==null){d.return=p,_t=d;break e}_t=p}}}var $A={getCacheForType:function(e){var t=Gt(Ot),o=t.data.get(e);return o===void 0&&(o=e(),t.data.set(e,o)),o}},GA=typeof WeakMap=="function"?WeakMap:Map,Qe=0,rt=null,Be=null,Ge=0,Ze=0,dn=null,eo=!1,qa=!1,mh=!1,Nr=0,ft=0,to=0,qo=0,ph=0,Rn=0,Ya=0,fl=null,tn=null,gh=!1,yh=0,yc=1/0,vc=null,no=null,Lt=0,ro=null,Xa=null,Ka=0,vh=0,bh=null,w0=null,hl=0,xh=null;function fn(){if((Qe&2)!==0&&Ge!==0)return Ge&-Ge;if(k.T!==null){var e=za;return e!==0?e:Oh()}return Bv()}function E0(){Rn===0&&(Rn=(Ge&536870912)===0||Xe?Ns():536870912);var e=On.current;return e!==null&&(e.flags|=32),Rn}function hn(e,t,o){(e===rt&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Fa(e,0),oo(e,Ge,Rn,!1)),Mi(e,o),((Qe&2)===0||e!==rt)&&(e===rt&&((Qe&2)===0&&(qo|=o),ft===4&&oo(e,Ge,Rn,!1)),Zn(e))}function T0(e,t,o){if((Qe&6)!==0)throw Error(a(327));var i=!o&&(t&124)===0&&(t&e.expiredLanes)===0||In(e,t),d=i?YA(e,t):wh(e,t,!0),p=i;do{if(d===0){qa&&!i&&oo(e,t,0,!1);break}else{if(o=e.current.alternate,p&&!VA(o)){d=wh(e,t,!1),p=!1;continue}if(d===2){if(p=t,e.errorRecoveryDisabledLanes&p)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var _=e;d=fl;var B=_.current.memoizedState.isDehydrated;if(B&&(Fa(_,j).flags|=256),j=wh(_,j,!1),j!==2){if(mh&&!B){_.errorRecoveryDisabledLanes|=p,qo|=p,d=4;break e}p=tn,tn=d,p!==null&&(tn===null?tn=p:tn.push.apply(tn,p))}d=j}if(p=!1,d!==2)continue}}if(d===1){Fa(e,0),oo(e,t,0,!0);break}e:{switch(i=e,p=d,p){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:oo(i,t,Rn,!eo);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(d=yh+300-jt(),10<d)){if(oo(i,t,Rn,!eo),No(i,0,!0)!==0)break e;i.timeoutHandle=eS(j0.bind(null,i,o,tn,vc,gh,t,Rn,qo,Ya,eo,p,2,-0,0),d);break e}j0(i,o,tn,vc,gh,t,Rn,qo,Ya,eo,p,0,-0,0)}}break}while(!0);Zn(e)}function j0(e,t,o,i,d,p,j,_,B,W,re,ae,te,ne){if(e.timeoutHandle=-1,ae=t.subtreeFlags,(ae&8192||(ae&16785408)===16785408)&&(xl={stylesheets:null,count:0,unsuspend:TM},b0(t),ae=OM(),ae!==null)){e.cancelPendingCommit=ae(D0.bind(null,e,t,p,o,i,d,j,_,B,re,1,te,ne)),oo(e,p,j,!W);return}D0(e,t,p,o,i,d,j,_,B)}function VA(e){for(var t=e;;){var o=t.tag;if((o===0||o===11||o===15)&&t.flags&16384&&(o=t.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var i=0;i<o.length;i++){var d=o[i],p=d.getSnapshot;d=d.value;try{if(!ln(p(),d))return!1}catch{return!1}}if(o=t.child,t.subtreeFlags&16384&&o!==null)o.return=t,t=o;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function oo(e,t,o,i){t&=~ph,t&=~qo,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var p=31-ye(d),j=1<<p;i[p]=-1,d&=~j}o!==0&&kv(e,o,t)}function bc(){return(Qe&6)===0?(ml(0),!1):!0}function Sh(){if(Be!==null){if(Ze===0)var e=Be.return;else e=Be,Sr=Bo=null,Hf(e),Pa=null,ol=0,e=Be;for(;e!==null;)a0(e.alternate,e),e=e.return;Be=null}}function Fa(e,t){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,sM(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Sh(),rt=e,Be=o=vr(e.current,null),Ge=t,Ze=0,dn=null,eo=!1,qa=In(e,t),mh=!1,Ya=Rn=ph=qo=to=ft=0,tn=fl=null,gh=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-ye(i),p=1<<d;t|=e[d],i&=~p}return Nr=t,Ps(),o}function O0(e,t){ze=null,k.H=ic,t===Fi||t===Qs?(t=Vb(),Ze=3):t===Pb?(t=Vb(),Ze=4):Ze=t===qx?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,dn=t,Be===null&&(ft=1,dc(e,wn(t,e.current)))}function R0(){var e=k.H;return k.H=ic,e===null?ic:e}function N0(){var e=k.A;return k.A=$A,e}function Ch(){ft=4,eo||(Ge&4194048)!==Ge&&On.current!==null||(qa=!0),(to&134217727)===0&&(qo&134217727)===0||rt===null||oo(rt,Ge,Rn,!1)}function wh(e,t,o){var i=Qe;Qe|=2;var d=R0(),p=N0();(rt!==e||Ge!==t)&&(vc=null,Fa(e,t)),t=!1;var j=ft;e:do try{if(Ze!==0&&Be!==null){var _=Be,B=dn;switch(Ze){case 8:Sh(),j=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var W=Ze;if(Ze=0,dn=null,Qa(e,_,B,W),o&&qa){j=0;break e}break;default:W=Ze,Ze=0,dn=null,Qa(e,_,B,W)}}qA(),j=ft;break}catch(re){O0(e,re)}while(!0);return t&&e.shellSuspendCounter++,Sr=Bo=null,Qe=i,k.H=d,k.A=p,Be===null&&(rt=null,Ge=0,Ps()),j}function qA(){for(;Be!==null;)A0(Be)}function YA(e,t){var o=Qe;Qe|=2;var i=R0(),d=N0();rt!==e||Ge!==t?(vc=null,yc=jt()+500,Fa(e,t)):qa=In(e,t);e:do try{if(Ze!==0&&Be!==null){t=Be;var p=dn;t:switch(Ze){case 1:Ze=0,dn=null,Qa(e,t,p,1);break;case 2:case 9:if($b(p)){Ze=0,dn=null,M0(t);break}t=function(){Ze!==2&&Ze!==9||rt!==e||(Ze=7),Zn(e)},p.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:$b(p)?(Ze=0,dn=null,M0(t)):(Ze=0,dn=null,Qa(e,t,p,7));break;case 5:var j=null;switch(Be.tag){case 26:j=Be.memoizedState;case 5:case 27:var _=Be;if(!j||fS(j)){Ze=0,dn=null;var B=_.sibling;if(B!==null)Be=B;else{var W=_.return;W!==null?(Be=W,xc(W)):Be=null}break t}}Ze=0,dn=null,Qa(e,t,p,5);break;case 6:Ze=0,dn=null,Qa(e,t,p,6);break;case 8:Sh(),ft=6;break e;default:throw Error(a(462))}}XA();break}catch(re){O0(e,re)}while(!0);return Sr=Bo=null,k.H=i,k.A=d,Qe=o,Be!==null?0:(rt=null,Ge=0,Ps(),ft)}function XA(){for(;Be!==null&&!$e();)A0(Be)}function A0(e){var t=r0(e.alternate,e,Nr);e.memoizedProps=e.pendingProps,t===null?xc(e):Be=t}function M0(e){var t=e,o=t.alternate;switch(t.tag){case 15:case 0:t=Zx(o,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Zx(o,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:Hf(t);default:a0(o,t),t=Be=_b(t,Nr),t=r0(o,t,Nr)}e.memoizedProps=e.pendingProps,t===null?xc(e):Be=t}function Qa(e,t,o,i){Sr=Bo=null,Hf(t),Pa=null,ol=0;var d=t.return;try{if(LA(e,d,t,o,Ge)){ft=1,dc(e,wn(o,e.current)),Be=null;return}}catch(p){if(d!==null)throw Be=d,p;ft=1,dc(e,wn(o,e.current)),Be=null;return}t.flags&32768?(Xe||i===1?e=!0:qa||(Ge&536870912)!==0?e=!1:(eo=e=!0,(i===2||i===9||i===3||i===6)&&(i=On.current,i!==null&&i.tag===13&&(i.flags|=16384))),_0(t,e)):xc(t)}function xc(e){var t=e;do{if((t.flags&32768)!==0){_0(t,eo);return}e=t.return;var o=HA(t.alternate,t,Nr);if(o!==null){Be=o;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);ft===0&&(ft=5)}function _0(e,t){do{var o=BA(e.alternate,e);if(o!==null){o.flags&=32767,Be=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=o}while(e!==null);ft=6,Be=null}function D0(e,t,o,i,d,p,j,_,B){e.cancelPendingCommit=null;do Sc();while(Lt!==0);if((Qe&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(p=t.lanes|t.childLanes,p|=hf,TN(e,o,p,j,_,B),e===rt&&(Be=rt=null,Ge=0),Xa=t,ro=e,Ka=o,vh=p,bh=d,w0=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ZA(an,function(){return H0(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=$.p,$.p=2,j=Qe,Qe|=4;try{UA(e,t,o)}finally{Qe=j,$.p=d,k.T=i}}Lt=1,I0(),z0(),L0()}}function I0(){if(Lt===1){Lt=0;var e=ro,t=Xa,o=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||o){o=k.T,k.T=null;var i=$.p;$.p=2;var d=Qe;Qe|=4;try{g0(t,e);var p=zh,j=Cb(e.containerInfo),_=p.focusedElem,B=p.selectionRange;if(j!==_&&_&&_.ownerDocument&&Sb(_.ownerDocument.documentElement,_)){if(B!==null&&sf(_)){var W=B.start,re=B.end;if(re===void 0&&(re=W),"selectionStart"in _)_.selectionStart=W,_.selectionEnd=Math.min(re,_.value.length);else{var ae=_.ownerDocument||document,te=ae&&ae.defaultView||window;if(te.getSelection){var ne=te.getSelection(),Oe=_.textContent.length,Ee=Math.min(B.start,Oe),et=B.end===void 0?Ee:Math.min(B.end,Oe);!ne.extend&&Ee>et&&(j=et,et=Ee,Ee=j);var q=xb(_,Ee),P=xb(_,et);if(q&&P&&(ne.rangeCount!==1||ne.anchorNode!==q.node||ne.anchorOffset!==q.offset||ne.focusNode!==P.node||ne.focusOffset!==P.offset)){var Q=ae.createRange();Q.setStart(q.node,q.offset),ne.removeAllRanges(),Ee>et?(ne.addRange(Q),ne.extend(P.node,P.offset)):(Q.setEnd(P.node,P.offset),ne.addRange(Q))}}}}for(ae=[],ne=_;ne=ne.parentNode;)ne.nodeType===1&&ae.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ae.length;_++){var oe=ae[_];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Dc=!!Ih,zh=Ih=null}finally{Qe=d,$.p=i,k.T=o}}e.current=t,Lt=2}}function z0(){if(Lt===2){Lt=0;var e=ro,t=Xa,o=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||o){o=k.T,k.T=null;var i=$.p;$.p=2;var d=Qe;Qe|=4;try{f0(e,t.alternate,t)}finally{Qe=d,$.p=i,k.T=o}}Lt=3}}function L0(){if(Lt===4||Lt===3){Lt=0,Dn();var e=ro,t=Xa,o=Ka,i=w0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Lt=5:(Lt=0,Xa=ro=null,k0(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(no=null),Ud(o),t=t.stateNode,se&&typeof se.onCommitFiberRoot=="function")try{se.onCommitFiberRoot(mr,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=$.p,$.p=2,k.T=null;try{for(var p=e.onRecoverableError,j=0;j<i.length;j++){var _=i[j];p(_.value,{componentStack:_.stack})}}finally{k.T=t,$.p=d}}(Ka&3)!==0&&Sc(),Zn(e),d=e.pendingLanes,(o&4194090)!==0&&(d&42)!==0?e===xh?hl++:(hl=0,xh=e):hl=0,ml(0)}}function k0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xi(t)))}function Sc(e){return I0(),z0(),L0(),H0()}function H0(){if(Lt!==5)return!1;var e=ro,t=vh;vh=0;var o=Ud(Ka),i=k.T,d=$.p;try{$.p=32>o?32:o,k.T=null,o=bh,bh=null;var p=ro,j=Ka;if(Lt=0,Xa=ro=null,Ka=0,(Qe&6)!==0)throw Error(a(331));var _=Qe;if(Qe|=4,S0(p.current),v0(p,p.current,j,o),Qe=_,ml(0,!1),se&&typeof se.onPostCommitFiberRoot=="function")try{se.onPostCommitFiberRoot(mr,p)}catch{}return!0}finally{$.p=d,k.T=i,k0(e,t)}}function B0(e,t,o){t=wn(o,t),t=Wf(e.stateNode,t,2),e=Xr(e,t,2),e!==null&&(Mi(e,2),Zn(e))}function tt(e,t,o){if(e.tag===3)B0(e,e,o);else for(;t!==null;){if(t.tag===3){B0(t,e,o);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(no===null||!no.has(i))){e=wn(o,e),o=Gx(2),i=Xr(t,o,2),i!==null&&(Vx(o,i,t,e),Mi(i,2),Zn(i));break}}t=t.return}}function Eh(e,t,o){var i=e.pingCache;if(i===null){i=e.pingCache=new GA;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(o)||(mh=!0,d.add(o),e=KA.bind(null,e,t,o),t.then(e,e))}function KA(e,t,o){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(ft===4||ft===3&&(Ge&62914560)===Ge&&300>jt()-yh?(Qe&2)===0&&Fa(e,0):ph|=o,Ya===Ge&&(Ya=0)),Zn(e)}function U0(e,t){t===0&&(t=Lv()),e=Ma(e,t),e!==null&&(Mi(e,t),Zn(e))}function FA(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),U0(e,o)}function QA(e,t){var o=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(o=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(a(314))}i!==null&&i.delete(t),U0(e,o)}function ZA(e,t){return Ce(e,t)}var Cc=null,Za=null,Th=!1,wc=!1,jh=!1,Yo=0;function Zn(e){e!==Za&&e.next===null&&(Za===null?Cc=Za=e:Za=Za.next=e),wc=!0,Th||(Th=!0,JA())}function ml(e,t){if(!jh&&wc){jh=!0;do for(var o=!1,i=Cc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var p=0;else{var j=i.suspendedLanes,_=i.pingedLanes;p=(1<<31-ye(42|e)+1)-1,p&=d&~(j&~_),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,V0(i,p))}else p=Ge,p=No(i,i===rt?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(p&3)===0||In(i,p)||(o=!0,V0(i,p));i=i.next}while(o);jh=!1}}function WA(){P0()}function P0(){wc=Th=!1;var e=0;Yo!==0&&(lM()&&(e=Yo),Yo=0);for(var t=jt(),o=null,i=Cc;i!==null;){var d=i.next,p=$0(i,t);p===0?(i.next=null,o===null?Cc=d:o.next=d,d===null&&(Za=o)):(o=i,(e!==0||(p&3)!==0)&&(wc=!0)),i=d}ml(e)}function $0(e,t){for(var o=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var j=31-ye(p),_=1<<j,B=d[j];B===-1?((_&o)===0||(_&i)!==0)&&(d[j]=pr(_,t)):B<=t&&(e.expiredLanes|=_),p&=~_}if(t=rt,o=Ge,o=No(e,e===t?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,o===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ae(i),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||In(e,o)){if(t=o&-o,t===e.callbackPriority)return t;switch(i!==null&&Ae(i),Ud(o)){case 2:case 8:o=ut;break;case 32:o=an;break;case 268435456:o=pa;break;default:o=an}return i=G0.bind(null,e),o=Ce(o,i),e.callbackPriority=t,e.callbackNode=o,t}return i!==null&&i!==null&&Ae(i),e.callbackPriority=2,e.callbackNode=null,2}function G0(e,t){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Sc()&&e.callbackNode!==o)return null;var i=Ge;return i=No(e,e===rt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(T0(e,i,t),$0(e,jt()),e.callbackNode!=null&&e.callbackNode===o?G0.bind(null,e):null)}function V0(e,t){if(Sc())return null;T0(e,t,!0)}function JA(){cM(function(){(Qe&6)!==0?Ce(ct,WA):P0()})}function Oh(){return Yo===0&&(Yo=Ns()),Yo}function q0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Is(""+e)}function Y0(e,t){var o=t.ownerDocument.createElement("input");return o.name=t.name,o.value=t.value,e.id&&o.setAttribute("form",e.id),t.parentNode.insertBefore(o,t),e=new FormData(e),o.parentNode.removeChild(o),e}function eM(e,t,o,i,d){if(t==="submit"&&o&&o.stateNode===d){var p=q0((d[Zt]||null).action),j=i.submitter;j&&(t=(t=j[Zt]||null)?q0(t.formAction):j.getAttribute("formAction"),t!==null&&(p=t,j=null));var _=new Hs("action","action",null,i,d);e.push({event:_,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yo!==0){var B=j?Y0(d,j):new FormData(d);Xf(o,{pending:!0,data:B,method:d.method,action:p},null,B)}}else typeof p=="function"&&(_.preventDefault(),B=j?Y0(d,j):new FormData(d),Xf(o,{pending:!0,data:B,method:d.method,action:p},p,B))},currentTarget:d}]})}}for(var Rh=0;Rh<ff.length;Rh++){var Nh=ff[Rh],tM=Nh.toLowerCase(),nM=Nh[0].toUpperCase()+Nh.slice(1);zn(tM,"on"+nM)}zn(Tb,"onAnimationEnd"),zn(jb,"onAnimationIteration"),zn(Ob,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(bA,"onTransitionRun"),zn(xA,"onTransitionStart"),zn(SA,"onTransitionCancel"),zn(Rb,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),Ao("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ao("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ao("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ao("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ao("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ao("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pl));function X0(e,t){t=(t&4)!==0;for(var o=0;o<e.length;o++){var i=e[o],d=i.event;i=i.listeners;e:{var p=void 0;if(t)for(var j=i.length-1;0<=j;j--){var _=i[j],B=_.instance,W=_.currentTarget;if(_=_.listener,B!==p&&d.isPropagationStopped())break e;p=_,d.currentTarget=W;try{p(d)}catch(re){uc(re)}d.currentTarget=null,p=B}else for(j=0;j<i.length;j++){if(_=i[j],B=_.instance,W=_.currentTarget,_=_.listener,B!==p&&d.isPropagationStopped())break e;p=_,d.currentTarget=W;try{p(d)}catch(re){uc(re)}d.currentTarget=null,p=B}}}}function Ue(e,t){var o=t[Pd];o===void 0&&(o=t[Pd]=new Set);var i=e+"__bubble";o.has(i)||(K0(t,e,2,!1),o.add(i))}function Ah(e,t,o){var i=0;t&&(i|=4),K0(o,e,i,t)}var Ec="_reactListening"+Math.random().toString(36).slice(2);function Mh(e){if(!e[Ec]){e[Ec]=!0,Pv.forEach(function(o){o!=="selectionchange"&&(rM.has(o)||Ah(o,!1,e),Ah(o,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ec]||(t[Ec]=!0,Ah("selectionchange",!1,t))}}function K0(e,t,o,i){switch(vS(t)){case 2:var d=AM;break;case 8:d=MM;break;default:d=qh}o=d.bind(null,t,o,e),d=void 0,!Wd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,o,{capture:!0,passive:d}):e.addEventListener(t,o,!0):d!==void 0?e.addEventListener(t,o,{passive:d}):e.addEventListener(t,o,!1)}function _h(e,t,o,i,d){var p=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var j=i.tag;if(j===3||j===4){var _=i.stateNode.containerInfo;if(_===d)break;if(j===4)for(j=i.return;j!==null;){var B=j.tag;if((B===3||B===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;_!==null;){if(j=va(_),j===null)return;if(B=j.tag,B===5||B===6||B===26||B===27){i=p=j;continue e}_=_.parentNode}}i=i.return}tb(function(){var W=p,re=Qd(o),ae=[];e:{var te=Nb.get(e);if(te!==void 0){var ne=Hs,Oe=e;switch(e){case"keypress":if(Ls(o)===0)break e;case"keydown":case"keyup":ne=ZN;break;case"focusin":Oe="focus",ne=nf;break;case"focusout":Oe="blur",ne=nf;break;case"beforeblur":case"afterblur":ne=nf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=ob;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=BN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=eA;break;case Tb:case jb:case Ob:ne=$N;break;case Rb:ne=nA;break;case"scroll":case"scrollend":ne=kN;break;case"wheel":ne=oA;break;case"copy":case"cut":case"paste":ne=VN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=ib;break;case"toggle":case"beforetoggle":ne=iA}var Ee=(t&4)!==0,et=!Ee&&(e==="scroll"||e==="scrollend"),q=Ee?te!==null?te+"Capture":null:te;Ee=[];for(var P=W,Q;P!==null;){var oe=P;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||q===null||(oe=Ii(P,q),oe!=null&&Ee.push(gl(P,oe,Q))),et)break;P=P.return}0<Ee.length&&(te=new ne(te,Oe,null,o,re),ae.push({event:te,listeners:Ee}))}}if((t&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",te&&o!==Fd&&(Oe=o.relatedTarget||o.fromElement)&&(va(Oe)||Oe[ya]))break e;if((ne||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(Oe=o.relatedTarget||o.toElement,ne=W,Oe=Oe?va(Oe):null,Oe!==null&&(et=s(Oe),Ee=Oe.tag,Oe!==et||Ee!==5&&Ee!==27&&Ee!==6)&&(Oe=null)):(ne=null,Oe=W),ne!==Oe)){if(Ee=ob,oe="onMouseLeave",q="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=ib,oe="onPointerLeave",q="onPointerEnter",P="pointer"),et=ne==null?te:Di(ne),Q=Oe==null?te:Di(Oe),te=new Ee(oe,P+"leave",ne,o,re),te.target=et,te.relatedTarget=Q,oe=null,va(re)===W&&(Ee=new Ee(q,P+"enter",Oe,o,re),Ee.target=Q,Ee.relatedTarget=et,oe=Ee),et=oe,ne&&Oe)t:{for(Ee=ne,q=Oe,P=0,Q=Ee;Q;Q=Wa(Q))P++;for(Q=0,oe=q;oe;oe=Wa(oe))Q++;for(;0<P-Q;)Ee=Wa(Ee),P--;for(;0<Q-P;)q=Wa(q),Q--;for(;P--;){if(Ee===q||q!==null&&Ee===q.alternate)break t;Ee=Wa(Ee),q=Wa(q)}Ee=null}else Ee=null;ne!==null&&F0(ae,te,ne,Ee,!1),Oe!==null&&et!==null&&F0(ae,et,Oe,Ee,!0)}}e:{if(te=W?Di(W):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var me=mb;else if(fb(te))if(pb)me=gA;else{me=mA;var Le=hA}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Kd(W.elementType)&&(me=mb):me=pA;if(me&&(me=me(e,W))){hb(ae,me,o,re);break e}Le&&Le(e,te,W),e==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&Xd(te,"number",te.value)}switch(Le=W?Di(W):window,e){case"focusin":(fb(Le)||Le.contentEditable==="true")&&(Ra=Le,cf=W,$i=null);break;case"focusout":$i=cf=Ra=null;break;case"mousedown":uf=!0;break;case"contextmenu":case"mouseup":case"dragend":uf=!1,wb(ae,o,re);break;case"selectionchange":if(vA)break;case"keydown":case"keyup":wb(ae,o,re)}var xe;if(of)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Oa?ub(e,o)&&(Te="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Te="onCompositionStart");Te&&(lb&&o.locale!=="ko"&&(Oa||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Oa&&(xe=nb()):(Gr=re,Jd="value"in Gr?Gr.value:Gr.textContent,Oa=!0)),Le=Tc(W,Te),0<Le.length&&(Te=new ab(Te,e,null,o,re),ae.push({event:Te,listeners:Le}),xe?Te.data=xe:(xe=db(o),xe!==null&&(Te.data=xe)))),(xe=sA?cA(e,o):uA(e,o))&&(Te=Tc(W,"onBeforeInput"),0<Te.length&&(Le=new ab("onBeforeInput","beforeinput",null,o,re),ae.push({event:Le,listeners:Te}),Le.data=xe)),eM(ae,e,W,o,re)}X0(ae,t)})}function gl(e,t,o){return{instance:e,listener:t,currentTarget:o}}function Tc(e,t){for(var o=t+"Capture",i=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=Ii(e,o),d!=null&&i.unshift(gl(e,d,p)),d=Ii(e,t),d!=null&&i.push(gl(e,d,p))),e.tag===3)return i;e=e.return}return[]}function Wa(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function F0(e,t,o,i,d){for(var p=t._reactName,j=[];o!==null&&o!==i;){var _=o,B=_.alternate,W=_.stateNode;if(_=_.tag,B!==null&&B===i)break;_!==5&&_!==26&&_!==27||W===null||(B=W,d?(W=Ii(o,p),W!=null&&j.unshift(gl(o,W,B))):d||(W=Ii(o,p),W!=null&&j.push(gl(o,W,B)))),o=o.return}j.length!==0&&e.push({event:t,listeners:j})}var oM=/\r\n?/g,aM=/\u0000|\uFFFD/g;function Q0(e){return(typeof e=="string"?e:""+e).replace(oM,`
49
+ `).replace(aM,"")}function Z0(e,t){return t=Q0(t),Q0(e)===t}function jc(){}function Je(e,t,o,i,d,p){switch(o){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ea(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ea(e,""+i);break;case"className":Ms(e,"class",i);break;case"tabIndex":Ms(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ms(e,o,i);break;case"style":Jv(e,i,p);break;case"data":if(t!=="object"){Ms(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||o!=="href")){e.removeAttribute(o);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(o);break}i=Is(""+i),e.setAttribute(o,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(o==="formAction"?(t!=="input"&&Je(e,t,"name",d.name,d,null),Je(e,t,"formEncType",d.formEncType,d,null),Je(e,t,"formMethod",d.formMethod,d,null),Je(e,t,"formTarget",d.formTarget,d,null)):(Je(e,t,"encType",d.encType,d,null),Je(e,t,"method",d.method,d,null),Je(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(o);break}i=Is(""+i),e.setAttribute(o,i);break;case"onClick":i!=null&&(e.onclick=jc);break;case"onScroll":i!=null&&Ue("scroll",e);break;case"onScrollEnd":i!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(o=i.__html,o!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}o=Is(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,""+i):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":i===!0?e.setAttribute(o,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,i):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(o,i):e.removeAttribute(o);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(o):e.setAttribute(o,i);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),As(e,"popover",i);break;case"xlinkActuate":gr(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":gr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":gr(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":gr(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":gr(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":gr(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":gr(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":gr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":gr(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":As(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=zN.get(o)||o,As(e,o,i))}}function Dh(e,t,o,i,d,p){switch(o){case"style":Jv(e,i,p);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(o=i.__html,o!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof i=="string"?Ea(e,i):(typeof i=="number"||typeof i=="bigint")&&Ea(e,""+i);break;case"onScroll":i!=null&&Ue("scroll",e);break;case"onScrollEnd":i!=null&&Ue("scrollend",e);break;case"onClick":i!=null&&(e.onclick=jc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$v.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),t=o.slice(2,d?o.length-7:void 0),p=e[Zt]||null,p=p!=null?p[o]:null,typeof p=="function"&&e.removeEventListener(t,p,d),typeof i=="function")){typeof p!="function"&&p!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(t,i,d);break e}o in e?e[o]=i:i===!0?e.setAttribute(o,""):As(e,o,i)}}}function kt(e,t,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var i=!1,d=!1,p;for(p in o)if(o.hasOwnProperty(p)){var j=o[p];if(j!=null)switch(p){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,p,j,o,null)}}d&&Je(e,t,"srcSet",o.srcSet,o,null),i&&Je(e,t,"src",o.src,o,null);return;case"input":Ue("invalid",e);var _=p=j=d=null,B=null,W=null;for(i in o)if(o.hasOwnProperty(i)){var re=o[i];if(re!=null)switch(i){case"name":d=re;break;case"type":j=re;break;case"checked":B=re;break;case"defaultChecked":W=re;break;case"value":p=re;break;case"defaultValue":_=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,t));break;default:Je(e,t,i,re,o,null)}}Fv(e,p,_,B,W,j,d,!1),_s(e);return;case"select":Ue("invalid",e),i=j=p=null;for(d in o)if(o.hasOwnProperty(d)&&(_=o[d],_!=null))switch(d){case"value":p=_;break;case"defaultValue":j=_;break;case"multiple":i=_;default:Je(e,t,d,_,o,null)}t=p,o=j,e.multiple=!!i,t!=null?wa(e,!!i,t,!1):o!=null&&wa(e,!!i,o,!0);return;case"textarea":Ue("invalid",e),p=d=i=null;for(j in o)if(o.hasOwnProperty(j)&&(_=o[j],_!=null))switch(j){case"value":i=_;break;case"defaultValue":d=_;break;case"children":p=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:Je(e,t,j,_,o,null)}Zv(e,i,d,p),_s(e);return;case"option":for(B in o)if(o.hasOwnProperty(B)&&(i=o[B],i!=null))switch(B){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,B,i,o,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(i=0;i<pl.length;i++)Ue(pl[i],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(i=o[W],i!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,W,i,o,null)}return;default:if(Kd(t)){for(re in o)o.hasOwnProperty(re)&&(i=o[re],i!==void 0&&Dh(e,t,re,i,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(i=o[_],i!=null&&Je(e,t,_,i,o,null))}function iM(e,t,o,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,j=null,_=null,B=null,W=null,re=null;for(ne in o){var ae=o[ne];if(o.hasOwnProperty(ne)&&ae!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":B=ae;default:i.hasOwnProperty(ne)||Je(e,t,ne,null,i,ae)}}for(var te in i){var ne=i[te];if(ae=o[te],i.hasOwnProperty(te)&&(ne!=null||ae!=null))switch(te){case"type":p=ne;break;case"name":d=ne;break;case"checked":W=ne;break;case"defaultChecked":re=ne;break;case"value":j=ne;break;case"defaultValue":_=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,t));break;default:ne!==ae&&Je(e,t,te,ne,i,ae)}}Yd(e,j,_,B,W,re,p,d);return;case"select":ne=j=_=te=null;for(p in o)if(B=o[p],o.hasOwnProperty(p)&&B!=null)switch(p){case"value":break;case"multiple":ne=B;default:i.hasOwnProperty(p)||Je(e,t,p,null,i,B)}for(d in i)if(p=i[d],B=o[d],i.hasOwnProperty(d)&&(p!=null||B!=null))switch(d){case"value":te=p;break;case"defaultValue":_=p;break;case"multiple":j=p;default:p!==B&&Je(e,t,d,p,i,B)}t=_,o=j,i=ne,te!=null?wa(e,!!o,te,!1):!!i!=!!o&&(t!=null?wa(e,!!o,t,!0):wa(e,!!o,o?[]:"",!1));return;case"textarea":ne=te=null;for(_ in o)if(d=o[_],o.hasOwnProperty(_)&&d!=null&&!i.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Je(e,t,_,null,i,d)}for(j in i)if(d=i[j],p=o[j],i.hasOwnProperty(j)&&(d!=null||p!=null))switch(j){case"value":te=d;break;case"defaultValue":ne=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(a(91));break;default:d!==p&&Je(e,t,j,d,i,p)}Qv(e,te,ne);return;case"option":for(var Oe in o)if(te=o[Oe],o.hasOwnProperty(Oe)&&te!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:Je(e,t,Oe,null,i,te)}for(B in i)if(te=i[B],ne=o[B],i.hasOwnProperty(B)&&te!==ne&&(te!=null||ne!=null))switch(B){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Je(e,t,B,te,i,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in o)te=o[Ee],o.hasOwnProperty(Ee)&&te!=null&&!i.hasOwnProperty(Ee)&&Je(e,t,Ee,null,i,te);for(W in i)if(te=i[W],ne=o[W],i.hasOwnProperty(W)&&te!==ne&&(te!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,t));break;default:Je(e,t,W,te,i,ne)}return;default:if(Kd(t)){for(var et in o)te=o[et],o.hasOwnProperty(et)&&te!==void 0&&!i.hasOwnProperty(et)&&Dh(e,t,et,void 0,i,te);for(re in i)te=i[re],ne=o[re],!i.hasOwnProperty(re)||te===ne||te===void 0&&ne===void 0||Dh(e,t,re,te,i,ne);return}}for(var q in o)te=o[q],o.hasOwnProperty(q)&&te!=null&&!i.hasOwnProperty(q)&&Je(e,t,q,null,i,te);for(ae in i)te=i[ae],ne=o[ae],!i.hasOwnProperty(ae)||te===ne||te==null&&ne==null||Je(e,t,ae,te,i,ne)}var Ih=null,zh=null;function Oc(e){return e.nodeType===9?e:e.ownerDocument}function W0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function J0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kh=null;function lM(){var e=window.event;return e&&e.type==="popstate"?e===kh?!1:(kh=e,!0):(kh=null,!1)}var eS=typeof setTimeout=="function"?setTimeout:void 0,sM=typeof clearTimeout=="function"?clearTimeout:void 0,tS=typeof Promise=="function"?Promise:void 0,cM=typeof queueMicrotask=="function"?queueMicrotask:typeof tS<"u"?function(e){return tS.resolve(null).then(e).catch(uM)}:eS;function uM(e){setTimeout(function(){throw e})}function ao(e){return e==="head"}function nS(e,t){var o=t,i=0,d=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(0<i&&8>i){o=i;var j=e.ownerDocument;if(o&1&&yl(j.documentElement),o&2&&yl(j.body),o&4)for(o=j.head,yl(o),j=o.firstChild;j;){var _=j.nextSibling,B=j.nodeName;j[_i]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&j.rel.toLowerCase()==="stylesheet"||o.removeChild(j),j=_}}if(d===0){e.removeChild(p),Tl(t);return}d--}else o==="$"||o==="$?"||o==="$!"?d++:i=o.charCodeAt(0)-48;else i=0;o=p}while(o);Tl(t)}function Hh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var o=t;switch(t=t.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Hh(o),$d(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function dM(e,t,o,i){for(;e.nodeType===1;){var d=o;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[_i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function fM(e,t,o){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=kn(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function hM(e,t){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")t();else{var i=function(){t(),o.removeEventListener("DOMContentLoaded",i)};o.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Uh=null;function rS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(t===0)return e;t--}else o==="/$"&&t++}e=e.previousSibling}return null}function oS(e,t,o){switch(t=Oc(o),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function yl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$d(e)}var Nn=new Map,aS=new Set;function Rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ar=$.d;$.d={f:mM,r:pM,D:gM,C:yM,L:vM,m:bM,X:SM,S:xM,M:CM};function mM(){var e=Ar.f(),t=bc();return e||t}function pM(e){var t=ba(e);t!==null&&t.tag===5&&t.type==="form"?Tx(t):Ar.r(e)}var Ja=typeof document>"u"?null:document;function iS(e,t,o){var i=Ja;if(i&&typeof t=="string"&&t){var d=Cn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),aS.has(d)||(aS.add(d),e={rel:e,crossOrigin:o,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),kt(t,"link",e),At(t),i.head.appendChild(t)))}}function gM(e){Ar.D(e),iS("dns-prefetch",e,null)}function yM(e,t){Ar.C(e,t),iS("preconnect",e,t)}function vM(e,t,o){Ar.L(e,t,o);var i=Ja;if(i&&e&&t){var d='link[rel="preload"][as="'+Cn(t)+'"]';t==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+Cn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+Cn(o.imageSizes)+'"]')):d+='[href="'+Cn(e)+'"]';var p=d;switch(t){case"style":p=ei(e);break;case"script":p=ti(e)}Nn.has(p)||(e=b({rel:"preload",href:t==="image"&&o&&o.imageSrcSet?void 0:e,as:t},o),Nn.set(p,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(vl(p))||t==="script"&&i.querySelector(bl(p))||(t=i.createElement("link"),kt(t,"link",e),At(t),i.head.appendChild(t)))}}function bM(e,t){Ar.m(e,t);var o=Ja;if(o&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Cn(i)+'"][href="'+Cn(e)+'"]',p=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ti(e)}if(!Nn.has(p)&&(e=b({rel:"modulepreload",href:e},t),Nn.set(p,e),o.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(bl(p)))return}i=o.createElement("link"),kt(i,"link",e),At(i),o.head.appendChild(i)}}}function xM(e,t,o){Ar.S(e,t,o);var i=Ja;if(i&&e){var d=xa(i).hoistableStyles,p=ei(e);t=t||"default";var j=d.get(p);if(!j){var _={loading:0,preload:null};if(j=i.querySelector(vl(p)))_.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},o),(o=Nn.get(p))&&Ph(e,o);var B=j=i.createElement("link");At(B),kt(B,"link",e),B._p=new Promise(function(W,re){B.onload=W,B.onerror=re}),B.addEventListener("load",function(){_.loading|=1}),B.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Nc(j,t,i)}j={type:"stylesheet",instance:j,count:1,state:_},d.set(p,j)}}}function SM(e,t){Ar.X(e,t);var o=Ja;if(o&&e){var i=xa(o).hoistableScripts,d=ti(e),p=i.get(d);p||(p=o.querySelector(bl(d)),p||(e=b({src:e,async:!0},t),(t=Nn.get(d))&&$h(e,t),p=o.createElement("script"),At(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(d,p))}}function CM(e,t){Ar.M(e,t);var o=Ja;if(o&&e){var i=xa(o).hoistableScripts,d=ti(e),p=i.get(d);p||(p=o.querySelector(bl(d)),p||(e=b({src:e,async:!0,type:"module"},t),(t=Nn.get(d))&&$h(e,t),p=o.createElement("script"),At(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(d,p))}}function lS(e,t,o,i){var d=(d=ie.current)?Rc(d):null;if(!d)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(t=ei(o.href),o=xa(d).hoistableStyles,i=o.get(t),i||(i={type:"style",instance:null,count:0,state:null},o.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=ei(o.href);var p=xa(d).hoistableStyles,j=p.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,j),(p=d.querySelector(vl(e)))&&!p._p&&(j.instance=p,j.state.loading=5),Nn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Nn.set(e,o),p||wM(d,e,o,j.state))),t&&i===null)throw Error(a(528,""));return j}if(t&&i!==null)throw Error(a(529,""));return null;case"script":return t=o.async,o=o.src,typeof o=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ti(o),o=xa(d).hoistableScripts,i=o.get(t),i||(i={type:"script",instance:null,count:0,state:null},o.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function ei(e){return'href="'+Cn(e)+'"'}function vl(e){return'link[rel="stylesheet"]['+e+"]"}function sS(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function wM(e,t,o,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),kt(t,"link",o),At(t),e.head.appendChild(t))}function ti(e){return'[src="'+Cn(e)+'"]'}function bl(e){return"script[async]"+e}function cS(e,t,o){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Cn(o.href)+'"]');if(i)return t.instance=i,At(i),i;var d=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),At(i),kt(i,"style",d),Nc(i,o.precedence,e),t.instance=i;case"stylesheet":d=ei(o.href);var p=e.querySelector(vl(d));if(p)return t.state.loading|=4,t.instance=p,At(p),p;i=sS(o),(d=Nn.get(d))&&Ph(i,d),p=(e.ownerDocument||e).createElement("link"),At(p);var j=p;return j._p=new Promise(function(_,B){j.onload=_,j.onerror=B}),kt(p,"link",i),t.state.loading|=4,Nc(p,o.precedence,e),t.instance=p;case"script":return p=ti(o.src),(d=e.querySelector(bl(p)))?(t.instance=d,At(d),d):(i=o,(d=Nn.get(p))&&(i=b({},o),$h(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),At(d),kt(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Nc(i,o.precedence,e));return t.instance}function Nc(e,t,o){for(var i=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,p=d,j=0;j<i.length;j++){var _=i[j];if(_.dataset.precedence===t)p=_;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=o.nodeType===9?o.head:o,t.insertBefore(e,t.firstChild))}function Ph(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ac=null;function uS(e,t,o){if(Ac===null){var i=new Map,d=Ac=new Map;d.set(o,i)}else d=Ac,i=d.get(o),i||(i=new Map,d.set(o,i));if(i.has(e))return i;for(i.set(e,null),o=o.getElementsByTagName(e),d=0;d<o.length;d++){var p=o[d];if(!(p[_i]||p[$t]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var j=p.getAttribute(t)||"";j=e+j;var _=i.get(j);_?_.push(p):i.set(j,[p])}}return i}function dS(e,t,o){e=e.ownerDocument||e,e.head.insertBefore(o,t==="title"?e.querySelector("head > title"):null)}function EM(e,t,o){if(o===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function fS(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var xl=null;function TM(){}function jM(e,t,o){if(xl===null)throw Error(a(475));var i=xl;if(t.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var d=ei(o.href),p=e.querySelector(vl(d));if(p){e=p._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Mc.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=p,At(p);return}p=e.ownerDocument||e,o=sS(o),(d=Nn.get(d))&&Ph(o,d),p=p.createElement("link"),At(p);var j=p;j._p=new Promise(function(_,B){j.onload=_,j.onerror=B}),kt(p,"link",o),t.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(i.count++,t=Mc.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function OM(){if(xl===null)throw Error(a(475));var e=xl;return e.stylesheets&&e.count===0&&Gh(e,e.stylesheets),0<e.count?function(t){var o=setTimeout(function(){if(e.stylesheets&&Gh(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Mc(){if(this.count--,this.count===0){if(this.stylesheets)Gh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function Gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(RM,e),_c=null,Mc.call(e))}function RM(e,t){if(!(t.state.loading&4)){var o=_c.get(e);if(o)var i=o.get(null);else{o=new Map,_c.set(e,o);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var j=d[p];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),i=j)}i&&o.set(null,i)}d=t.instance,j=d.getAttribute("data-precedence"),p=o.get(j)||i,p===i&&o.set(null,d),o.set(j,d),this.count++,i=Mc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Sl={$$typeof:T,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function NM(e,t,o,i,d,p,j,_){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Hd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hd(0),this.hiddenUpdates=Hd(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function hS(e,t,o,i,d,p,j,_,B,W,re,ae){return e=new NM(e,t,o,j,_,B,W,ae),t=1,p===!0&&(t|=24),p=sn(3,null,null,t),e.current=p,p.stateNode=e,t=Ef(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:i,isDehydrated:o,cache:t},Rf(p),e}function mS(e){return e?(e=_a,e):_a}function pS(e,t,o,i,d,p){d=mS(d),i.context===null?i.context=d:i.pendingContext=d,i=Yr(t),i.payload={element:o},p=p===void 0?null:p,p!==null&&(i.callback=p),o=Xr(e,i,t),o!==null&&(hn(o,e,t),Zi(o,e,t))}function gS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<t?o:t}}function Vh(e,t){gS(e,t),(e=e.alternate)&&gS(e,t)}function yS(e){if(e.tag===13){var t=Ma(e,67108864);t!==null&&hn(t,e,67108864),Vh(e,67108864)}}var Dc=!0;function AM(e,t,o,i){var d=k.T;k.T=null;var p=$.p;try{$.p=2,qh(e,t,o,i)}finally{$.p=p,k.T=d}}function MM(e,t,o,i){var d=k.T;k.T=null;var p=$.p;try{$.p=8,qh(e,t,o,i)}finally{$.p=p,k.T=d}}function qh(e,t,o,i){if(Dc){var d=Yh(i);if(d===null)_h(e,t,i,Ic,o),bS(e,i);else if(DM(d,e,t,o,i))i.stopPropagation();else if(bS(e,i),t&4&&-1<_M.indexOf(e)){for(;d!==null;){var p=ba(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var j=Yn(p.pendingLanes);if(j!==0){var _=p;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var B=1<<31-ye(j);_.entanglements[1]|=B,j&=~B}Zn(p),(Qe&6)===0&&(yc=jt()+500,ml(0))}}break;case 13:_=Ma(p,2),_!==null&&hn(_,p,2),bc(),Vh(p,2)}if(p=Yh(i),p===null&&_h(e,t,i,Ic,o),p===d)break;d=p}d!==null&&i.stopPropagation()}else _h(e,t,i,null,o)}}function Yh(e){return e=Qd(e),Xh(e)}var Ic=null;function Xh(e){if(Ic=null,e=va(e),e!==null){var t=s(e);if(t===null)e=null;else{var o=t.tag;if(o===13){if(e=u(t),e!==null)return e;e=null}else if(o===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ic=e,null}function vS(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pe()){case ct:return 2;case ut:return 8;case an:case hr:return 32;case pa:return 268435456;default:return 32}default:return 32}}var Kh=!1,io=null,lo=null,so=null,Cl=new Map,wl=new Map,co=[],_M="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bS(e,t){switch(e){case"focusin":case"focusout":io=null;break;case"dragenter":case"dragleave":lo=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":Cl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function El(e,t,o,i,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:o,eventSystemFlags:i,nativeEvent:p,targetContainers:[d]},t!==null&&(t=ba(t),t!==null&&yS(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function DM(e,t,o,i,d){switch(t){case"focusin":return io=El(io,e,t,o,i,d),!0;case"dragenter":return lo=El(lo,e,t,o,i,d),!0;case"mouseover":return so=El(so,e,t,o,i,d),!0;case"pointerover":var p=d.pointerId;return Cl.set(p,El(Cl.get(p)||null,e,t,o,i,d)),!0;case"gotpointercapture":return p=d.pointerId,wl.set(p,El(wl.get(p)||null,e,t,o,i,d)),!0}return!1}function xS(e){var t=va(e.target);if(t!==null){var o=s(t);if(o!==null){if(t=o.tag,t===13){if(t=u(o),t!==null){e.blockedOn=t,jN(e.priority,function(){if(o.tag===13){var i=fn();i=Bd(i);var d=Ma(o,i);d!==null&&hn(d,o,i),Vh(o,i)}});return}}else if(t===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var o=Yh(e.nativeEvent);if(o===null){o=e.nativeEvent;var i=new o.constructor(o.type,o);Fd=i,o.target.dispatchEvent(i),Fd=null}else return t=ba(o),t!==null&&yS(t),e.blockedOn=o,!1;t.shift()}return!0}function SS(e,t,o){zc(e)&&o.delete(t)}function IM(){Kh=!1,io!==null&&zc(io)&&(io=null),lo!==null&&zc(lo)&&(lo=null),so!==null&&zc(so)&&(so=null),Cl.forEach(SS),wl.forEach(SS)}function Lc(e,t){e.blockedOn===t&&(e.blockedOn=null,Kh||(Kh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,IM)))}var kc=null;function CS(e){kc!==e&&(kc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){kc===e&&(kc=null);for(var t=0;t<e.length;t+=3){var o=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(Xh(i||o)===null)continue;break}var p=ba(o);p!==null&&(e.splice(t,3),t-=3,Xf(p,{pending:!0,data:d,method:o.method,action:i},i,d))}}))}function Tl(e){function t(B){return Lc(B,e)}io!==null&&Lc(io,e),lo!==null&&Lc(lo,e),so!==null&&Lc(so,e),Cl.forEach(t),wl.forEach(t);for(var o=0;o<co.length;o++){var i=co[o];i.blockedOn===e&&(i.blockedOn=null)}for(;0<co.length&&(o=co[0],o.blockedOn===null);)xS(o),o.blockedOn===null&&co.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(i=0;i<o.length;i+=3){var d=o[i],p=o[i+1],j=d[Zt]||null;if(typeof p=="function")j||CS(o);else if(j){var _=null;if(p&&p.hasAttribute("formAction")){if(d=p,j=p[Zt]||null)_=j.formAction;else if(Xh(d)!==null)continue}else _=j.action;typeof _=="function"?o[i+1]=_:(o.splice(i,3),i-=3),CS(o)}}}function Fh(e){this._internalRoot=e}Hc.prototype.render=Fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var o=t.current,i=fn();pS(o,i,e,t,null,null)},Hc.prototype.unmount=Fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pS(e.current,2,null,e,null,null),bc(),t[ya]=null}};function Hc(e){this._internalRoot=e}Hc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bv();e={blockedOn:null,target:e,priority:t};for(var o=0;o<co.length&&t!==0&&t<co[o].priority;o++);co.splice(o,0,e),o===0&&xS(e)}};var wS=r.version;if(wS!=="19.1.1")throw Error(a(527,wS,"19.1.1"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=g(t),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var zM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{mr=Bc.inject(zM),se=Bc}catch{}}return mi.createRoot=function(e,t){if(!c(e))throw Error(a(299));var o=!1,i="",d=Bx,p=Ux,j=Px,_=null;return t!=null&&(t.unstable_strictMode===!0&&(o=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(_=t.unstable_transitionCallbacks)),t=hS(e,1,!1,null,null,o,i,d,p,j,_,null),e[ya]=t.current,Mh(e),new Fh(t)},mi.hydrateRoot=function(e,t,o){if(!c(e))throw Error(a(299));var i=!1,d="",p=Bx,j=Ux,_=Px,B=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(i=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(B=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),t=hS(e,1,!0,t,o??null,i,d,p,j,_,B,W),t.context=mS(null),o=t.current,i=fn(),i=Bd(i),d=Yr(i),d.callback=null,Xr(o,d,i),o=i,t.current.lanes=o,Mi(t,o),Zn(t),e[ya]=t.current,Mh(e),new Hc(t)},mi.version="19.1.1",mi}var Em;function gC(){if(Em)return uu.exports;Em=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),uu.exports=pC(),uu.exports}var yC=gC(),Dr=Cm();function Tm(n){var r,l,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(r=0;r<c;r++)n[r]&&(l=Tm(n[r]))&&(a&&(a+=" "),a+=l)}else for(l in n)n[l]&&(a&&(a+=" "),a+=l);return a}function jm(){for(var n,r,l=0,a="",c=arguments.length;l<c;l++)(n=arguments[l])&&(r=Tm(n))&&(a&&(a+=" "),a+=r);return a}const vC=(n,r)=>{const l=new Array(n.length+r.length);for(let a=0;a<n.length;a++)l[a]=n[a];for(let a=0;a<r.length;a++)l[n.length+a]=r[a];return l},bC=(n,r)=>({classGroupId:n,validator:r}),Om=(n=new Map,r=null,l)=>({nextPart:n,validators:r,classGroupId:l}),Ll="-",Rm=[],xC="arbitrary..",SC=n=>{const r=wC(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:a}=n;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return CC(u);const h=u.split(Ll),g=h[0]===""&&h.length>1?1:0;return Nm(h,g,r)},getConflictingClassGroupIds:(u,h)=>{if(h){const g=a[u],m=l[u];return g?m?vC(m,g):g:m||Rm}return l[u]||Rm}}},Nm=(n,r,l)=>{if(n.length-r===0)return l.classGroupId;const c=n[r],s=l.nextPart.get(c);if(s){const m=Nm(n,r+1,s);if(m)return m}const u=l.validators;if(u===null)return;const h=r===0?n.join(Ll):n.slice(r).join(Ll),g=u.length;for(let m=0;m<g;m++){const b=u[m];if(b.validator(h))return b.classGroupId}},CC=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),l=r.indexOf(":"),a=r.slice(0,l);return a?xC+a:void 0})(),wC=n=>{const{theme:r,classGroups:l}=n;return EC(l,r)},EC=(n,r)=>{const l=Om();for(const a in n){const c=n[a];mu(c,l,a,r)}return l},mu=(n,r,l,a)=>{const c=n.length;for(let s=0;s<c;s++){const u=n[s];TC(u,r,l,a)}},TC=(n,r,l,a)=>{if(typeof n=="string"){jC(n,r,l);return}if(typeof n=="function"){OC(n,r,l,a);return}RC(n,r,l,a)},jC=(n,r,l)=>{const a=n===""?r:Am(r,n);a.classGroupId=l},OC=(n,r,l,a)=>{if(NC(n)){mu(n(a),r,l,a);return}r.validators===null&&(r.validators=[]),r.validators.push(bC(l,n))},RC=(n,r,l,a)=>{const c=Object.entries(n),s=c.length;for(let u=0;u<s;u++){const[h,g]=c[u];mu(g,Am(r,h),l,a)}},Am=(n,r)=>{let l=n;const a=r.split(Ll),c=a.length;for(let s=0;s<c;s++){const u=a[s];let h=l.nextPart.get(u);h||(h=Om(),l.nextPart.set(u,h)),l=h}return l},NC=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,AC=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,l=Object.create(null),a=Object.create(null);const c=(s,u)=>{l[s]=u,r++,r>n&&(r=0,a=l,l=Object.create(null))};return{get(s){let u=l[s];if(u!==void 0)return u;if((u=a[s])!==void 0)return c(s,u),u},set(s,u){s in l?l[s]=u:c(s,u)}}},pu="!",Mm=":",MC=[],_m=(n,r,l,a,c)=>({modifiers:n,hasImportantModifier:r,baseClassName:l,maybePostfixModifierPosition:a,isExternal:c}),_C=n=>{const{prefix:r,experimentalParseClassName:l}=n;let a=c=>{const s=[];let u=0,h=0,g=0,m;const b=c.length;for(let S=0;S<b;S++){const E=c[S];if(u===0&&h===0){if(E===Mm){s.push(c.slice(g,S)),g=S+1;continue}if(E==="/"){m=S;continue}}E==="["?u++:E==="]"?u--:E==="("?h++:E===")"&&h--}const v=s.length===0?c:c.slice(g);let w=v,C=!1;v.endsWith(pu)?(w=v.slice(0,-1),C=!0):v.startsWith(pu)&&(w=v.slice(1),C=!0);const y=m&&m>g?m-g:void 0;return _m(s,C,w,y)};if(r){const c=r+Mm,s=a;a=u=>u.startsWith(c)?s(u.slice(c.length)):_m(MC,!1,u,void 0,!0)}if(l){const c=a;a=s=>l({className:s,parseClassName:c})}return a},DC=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((l,a)=>{r.set(l,1e6+a)}),l=>{const a=[];let c=[];for(let s=0;s<l.length;s++){const u=l[s],h=u[0]==="[",g=r.has(u);h||g?(c.length>0&&(c.sort(),a.push(...c),c=[]),a.push(u)):c.push(u)}return c.length>0&&(c.sort(),a.push(...c)),a}},IC=n=>({cache:AC(n.cacheSize),parseClassName:_C(n),sortModifiers:DC(n),postfixLookupClassGroupIds:zC(n),...SC(n)}),zC=n=>{const r=Object.create(null),l=n.postfixLookupClassGroups;if(l)for(let a=0;a<l.length;a++)r[l[a]]=!0;return r},LC=/\s+/,kC=(n,r)=>{const{parseClassName:l,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:s,postfixLookupClassGroupIds:u}=r,h=[],g=n.trim().split(LC);let m="";for(let b=g.length-1;b>=0;b-=1){const v=g[b],{isExternal:w,modifiers:C,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:E}=l(v);if(w){m=v+(m.length>0?" "+m:m);continue}let R=!!E,N;if(R){const z=S.substring(0,E);N=a(z);const H=N&&u[N]?a(S):void 0;H&&H!==N&&(N=H,R=!1)}else N=a(S);if(!N){if(!R){m=v+(m.length>0?" "+m:m);continue}if(N=a(S),!N){m=v+(m.length>0?" "+m:m);continue}R=!1}const T=C.length===0?"":C.length===1?C[0]:s(C).join(":"),O=y?T+pu:T,D=O+N;if(h.indexOf(D)>-1)continue;h.push(D);const M=c(N,R);for(let z=0;z<M.length;++z){const H=M[z];h.push(O+H)}m=v+(m.length>0?" "+m:m)}return m},HC=(...n)=>{let r=0,l,a,c="";for(;r<n.length;)(l=n[r++])&&(a=Dm(l))&&(c&&(c+=" "),c+=a);return c},Dm=n=>{if(typeof n=="string")return n;let r,l="";for(let a=0;a<n.length;a++)n[a]&&(r=Dm(n[a]))&&(l&&(l+=" "),l+=r);return l},BC=(n,...r)=>{let l,a,c,s;const u=g=>{const m=r.reduce((b,v)=>v(b),n());return l=IC(m),a=l.cache.get,c=l.cache.set,s=h,h(g)},h=g=>{const m=a(g);if(m)return m;const b=kC(g,l);return c(g,b),b};return s=u,(...g)=>s(HC(...g))},UC=[],wt=n=>{const r=l=>l[n]||UC;return r.isThemeGetter=!0,r.themeKey=n,r},Im=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zm=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,qC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ir=n=>PC.test(n),De=n=>!!n&&!Number.isNaN(Number(n)),Pn=n=>!!n&&Number.isInteger(Number(n)),gu=n=>n.endsWith("%")&&De(n.slice(0,-1)),Jn=n=>$C.test(n),Lm=()=>!0,XC=n=>GC.test(n)&&!VC.test(n),yu=()=>!1,KC=n=>qC.test(n),FC=n=>YC.test(n),QC=n=>!fe(n)&&!he(n),ZC=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),WC=n=>zr(n,$m,yu),fe=n=>Im.test(n),go=n=>zr(n,Gm,XC),km=n=>zr(n,i1,De),JC=n=>zr(n,qm,Lm),e1=n=>zr(n,Vm,yu),Hm=n=>zr(n,Um,yu),t1=n=>zr(n,Pm,FC),kl=n=>zr(n,Ym,KC),he=n=>zm.test(n),pi=n=>yo(n,Gm),n1=n=>yo(n,Vm),Bm=n=>yo(n,Um),r1=n=>yo(n,$m),o1=n=>yo(n,Pm),Hl=n=>yo(n,Ym,!0),a1=n=>yo(n,qm,!0),zr=(n,r,l)=>{const a=Im.exec(n);return a?a[1]?r(a[1]):l(a[2]):!1},yo=(n,r,l=!1)=>{const a=zm.exec(n);return a?a[1]?r(a[1]):l:!1},Um=n=>n==="position"||n==="percentage",Pm=n=>n==="image"||n==="url",$m=n=>n==="length"||n==="size"||n==="bg-size",Gm=n=>n==="length",i1=n=>n==="number",Vm=n=>n==="family-name",qm=n=>n==="number"||n==="weight",Ym=n=>n==="shadow",l1=BC(()=>{const n=wt("color"),r=wt("font"),l=wt("text"),a=wt("font-weight"),c=wt("tracking"),s=wt("leading"),u=wt("breakpoint"),h=wt("container"),g=wt("spacing"),m=wt("radius"),b=wt("shadow"),v=wt("inset-shadow"),w=wt("text-shadow"),C=wt("drop-shadow"),y=wt("blur"),S=wt("perspective"),E=wt("aspect"),R=wt("ease"),N=wt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...O(),he,fe],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],H=()=>[he,fe,g],G=()=>[Ir,"full","auto",...H()],X=()=>[Pn,"none","subgrid",he,fe],U=()=>["auto",{span:["full",Pn,he,fe]},Pn,he,fe],F=()=>[Pn,"auto",he,fe],J=()=>["auto","min","max","fr",he,fe],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...H()],$=()=>[Ir,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],L=()=>[h,Ir,"screen","full","dvw","lvw","svw","min","max","fit",...H()],Z=()=>[Ir,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],A=()=>[n,he,fe],V=()=>[...O(),Bm,Hm,{position:[he,fe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",r1,WC,{size:[he,fe]}],le=()=>[gu,pi,go],ce=()=>["","none","full",m,he,fe],ie=()=>["",De,pi,go],ge=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[De,gu,Bm,Hm],de=()=>["","none",y,he,fe],Se=()=>["none",De,he,fe],_e=()=>["none",De,he,fe],Ce=()=>[De,he,fe],Ae=()=>[Ir,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jn],breakpoint:[Jn],color:[Lm],container:[Jn],"drop-shadow":[Jn],ease:["in","out","in-out"],font:[QC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jn],shadow:[Jn],spacing:["px",De],text:[Jn],"text-shadow":[Jn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ir,fe,he,E]}],container:["container"],"container-type":[{"@container":["","normal","size",he,fe]}],"container-named":[ZC],columns:[{columns:[De,"auto",fe,he,h]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[Pn,"auto",he,fe]}],basis:[{basis:[Ir,"full","auto",h,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ir,"auto","initial","none",fe]}],grow:[{grow:["",De,he,fe]}],shrink:[{shrink:["",De,he,fe]}],order:[{order:[Pn,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[h,"screen",...$()]}],"min-w":[{"min-w":[h,"screen","none",...$()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",l,pi,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,a1,JC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gu,fe]}],"font-family":[{font:[n1,e1,r]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,he,fe]}],"line-clamp":[{"line-clamp":[De,"none",he,km]}],leading:[{leading:["none",s,...H()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",he,go]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[De,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"tab-size":[{tab:[Pn,he,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pn,he,fe],radial:["",he,fe],conic:["",Pn,he,fe]},o1,t1]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,he,fe]}],"outline-w":[{outline:["",De,pi,go]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","inner","none",b,Hl,kl]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,Hl,kl]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[De,go]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",w,Hl,kl]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[De,he,fe]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:de()}],brightness:[{brightness:[De,he,fe]}],contrast:[{contrast:[De,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",C,Hl,kl]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",De,he,fe]}],"hue-rotate":[{"hue-rotate":[De,he,fe]}],invert:[{invert:["",De,he,fe]}],saturate:[{saturate:[De,he,fe]}],sepia:[{sepia:["",De,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[De,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[De,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",De,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[De,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[De,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",De,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",he,fe]}],ease:[{ease:["linear","initial",R,he,fe]}],delay:[{delay:[De,he,fe]}],animate:[{animate:["none",N,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,he,fe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],zoom:[{zoom:[Pn,he,fe]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[De,pi,go,km]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...n){return l1(jm(n))}var s1=Object.defineProperty,vu=(n,r)=>s1(n,"name",{value:r,configurable:!0});function bu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}vu(bu,"setRef");function Xm(...n){return r=>{let l=!1;const a=n.map(c=>{const s=bu(c,r);return!l&&typeof s=="function"&&(l=!0),s});if(l)return()=>{for(let c=0;c<a.length;c++){const s=a[c];typeof s=="function"?s():bu(n[c],null)}}}}vu(Xm,"composeRefs");function Ie(...n){return x.useCallback(Xm(...n),n)}vu(Ie,"useComposedRefs");var c1=Object.defineProperty,nn=(n,r)=>c1(n,"name",{value:r,configurable:!0});function er(n){const r=x.forwardRef((l,a)=>{let{children:c,...s}=l,u=null,h=!1;const g=[];c=ep(c),x.Children.forEach(c,w=>{if(Wm(w)){h=!0;const C=w;let y="child"in C.props?C.props.child:C.props.children;for(;xu(y)&&typeof Bl=="function";)y=Bl(y._payload);u=d1(C,y),g.push(u?.props?.children)}else g.push(w)}),u?u=x.cloneElement(u,void 0,g):!h&&x.Children.count(c)===1&&x.isValidElement(c)&&(u=c);const m=u?Zm(u):void 0,b=Ie(a,m);if(!u){if(c||c===0)throw new Error(h?m1(n):h1(n));return c}const v=Qm(s,u.props??{});return u.type!==x.Fragment&&(v.ref=a?b:m),x.cloneElement(u,v)});return r.displayName=`${n}.Slot`,r}nn(er,"createSlot");var u1=er("Slot"),Km=Symbol.for("radix.slottable");function Fm(n){const r=nn(l=>"child"in l?l.children(l.child):l.children,"Slottable");return r.displayName=`${n}.Slottable`,r.__radixId=Km,r}nn(Fm,"createSlottable");var d1=nn((n,r)=>"child"in n.props?x.isValidElement(r)?x.cloneElement(r,void 0,n.props.children(r.props.children)):null:x.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function Qm(n,r){const l={...r};for(const a in r){const c=n[a],s=r[a];/^on[A-Z]/.test(a)?c&&s?l[a]=(...h)=>{const g=s(...h);return c(...h),g}:c&&(l[a]=c):a==="style"?l[a]={...c,...s}:a==="className"?l[a]=[c,s].filter(Boolean).join(" "):a==="aria-describedby"&&(l[a]=tp(s,c))}return{...n,...l}}nn(Qm,"mergeProps");function Zm(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning;return l?n.ref:(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}nn(Zm,"getElementRef");function Wm(n){return x.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Km}nn(Wm,"isSlottable");var f1=Symbol.for("react.lazy");function xu(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===f1&&"_payload"in n&&Jm(n._payload)}nn(xu,"isLazyComponent");function Jm(n){return typeof n=="object"&&n!==null&&"then"in n}nn(Jm,"isPromiseLike");function ep(n){let r=n;for(;xu(r)&&typeof Bl=="function";)r=Bl(r._payload);return r}nn(ep,"useUnwrappedLazy");function tp(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}nn(tp,"concatAriaDescribedby");var h1=nn(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),m1=nn(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bl=po[" use ".trim().toString()],p1=Object.defineProperty,g1=(n,r)=>p1(n,"name",{value:r,configurable:!0}),y1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=y1.reduce((n,r)=>{const l=er(`Primitive.${r}`),a=x.forwardRef((c,s)=>{const{asChild:u,...h}=c,g=u?l:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(g,{...h,ref:s})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function np(n,r){n&&Dr.flushSync(()=>n.dispatchEvent(r))}g1(np,"dispatchDiscreteCustomEvent");var v1=Object.defineProperty,b1=(n,r)=>v1(n,"name",{value:r,configurable:!0}),rp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),x1=x.forwardRef(b1(function(r,l){return f.jsx(He.span,{...r,ref:l,style:{...rp,...r.style}})},"VisuallyHidden")),S1=Object.defineProperty,yn=(n,r)=>S1(n,"name",{value:r,configurable:!0});function C1(n,r){const l=x.createContext(r);l.displayName=n+"Context";const a=yn(s=>{const{children:u,...h}=s,g=x.useMemo(()=>h,Object.values(h));return f.jsx(l.Provider,{value:g,children:u})},"Provider");a.displayName=n+"Provider";function c(s,u={}){const{optional:h=!1}=u,g=x.useContext(l);if(g)return g;if(r!==void 0)return r;if(!h)throw new Error(`\`${s}\` must be used within \`${n}\``)}return yn(c,"useContext"),[a,c]}yn(C1,"createContext");function vn(n,r=[]){let l=[];function a(s,u){const h=x.createContext(u);h.displayName=s+"Context";const g=l.length;l=[...l,u];const m=yn(v=>{const{scope:w,children:C,...y}=v,S=w?.[n]?.[g]||h,E=x.useMemo(()=>y,Object.values(y));return f.jsx(S.Provider,{value:E,children:C})},"Provider");m.displayName=s+"Provider";function b(v,w,C={}){const{optional:y=!1}=C,S=w?.[n]?.[g]||h,E=x.useContext(S);if(E)return E;if(u!==void 0)return u;if(!y)throw new Error(`\`${v}\` must be used within \`${s}\``)}return yn(b,"useContext"),[m,b]}yn(a,"createContext");const c=yn(()=>{const s=l.map(u=>x.createContext(u));return yn(function(h){const g=h?.[n]||s;return x.useMemo(()=>({[`__scope${n}`]:{...h,[n]:g}}),[h,g])},"useScope")},"createScope");return c.scopeName=n,[a,op(c,...r)]}yn(vn,"createContextScope");function op(...n){const r=n[0];if(n.length===1)return r;const l=yn(()=>{const a=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return yn(function(s){const u=a.reduce((h,{useScope:g,scopeName:m})=>{const v=g(s)[`__scope${m}`];return{...h,...v}},{});return x.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return l.scopeName=r.scopeName,l}yn(op,"composeContextScopes");var it=globalThis?.document?x.useLayoutEffect:()=>{},w1=Object.defineProperty,Et=(n,r)=>w1(n,"name",{value:r,configurable:!0});function Ul(n){const r=n+"CollectionProvider",[l,a]=vn(r),[c,s]=l(r,{collectionRef:{current:null},itemMap:new Map}),u=Et(S=>{const{scope:E,children:R}=S,N=x.useRef(null),T=x.useRef(new Map).current;return f.jsx(c,{scope:E,itemMap:T,collectionRef:N,children:R})},"CollectionProvider");u.displayName=r;const h=n+"CollectionSlot",g=er(h),m=x.forwardRef((S,E)=>{const{scope:R,children:N}=S,T=s(h,R),O=Ie(E,T.collectionRef);return f.jsx(g,{ref:O,children:N})});m.displayName=h;const b=n+"CollectionItemSlot",v="data-radix-collection-item",w=er(b),C=x.forwardRef((S,E)=>{const{scope:R,children:N,...T}=S,O=x.useRef(null),D=Ie(E,O),M=s(b,R);return x.useEffect(()=>(M.itemMap.set(O,{ref:O,...T}),()=>void M.itemMap.delete(O))),f.jsx(w,{[v]:"",ref:D,children:N})});C.displayName=b;function y(S){const E=s(n+"CollectionConsumer",S);return x.useCallback(()=>{const N=E.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((M,z)=>T.indexOf(M.ref.current)-T.indexOf(z.ref.current))},[E.collectionRef,E.itemMap])}return Et(y,"useCollection"),[{Provider:u,Slot:m,ItemSlot:C},y,a]}Et(Ul,"createCollection");var ap=new WeakMap,Pl=(on=class extends Map{constructor(l){super(l);jS(this,pt);Zh(this,pt,[...super.keys()]),ap.set(this,!0)}set(l,a){return ap.get(this)&&!this.has(l)&&Ht(this,pt).push(l),super.set(l,a),this}insert(l,a,c){const s=this.has(a),u=s?this.size:this.size+1,h=Su(l),g=h>=0?Math.min(h,u-1):Math.max(u+h,0);if(s?Ht(this,pt).indexOf(a)===g:g===this.size)return this.set(a,c),this;const m=Ht(this,pt).filter(v=>v!==a);m.splice(g,0,a);const b=m.map(v=>[v,v===a?c:this.get(v)]);this.clear();for(const[v,w]of b)this.set(v,w);return this}with(l,a,c){const s=new on(this);return s.insert(l,a,c),s}before(l){const a=Ht(this,pt).indexOf(l)-1;if(!(a<0))return this.entryAt(a)}setBefore(l,a,c){const s=Ht(this,pt).indexOf(l);if(s===-1)return this;const u=Ht(this,pt).indexOf(a),h=u!==-1&&u<s?s-1:s;return this.insert(h,a,c)}after(l){let a=Ht(this,pt).indexOf(l);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(l,a,c){const s=Ht(this,pt).indexOf(l);if(s===-1)return this;const u=Ht(this,pt).indexOf(a),h=u!==-1&&u<=s?s:s+1;return this.insert(h,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Zh(this,pt,[]),super.clear()}delete(l){const a=super.delete(l);return a&&Ht(this,pt).splice(Ht(this,pt).indexOf(l),1),a}deleteAt(l){const a=this.keyAt(l);return a!==void 0?this.delete(a):!1}at(l){const a=$l(Ht(this,pt),l);if(a!==void 0)return this.get(a)}entryAt(l){const a=$l(Ht(this,pt),l);if(a!==void 0)return[a,this.get(a)]}indexOf(l){return Ht(this,pt).indexOf(l)}keyAt(l){return $l(Ht(this,pt),l)}from(l,a){const c=this.indexOf(l);if(c===-1)return;let s=c+a;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(l,a){const c=this.indexOf(l);if(c===-1)return;let s=c+a;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return s;c++}}findIndex(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return c;c++}return-1}filter(l,a){const c=[];let s=0;for(const u of this)Reflect.apply(l,a,[u,s,this])&&c.push(u),s++;return new on(c)}map(l,a){const c=[];let s=0;for(const u of this)c.push([u[0],Reflect.apply(l,a,[u,s,this])]),s++;return new on(c)}reduce(...l){const[a,c]=l,s=l.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,h=c;for(const g of this)u===0&&!s?h=g:h=Reflect.apply(a,this,[h,g,u,this]),u++;return h}reduceRight(...l){const[a,c]=l,s=l.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let h=this.size-1;h>=0;h--){const g=this.entryAt(h);h===this.size-1&&!s?u=g:u=Reflect.apply(a,this,[u,g,h,this])}return u}sort(l){if(typeof l!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(l);this.clear();for(const[c,s]of a)this.set(c,s);return this}toSorted(l){if(typeof l!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(l);return new on(a)}toReversed(){const l=new on;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),s=this.get(c);l.set(c,s)}return l}toSpliced(...l){const a=[...this.entries()];return a.splice(...l),new on(a)}slice(l,a){const c=new on;for(const s of Ht(this,pt).slice(l,a))c.set(s,this.get(s));return c}every(l,a){let c=0;for(const s of this){if(!Reflect.apply(l,a,[s,c,this]))return!1;c++}return!0}some(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return!0;c++}return!1}},pt=new WeakMap,Et(on,"OrderedDict"),on);function $l(n,r){if("at"in Array.prototype)return Array.prototype.at.call(n,r);const l=ip(n,r);return l===-1?void 0:n[l]}Et($l,"at");function ip(n,r){const l=n.length,a=Su(r),c=a>=0?a:l+a;return c<0||c>=l?-1:c}Et(ip,"toSafeIndex");function Su(n){return n!==n||n===0?0:Math.trunc(n)}Et(Su,"toSafeInteger");function E1(n){const r=n+"CollectionProvider",[l,a]=vn(r),[c,s]=l(r);c.displayName=n+"CollectionStableContextProvider";const[u,h]=l(r);u.displayName=n+"CollectionStatefulContextProvider";const g=Et(({state:M,...z})=>M?f.jsx(b,{...z,state:M}):f.jsx(m,{...z}),"CollectionProvider");g.displayName=r;const m=Et(M=>{const z=N();return f.jsx(b,{...M,state:z})},"CollectionInit");m.displayName=n+"CollectionInit";const b=Et(M=>{const{scope:z,children:H,state:G}=M,X=x.useRef(null),[U,F]=x.useState(null),J=Ie(X,F),[I,Y]=G,k=x.useRef(new Pl),$=x.useCallback(()=>{const L=k.current;return cp(L)||L.sort(Gl),L},[]);return x.useEffect(()=>{if(!U)return;const L=up(()=>{Y(Z=>{const A=Z.toSorted(Gl);return A.some(([K],ee)=>Z.keyAt(ee)!==K)?A:Z})});return L.observe(U,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[U,Y]),f.jsx(c,{scope:z,collectionElementRef:J,collectionElementRefObject:X,getCollection:$,setCollection:Y,registryRef:k,children:f.jsx(u,{scope:z,collectionElement:U,collection:I,children:H})})},"CollectionProviderImpl");b.displayName=n+"CollectionProviderImpl";const v=n+"CollectionSlot",w=er(v),C=x.forwardRef((M,z)=>{const{scope:H,children:G}=M,X=s(v,H),U=Ie(z,X.collectionElementRef);return f.jsx(w,{ref:U,children:G})});C.displayName=v;const y=n+"CollectionItemSlot",S="data-radix-collection-item",E=er(y),R=x.forwardRef((M,z)=>{const{scope:H,children:G,...X}=M,U=x.useRef(null),F=s(y,H),{setCollection:J,registryRef:I}=F,Y=x.useRef(X);lp(Y.current,X)||(Y.current=X);const k=Y.current,$=x.useCallback(A=>{const V=I.current;A?V.set(A,{...Y.current,element:A}):U.current&&V.delete(U.current)},[I]),L=Ie(z,$,U);it(()=>{const A=U.current,V=I.current;A&&V.has(A)&&V.set(A,{...k,element:A})},[k,I]);const Z=x.useRef(null);return x.useEffect(()=>{const A=U.current,V=Z.current;(V?.element??null)===A&&(!A||V?.itemData===k)||(Z.current=A?{element:A,itemData:k}:null,J(K=>{const ee=new Pl(K);return V&&V.element!==A&&ee.delete(V.element),A&&ee.set(A,{...k,element:A}),ee.sort(Gl)}))}),x.useEffect(()=>()=>{const A=Z.current;Z.current=null,A&&J(V=>{if(!V.has(A.element))return V;const K=new Pl(V);return K.delete(A.element),K})},[J]),f.jsx(E,{[S]:"",ref:L,children:G})});R.displayName=y;function N(){return x.useState(new Pl)}Et(N,"useInitCollection");function T(M){const{collection:z}=h(n+"CollectionConsumer",M);return z}Et(T,"useCollection");function O(M){const{getCollection:z}=s(n+"CollectionConsumer",M);return z}return Et(O,"useGetCollection"),[{Provider:g,Slot:C,ItemSlot:R},{createCollectionScope:a,useCollection:T,useGetCollection:O,useInitCollection:N}]}Et(E1,"createCollection");function lp(n,r){if(n===r)return!0;if(typeof n!="object"||typeof r!="object"||n==null||r==null)return!1;const l=Object.keys(n),a=Object.keys(r);if(l.length!==a.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(r,c)||n[c]!==r[c])return!1;return!0}Et(lp,"shallowEqual");function sp(n,r){return!!(r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}Et(sp,"isElementPreceding");function cp(n){let r;for(const l of n.keys()){if(r){const a=r.compareDocumentPosition(l);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=l}return!0}Et(cp,"isInDocumentOrder");function Gl(n,r){return!n[1].element||!r[1].element?0:sp(n[1].element,r[1].element)?-1:1}Et(Gl,"sortByDocumentPosition");function up(n){return new MutationObserver(l=>{for(const a of l)if(a.type==="childList"){n();return}})}Et(up,"getChildListObserver");var T1=Object.defineProperty,ea=(n,r)=>T1(n,"name",{value:r,configurable:!0}),dp=!!(typeof window<"u"&&window.document&&window.document.createElement);function we(n,r,{checkForDefaultPrevented:l=!0}={}){return ea(function(c){if(n?.(c),l===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ea(we,"composeEventHandlers");function j1(n){if(!dp)throw new Error("Cannot access window outside of the DOM");return n?.ownerDocument?.defaultView??window}ea(j1,"getOwnerWindow");function Cu(n){if(!dp)throw new Error("Cannot access document outside of the DOM");return n?.ownerDocument??document}ea(Cu,"getOwnerDocument");function fp(n,r=!1){const{activeElement:l}=Cu(n);if(!l?.nodeName)return null;if(hp(l)&&l.contentDocument)return fp(l.contentDocument.body,r);if(r){const a=l.getAttribute("aria-activedescendant");if(a){const c=Cu(l).getElementById(a);if(c)return c}}return l}ea(fp,"getActiveElement");function hp(n){return n.tagName==="IFRAME"}ea(hp,"isFrame");var O1=Object.defineProperty,R1=(n,r)=>O1(n,"name",{value:r,configurable:!0}),mp=po[" useEffectEvent ".trim().toString()],pp=po[" useInsertionEffect ".trim().toString()];function gp(n){if(typeof mp=="function")return mp(n);const r=x.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof pp=="function"?pp(()=>{r.current=n}):it(()=>{r.current=n}),x.useMemo(()=>((...l)=>r.current?.(...l)),[])}R1(gp,"useEffectEvent");var N1=Object.defineProperty,gi=(n,r)=>N1(n,"name",{value:r,configurable:!0}),A1=po[" useInsertionEffect ".trim().toString()]||it;function tr({prop:n,defaultProp:r,onChange:l=gi(()=>{},"onChange"),caller:a}){const[c,s,u]=yp({defaultProp:r,onChange:l}),h=n!==void 0,g=h?n:c,m=x.useCallback(b=>{if(h){const v=vp(b)?b(n):b;v!==n&&u.current?.(v)}else s(b)},[h,n,s,u]);return[g,m]}gi(tr,"useControllableState");function yp({defaultProp:n,onChange:r}){const[l,a]=x.useState(n),c=x.useRef(l),s=x.useRef(r);return A1(()=>{s.current=r},[r]),x.useEffect(()=>{c.current!==l&&(s.current?.(l),c.current=l)},[l,c]),[l,a,s]}gi(yp,"useUncontrolledState");function vp(n){return typeof n=="function"}gi(vp,"isFunction");var bp=Symbol("RADIX:SYNC_STATE");function M1(n,r,l,a){const{prop:c,defaultProp:s,onChange:u,caller:h}=r,g=c!==void 0,m=gp(u),b=[{...l,state:s}];a&&b.push(a);const[v,w]=x.useReducer((E,R)=>{if(R.type===bp)return{...E,state:R.state};const N=n(E,R);return g&&!Object.is(N.state,E.state)&&m(N.state),N},...b),C=v.state,y=x.useRef(C);x.useEffect(()=>{y.current!==C&&(y.current=C,g||m(C))},[C,y,g]);const S=x.useMemo(()=>c!==void 0?{...v,state:c}:v,[v,c]);return x.useEffect(()=>{g&&!Object.is(c,v.state)&&w({type:bp,state:c})},[c,v.state,g]),[S,w]}gi(M1,"useControllableStateReducer");var _1=Object.defineProperty,nr=(n,r)=>_1(n,"name",{value:r,configurable:!0});function xp(n,r){return x.useReducer((l,a)=>r[l][a]??l,n)}nr(xp,"useStateMachine");var Lr=nr(n=>{const{present:r,children:l}=n,a=Sp(r),c=typeof l=="function"?l({present:a.isPresent}):x.Children.only(l),s=Cp(a.ref,wp(c));return typeof l=="function"||a.isPresent?x.cloneElement(c,{ref:s}):null},"Presence");function Sp(n){const[r,l]=x.useState(),a=x.useRef(null),c=x.useRef(n),s=x.useRef("none"),u=x.useRef(void 0),h=n?"mounted":"unmounted",[g,m]=xp(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{g==="mounted"?(s.current=u.current??ta(a.current),u.current=void 0):s.current="none"},[g]),it(()=>{const b=a.current,v=c.current;if(v!==n){const C=s.current,y=ta(b);n?(u.current=y,m("MOUNT")):y==="none"||b?.display==="none"?m("UNMOUNT"):m(v&&C!==y?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,m]),it(()=>{if(r){let b;const v=r.ownerDocument.defaultView??window,w=nr(y=>{const E=ta(a.current).includes(CSS.escape(y.animationName));if(y.target===r&&E&&(m("ANIMATION_END"),!c.current)){const R=r.style.animationFillMode;r.style.animationFillMode="forwards",b=v.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=R)})}},"handleAnimationEnd"),C=nr(y=>{y.target===r&&(s.current=ta(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",C),r.addEventListener("animationcancel",w),r.addEventListener("animationend",w),()=>{v.clearTimeout(b),r.removeEventListener("animationstart",C),r.removeEventListener("animationcancel",w),r.removeEventListener("animationend",w)}}else m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:x.useCallback(b=>{if(b){const v=getComputedStyle(b);a.current=v,u.current=ta(v)}else a.current=null;l(b)},[])}}nr(Sp,"usePresence");function wu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}nr(wu,"setRef");function Cp(...n){const r=x.useRef(n);return r.current=n,x.useCallback(l=>{const a=r.current;let c=!1;const s=a.map(u=>{const h=wu(u,l);return!c&&typeof h=="function"&&(c=!0),h});if(c)return()=>{for(let u=0;u<s.length;u++){const h=s[u];typeof h=="function"?h():wu(a[u],null)}}},[])}nr(Cp,"useStableComposedRefs");function ta(n){return n?.animationName||"none"}nr(ta,"getAnimationName");function wp(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning;return l?n.ref:(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}nr(wp,"getElementRef");var D1=Object.defineProperty,I1=(n,r)=>D1(n,"name",{value:r,configurable:!0}),z1=po[" useId ".trim().toString()]||(()=>{}),L1=0;function rr(n){const[r,l]=x.useState(z1());return it(()=>{n||l(a=>a??String(L1++))},[n]),n||(r?`radix-${r}`:"")}I1(rr,"useId");var k1=Object.defineProperty,H1=(n,r)=>k1(n,"name",{value:r,configurable:!0}),B1={LTR:"ltr"},U1=x.createContext(void 0);function yi(n){const r=x.useContext(U1);return n||r||B1.LTR}H1(yi,"useDirection");var P1=Object.defineProperty,$1=(n,r)=>P1(n,"name",{value:r,configurable:!0}),Ep=po[" useInsertionEffect ".trim().toString()];function An(n){const r=x.useRef(n);return typeof Ep=="function"?Ep(()=>{r.current=n}):it(()=>{r.current=n}),x.useMemo(()=>((...l)=>r.current?.(...l)),[])}$1(An,"useCallbackRef");var G1=Object.defineProperty,Nt=(n,r)=>G1(n,"name",{value:r,configurable:!0}),Eu="dismissableLayer.update",V1="dismissableLayer.pointerDownOutside",q1="dismissableLayer.focusOutside",Tp,jp=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tu=x.forwardRef(Nt(function(r,l){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m,...b}=r,v=x.useContext(jp),[w,C]=x.useState(null),y=w?.ownerDocument??globalThis?.document,[,S]=x.useState({}),E=Ie(l,C),R=Array.from(v.layers),[N]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),T=N?R.indexOf(N):-1,O=w?R.indexOf(w):-1,D=v.layersWithOutsidePointerEventsDisabled.size>0,M=O>=T,z=x.useRef(!1),H=Rp(F=>{u?.(F),g?.(F),F.defaultPrevented||m?.()},{ownerDocument:y,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:z,dismissableSurfaces:v.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(F=>{if(!(F instanceof Node))return!1;const J=[...v.branches].some(I=>I.contains(F));return M&&!J},[v.branches,M])}),G=Np(F=>{if(c&&z.current)return;const J=F.target;[...v.branches].some(Y=>Y.contains(J))||(h?.(F),g?.(F),F.defaultPrevented||m?.())},y),X=w?O===R.length-1:!1,U=An(F=>{F.key==="Escape"&&(s?.(F),!F.defaultPrevented&&m&&(F.preventDefault(),m()))});return x.useEffect(()=>{if(X)return y.addEventListener("keydown",U,{capture:!0}),()=>y.removeEventListener("keydown",U,{capture:!0})},[y,X,U]),x.useEffect(()=>{if(w)return a&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Tp=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),ju(),()=>{a&&(v.layersWithOutsidePointerEventsDisabled.delete(w),v.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=Tp))}},[w,y,a,v]),x.useEffect(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),ju())},[w,v]),x.useEffect(()=>{const F=Nt(()=>S({}),"handleUpdate");return document.addEventListener(Eu,F),()=>document.removeEventListener(Eu,F)},[]),f.jsx(He.div,{...b,ref:E,style:{pointerEvents:D?M?"auto":"none":void 0,...r.style},onFocusCapture:we(r.onFocusCapture,G.onFocusCapture),onBlurCapture:we(r.onBlurCapture,G.onBlurCapture),onPointerDownCapture:we(r.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function Op(){const n=x.useContext(jp),[r,l]=x.useState(null);return x.useEffect(()=>{if(r)return n.dismissableSurfaces.add(r),()=>{n.dismissableSurfaces.delete(r)}},[r,n.dismissableSurfaces]),l}Nt(Op,"useDismissableLayerSurface");var Y1=Nt(()=>!0,"IS_TRUE");function Rp(n,r){const{ownerDocument:l=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:s,shouldHandlePointerDownOutside:u=Y1}=r,h=An(n),g=x.useRef(!1),m=x.useRef(!1),b=x.useRef(new Map),v=x.useRef(()=>{});return x.useEffect(()=>{function w(){m.current=!1,c.current=!1,b.current.clear()}Nt(w,"resetOutsideInteraction");function C(){return Array.from(b.current.values()).some(Boolean)}Nt(C,"isOutsideInteractionIntercepted");function y(T){if(!m.current)return;const O=T.target;O instanceof Node&&[...s].some(M=>M.contains(O))||b.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{m.current&&v.current()},0)}Nt(y,"handleInteractionCapture");function S(T){m.current&&b.current.set(T.type,!1)}Nt(S,"handleInteractionBubble");const E=Nt(T=>{if(T.target&&!g.current){let O=function(){l.removeEventListener("click",v.current);const M=C();w(),M||Ou(V1,h,D,{discrete:!0})};if(Nt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(T.target)){l.removeEventListener("click",v.current),w(),g.current=!1;return}const D={originalEvent:T};m.current=!0,c.current=a&&T.button===0,b.current.clear(),!a||T.button!==0?O():(l.removeEventListener("click",v.current),v.current=O,l.addEventListener("click",v.current,{once:!0}))}else l.removeEventListener("click",v.current),w();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of R)l.addEventListener(T,y,!0),l.addEventListener(T,S);const N=window.setTimeout(()=>{l.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(N),l.removeEventListener("pointerdown",E),l.removeEventListener("click",v.current);for(const T of R)l.removeEventListener(T,y,!0),l.removeEventListener(T,S)}},[l,h,a,c,s,u]),{onPointerDownCapture:Nt(()=>g.current=!0,"onPointerDownCapture")}}Nt(Rp,"usePointerDownOutside");function Np(n,r=globalThis?.document){const l=An(n),a=x.useRef(!1);return x.useEffect(()=>{const c=Nt(s=>{s.target&&!a.current&&Ou(q1,l,{originalEvent:s},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,l]),{onFocusCapture:Nt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Nt(()=>a.current=!1,"onBlurCapture")}}Nt(Np,"useFocusOutside");function ju(){const n=new CustomEvent(Eu);document.dispatchEvent(n)}Nt(ju,"dispatchUpdate");function Ou(n,r,l,{discrete:a}){const c=l.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});r&&c.addEventListener(n,r,{once:!0}),a?np(c,s):c.dispatchEvent(s)}Nt(Ou,"handleAndDispatchCustomEvent");var X1=Object.defineProperty,vt=(n,r)=>X1(n,"name",{value:r,configurable:!0}),Ru="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",Ap={bubbles:!1,cancelable:!0},Mp=x.forwardRef(vt(function(r,l){const{loop:a=!1,trapped:c=!1,branches:s,onMountAutoFocus:u,onUnmountAutoFocus:h,...g}=r,[m,b]=x.useState(null),v=An(u),w=An(h),C=x.useRef(null),y=Ie(l,b),S=x.useRef(s);x.useEffect(()=>{S.current=s});const E=x.useCallback(T=>T?m?.contains(T)?!0:!!S.current?.some(O=>O.contains(T)):!1,[m]),R=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(c){let T=function(z){if(R.paused||!m)return;const H=z.target;E(H)?C.current=H:or(C.current,{select:!0})},O=function(z){if(R.paused||!m)return;const H=z.relatedTarget;H!==null&&(E(H)||or(C.current,{select:!0}))},D=function(z){if(document.activeElement===document.body)for(const G of z)G.removedNodes.length>0&&or(m)};vt(T,"handleFocusIn"),vt(O,"handleFocusOut"),vt(D,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",O);const M=new MutationObserver(D);return m&&M.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",O),M.disconnect()}}},[c,m,R.paused,E]),x.useEffect(()=>{if(m){Up.add(R);const T=document.activeElement;if(!m.contains(T)){const D=new CustomEvent(Ru,Ap);m.addEventListener(Ru,v),m.dispatchEvent(D),D.defaultPrevented||(Lp($p(Au(m)),{select:!0}),document.activeElement===T&&or(m))}return()=>{m.removeEventListener(Ru,v);const D=m.ownerDocument,M=CustomEvent;setTimeout(()=>{const z=new M(Nu,Ap);m.addEventListener(Nu,w),m.dispatchEvent(z),z.defaultPrevented||or(T??D.body,{select:!0}),m.removeEventListener(Nu,w),Up.remove(R)},0)}}},[m,v,w,R]);const N=x.useCallback(T=>{if(!a&&!c||R.paused)return;const O=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,D=document.activeElement;if(O&&D){const M=T.currentTarget,[z,H]=kp(M);z&&H?!T.shiftKey&&D===H?(T.preventDefault(),a&&or(z,{select:!0})):T.shiftKey&&D===z&&(T.preventDefault(),a&&or(H,{select:!0})):D===M&&T.preventDefault()}},[a,c,R.paused]);return f.jsx(He.div,{tabIndex:-1,...g,ref:y,onKeyDown:N})},"FocusScope")),_p=x.createContext(null);function Dp({registry:n,children:r}){return n?f.jsx(_p.Provider,{value:n,children:r}):r}vt(Dp,"FocusScopeBranchProvider");function Ip(){const[n,r]=x.useState([]),l=x.useMemo(()=>({add:vt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:vt(a=>r(c=>c.filter(s=>s!==a)),"remove")}),[]);return{nodes:n,registry:l}}vt(Ip,"useFocusScopeBranchRegistry");function zp(n){const r=x.useContext(_p);x.useEffect(()=>{if(!(!n||!r))return r.add(n),()=>r.remove(n)},[n,r])}vt(zp,"useFocusScopeBranch");function Lp(n,{select:r=!1}={}){const l=document.activeElement;for(const a of n)if(or(a,{select:r}),document.activeElement!==l)return}vt(Lp,"focusFirst");function kp(n){const r=Au(n),l=Mu(r,n),a=Mu(r.reverse(),n);return[l,a]}vt(kp,"getTabbableEdges");function Au(n){const r=[],a=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:vt(c=>{const s=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||s?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}vt(Au,"getTabbableCandidates");function Mu(n,r){const l=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of n)if(!(l?!a.checkVisibility({checkVisibilityCSS:!0}):Hp(a,{upTo:r})))return a}vt(Mu,"findVisible");function Hp(n,{upTo:r}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(r!==void 0&&n===r)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}vt(Hp,"isHidden");function Bp(n){return n.tagName==="INPUT"&&typeof n.select=="function"}vt(Bp,"isSelectableInput");function or(n,{select:r=!1}={}){if(n&&n.focus){const a=(n.ownerDocument??document).activeElement;n.focus({preventScroll:!0}),n!==a&&Bp(n)&&r&&n.select()}}vt(or,"focus");var Up=Pp();function Pp(){let n=[];return{add(r){const l=n[0];r!==l&&l?.pause(),n=_u(n,r),n.unshift(r)},remove(r){n=_u(n,r),n[0]?.resume()}}}vt(Pp,"createFocusScopesStack");function _u(n,r){const l=[...n],a=l.indexOf(r);return a!==-1&&l.splice(a,1),l}vt(_u,"arrayRemove");function $p(n){return n.filter(r=>r.tagName!=="A")}vt($p,"removeLinks");var K1=Object.defineProperty,F1=(n,r)=>K1(n,"name",{value:r,configurable:!0}),Du=x.forwardRef(F1(function(r,l){const{container:a,...c}=r,[s,u]=x.useState(!1);it(()=>u(!0),[]);const h=a||s&&globalThis?.document?.body;return h?Dr.createPortal(f.jsx(He.div,{...c,ref:l}),h):null},"Portal")),Q1=Object.defineProperty,Iu=(n,r)=>Q1(n,"name",{value:r,configurable:!0}),Vl=0,na=null;function Z1(n){return ql(),n.children}Iu(Z1,"FocusGuards");function ql(){x.useEffect(()=>{na||(na={start:zu(),end:zu()});const{start:n,end:r}=na;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),Vl++,()=>{Vl===1&&(na?.start.remove(),na?.end.remove(),na=null),Vl=Math.max(0,Vl-1)}},[])}Iu(ql,"useFocusGuards");function zu(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Iu(zu,"createFocusGuard");var $n=function(){return $n=Object.assign||function(r){for(var l,a=1,c=arguments.length;a<c;a++){l=arguments[a];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(r[s]=l[s])}return r},$n.apply(this,arguments)};function Gp(n,r){var l={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.indexOf(a)<0&&(l[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(l[a[c]]=n[a[c]]);return l}function W1(n,r,l){if(l||arguments.length===2)for(var a=0,c=r.length,s;a<c;a++)(s||!(a in r))&&(s||(s=Array.prototype.slice.call(r,0,a)),s[a]=r[a]);return n.concat(s||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var Yl="right-scroll-bar-position",Xl="width-before-scroll-bar",J1="with-scroll-bars-hidden",ew="--removed-body-scroll-bar-size";function Lu(n,r){return typeof n=="function"?n(r):n&&(n.current=r),n}function tw(n,r){var l=x.useState(function(){return{value:n,callback:r,facade:{get current(){return l.value},set current(a){var c=l.value;c!==a&&(l.value=a,l.callback(a,c))}}}})[0];return l.callback=r,l.facade}var nw=typeof window<"u"?x.useLayoutEffect:x.useEffect,Vp=new WeakMap;function rw(n,r){var l=tw(null,function(a){return n.forEach(function(c){return Lu(c,a)})});return nw(function(){var a=Vp.get(l);if(a){var c=new Set(a),s=new Set(n),u=l.current;c.forEach(function(h){s.has(h)||Lu(h,null)}),s.forEach(function(h){c.has(h)||Lu(h,u)})}Vp.set(l,n)},[n]),l}function ow(n){return n}function aw(n,r){r===void 0&&(r=ow);var l=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(s){var u=r(s,a);return l.push(u),function(){l=l.filter(function(h){return h!==u})}},assignSyncMedium:function(s){for(a=!0;l.length;){var u=l;l=[],u.forEach(s)}l={push:function(h){return s(h)},filter:function(){return l}}},assignMedium:function(s){a=!0;var u=[];if(l.length){var h=l;l=[],h.forEach(s),u=l}var g=function(){var b=u;u=[],b.forEach(s)},m=function(){return Promise.resolve().then(g)};m(),l={push:function(b){u.push(b),m()},filter:function(b){return u=u.filter(b),l}}}};return c}function iw(n){n===void 0&&(n={});var r=aw(null);return r.options=$n({async:!0,ssr:!1},n),r}var qp=function(n){var r=n.sideCar,l=Gp(n,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,$n({},l))};qp.isSideCarExport=!0;function lw(n,r){return n.useMedium(r),qp}var Yp=iw(),ku=function(){},Kl=x.forwardRef(function(n,r){var l=x.useRef(null),a=x.useState({onScrollCapture:ku,onWheelCapture:ku,onTouchMoveCapture:ku}),c=a[0],s=a[1],u=n.forwardProps,h=n.children,g=n.className,m=n.removeScrollBar,b=n.enabled,v=n.shards,w=n.sideCar,C=n.noRelative,y=n.noIsolation,S=n.inert,E=n.allowPinchZoom,R=n.as,N=R===void 0?"div":R,T=n.gapMode,O=Gp(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=w,M=rw([l,r]),z=$n($n({},O),c);return x.createElement(x.Fragment,null,b&&x.createElement(D,{sideCar:Yp,removeScrollBar:m,shards:v,noRelative:C,noIsolation:y,inert:S,setCallbacks:s,allowPinchZoom:!!E,lockRef:l,gapMode:T}),u?x.cloneElement(x.Children.only(h),$n($n({},z),{ref:M})):x.createElement(N,$n({},z,{className:g,ref:M}),h))});Kl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kl.classNames={fullWidth:Xl,zeroRight:Yl};var sw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cw(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var r=sw();return r&&n.setAttribute("nonce",r),n}function uw(n,r){n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r))}function dw(n){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(n)}var fw=function(){var n=0,r=null;return{add:function(l){n==0&&(r=cw())&&(uw(r,l),dw(r)),n++},remove:function(){n--,!n&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},hw=function(){var n=fw();return function(r,l){x.useEffect(function(){return n.add(r),function(){n.remove()}},[r&&l])}},Xp=function(){var n=hw(),r=function(l){var a=l.styles,c=l.dynamic;return n(a,c),null};return r},mw={left:0,top:0,right:0,gap:0},Hu=function(n){return parseInt(n||"",10)||0},pw=function(n){var r=window.getComputedStyle(document.body),l=r[n==="padding"?"paddingLeft":"marginLeft"],a=r[n==="padding"?"paddingTop":"marginTop"],c=r[n==="padding"?"paddingRight":"marginRight"];return[Hu(l),Hu(a),Hu(c)]},gw=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return mw;var r=pw(n),l=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-l+r[2]-r[0])}},yw=Xp(),ra="data-scroll-locked",vw=function(n,r,l,a){var c=n.left,s=n.top,u=n.right,h=n.gap;return l===void 0&&(l="margin"),`
50
+ .`.concat(J1,` {
51
+ overflow: hidden `).concat(a,`;
52
+ padding-right: `).concat(h,"px ").concat(a,`;
53
+ }
54
+ body[`).concat(ra,`] {
55
+ overflow: hidden `).concat(a,`;
56
+ overscroll-behavior: contain;
57
+ `).concat([r&&"position: relative ".concat(a,";"),l==="margin"&&`
58
+ padding-left: `.concat(c,`px;
59
+ padding-top: `).concat(s,`px;
60
+ padding-right: `).concat(u,`px;
61
+ margin-left:0;
62
+ margin-top:0;
63
+ margin-right: `).concat(h,"px ").concat(a,`;
64
+ `),l==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),`
65
+ }
66
+
67
+ .`).concat(Yl,` {
68
+ right: `).concat(h,"px ").concat(a,`;
69
+ }
70
+
71
+ .`).concat(Xl,` {
72
+ margin-right: `).concat(h,"px ").concat(a,`;
73
+ }
74
+
75
+ .`).concat(Yl," .").concat(Yl,` {
76
+ right: 0 `).concat(a,`;
77
+ }
78
+
79
+ .`).concat(Xl," .").concat(Xl,` {
80
+ margin-right: 0 `).concat(a,`;
81
+ }
82
+
83
+ body[`).concat(ra,`] {
84
+ `).concat(ew,": ").concat(h,`px;
85
+ }
86
+ `)},Kp=function(){var n=parseInt(document.body.getAttribute(ra)||"0",10);return isFinite(n)?n:0},bw=function(){x.useEffect(function(){return document.body.setAttribute(ra,(Kp()+1).toString()),function(){var n=Kp()-1;n<=0?document.body.removeAttribute(ra):document.body.setAttribute(ra,n.toString())}},[])},xw=function(n){var r=n.noRelative,l=n.noImportant,a=n.gapMode,c=a===void 0?"margin":a;bw();var s=x.useMemo(function(){return gw(c)},[c]);return x.createElement(yw,{styles:vw(s,!r,c,l?"":"!important")})},Bu=!1;if(typeof window<"u")try{var Fl=Object.defineProperty({},"passive",{get:function(){return Bu=!0,!0}});window.addEventListener("test",Fl,Fl),window.removeEventListener("test",Fl,Fl)}catch{Bu=!1}var oa=Bu?{passive:!1}:!1,Sw=function(n){return n.tagName==="TEXTAREA"},Fp=function(n,r){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[r]!=="hidden"&&!(l.overflowY===l.overflowX&&!Sw(n)&&l[r]==="visible")},Cw=function(n){return Fp(n,"overflowY")},ww=function(n){return Fp(n,"overflowX")},Qp=function(n,r){var l=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=Zp(n,a);if(c){var s=Wp(n,a),u=s[1],h=s[2];if(u>h)return!0}a=a.parentNode}while(a&&a!==l.body);return!1},Ew=function(n){var r=n.scrollTop,l=n.scrollHeight,a=n.clientHeight;return[r,l,a]},Tw=function(n){var r=n.scrollLeft,l=n.scrollWidth,a=n.clientWidth;return[r,l,a]},Zp=function(n,r){return n==="v"?Cw(r):ww(r)},Wp=function(n,r){return n==="v"?Ew(r):Tw(r)},jw=function(n,r){return n==="h"&&r==="rtl"?-1:1},Ow=function(n,r,l,a,c){var s=jw(n,window.getComputedStyle(r).direction),u=s*a,h=l.target,g=r.contains(h),m=!1,b=u>0,v=0,w=0;do{if(!h)break;var C=Wp(n,h),y=C[0],S=C[1],E=C[2],R=S-E-s*y;(y||R)&&Zp(n,h)&&(v+=R,w+=y);var N=h.parentNode;h=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&h!==document.body||g&&(r.contains(h)||r===h));return(b&&Math.abs(v)<1||!b&&Math.abs(w)<1)&&(m=!0),m},Ql=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Jp=function(n){return[n.deltaX,n.deltaY]},eg=function(n){return n&&"current"in n?n.current:n},Rw=function(n,r){return n[0]===r[0]&&n[1]===r[1]},Nw=function(n){return`
87
+ .block-interactivity-`.concat(n,` {pointer-events: none;}
88
+ .allow-interactivity-`).concat(n,` {pointer-events: all;}
89
+ `)},Aw=0,aa=[];function Mw(n){var r=x.useRef([]),l=x.useRef([0,0]),a=x.useRef(),c=x.useState(Aw++)[0],s=x.useState(Xp)[0],u=x.useRef(n);x.useEffect(function(){u.current=n},[n]),x.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=W1([n.lockRef.current],(n.shards||[]).map(eg),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var h=x.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var R=Ql(S),N=l.current,T="deltaX"in S?S.deltaX:N[0]-R[0],O="deltaY"in S?S.deltaY:N[1]-R[1],D,M=S.target,z=Math.abs(T)>Math.abs(O)?"h":"v";if("touches"in S&&z==="h"&&M.type==="range")return!1;var H=window.getSelection(),G=H&&H.anchorNode,X=G?G===M||G.contains(M):!1;if(X)return!1;var U=Qp(z,M);if(!U)return!0;if(U?D=z:(D=z==="v"?"h":"v",U=Qp(z,M)),!U)return!1;if(!a.current&&"changedTouches"in S&&(T||O)&&(a.current=D),!D)return!0;var F=a.current||D;return Ow(F,E,S,F==="h"?T:O)},[]),g=x.useCallback(function(S){var E=S;if(!(!aa.length||aa[aa.length-1]!==s)){var R="deltaY"in E?Jp(E):Ql(E),N=r.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Rw(D.delta,R)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var T=(u.current.shards||[]).map(eg).filter(Boolean).filter(function(D){return D.contains(E.target)}),O=T.length>0?h(E,T[0]):!u.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=x.useCallback(function(S,E,R,N){var T={name:S,delta:E,target:R,should:N,shadowParent:_w(R)};r.current.push(T),setTimeout(function(){r.current=r.current.filter(function(O){return O!==T})},1)},[]),b=x.useCallback(function(S){l.current=Ql(S),a.current=void 0},[]),v=x.useCallback(function(S){m(S.type,Jp(S),S.target,h(S,n.lockRef.current))},[]),w=x.useCallback(function(S){m(S.type,Ql(S),S.target,h(S,n.lockRef.current))},[]);x.useEffect(function(){return aa.push(s),n.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",g,oa),document.addEventListener("touchmove",g,oa),document.addEventListener("touchstart",b,oa),function(){aa=aa.filter(function(S){return S!==s}),document.removeEventListener("wheel",g,oa),document.removeEventListener("touchmove",g,oa),document.removeEventListener("touchstart",b,oa)}},[]);var C=n.removeScrollBar,y=n.inert;return x.createElement(x.Fragment,null,y?x.createElement(s,{styles:Nw(c)}):null,C?x.createElement(xw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function _w(n){for(var r=null;n!==null;)n instanceof ShadowRoot&&(r=n.host,n=n.host),n=n.parentNode;return r}const Dw=lw(Yp,Mw);var Uu=x.forwardRef(function(n,r){return x.createElement(Kl,$n({},n,{ref:r,sideCar:Dw}))});Uu.classNames=Kl.classNames;var Iw=function(n){if(typeof document>"u")return null;var r=Array.isArray(n)?n[0]:n;return r.ownerDocument.body},ia=new WeakMap,Zl=new WeakMap,Wl={},Pu=0,tg=function(n){return n&&(n.host||tg(n.parentNode))},zw=function(n,r){return r.map(function(l){if(n.contains(l))return l;var a=tg(l);return a&&n.contains(a)?a:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},Lw=function(n,r,l,a){var c=zw(r,Array.isArray(n)?n:[n]);Wl[l]||(Wl[l]=new WeakMap);var s=Wl[l],u=[],h=new Set,g=new Set(c),m=function(v){!v||h.has(v)||(h.add(v),m(v.parentNode))};c.forEach(m);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(w){if(h.has(w))b(w);else try{var C=w.getAttribute(a),y=C!==null&&C!=="false",S=(ia.get(w)||0)+1,E=(s.get(w)||0)+1;ia.set(w,S),s.set(w,E),u.push(w),S===1&&y&&Zl.set(w,!0),E===1&&w.setAttribute(l,"true"),y||w.setAttribute(a,"true")}catch(R){console.error("aria-hidden: cannot operate on ",w,R)}})};return b(r),h.clear(),Pu++,function(){u.forEach(function(v){var w=ia.get(v)-1,C=s.get(v)-1;ia.set(v,w),s.set(v,C),w||(Zl.has(v)||v.removeAttribute(a),Zl.delete(v)),C||v.removeAttribute(l)}),Pu--,Pu||(ia=new WeakMap,ia=new WeakMap,Zl=new WeakMap,Wl={})}},ng=function(n,r,l){l===void 0&&(l="data-aria-hidden");var a=Array.from(Array.isArray(n)?n:[n]),c=Iw(n);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),Lw(a,c,l,"aria-hidden")):function(){return null}},kw=Object.defineProperty,bn=(n,r)=>kw(n,"name",{value:r,configurable:!0}),$u="Dialog",[rg,PM]=vn($u),[Hw,ar]=rg($u),Bw=bn(n=>{const{__scopeDialog:r,children:l,open:a,defaultOpen:c,onOpenChange:s,modal:u=!0}=n,h=x.useRef(null),g=x.useRef(null),{nodes:m,registry:b}=Ip(),[v,w]=tr({prop:a,defaultProp:c??!1,onChange:s,caller:$u}),[C,y]=x.useState(0),[S,E]=x.useState(0);return f.jsx(Hw,{scope:r,triggerRef:h,contentRef:g,contentId:rr(),titleId:rr(),descriptionId:rr(),titlePresent:C>0,descriptionPresent:S>0,setTitleCount:y,setDescriptionCount:E,open:v,onOpenChange:w,onOpenToggle:x.useCallback(()=>w(R=>!R),[w]),modal:u,branchNodes:m,branchRegistry:b,children:l})},"Dialog"),og="DialogPortal",[Uw,ag]=rg(og,{forceMount:void 0}),Pw=bn(n=>{const{__scopeDialog:r,forceMount:l,children:a,container:c}=n,s=ar(og,r);return f.jsx(Uw,{scope:r,forceMount:l,children:x.Children.map(a,u=>f.jsx(Lr,{present:l||s.open,children:f.jsx(Du,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),Gu="DialogOverlay",$w=x.forwardRef(bn(function(r,l){const a=ag(Gu,r.__scopeDialog),{forceMount:c=a.forceMount,...s}=r,u=ar(Gu,r.__scopeDialog);return u.modal?f.jsx(Lr,{present:c||u.open,children:f.jsx(Vw,{...s,ref:l})}):null},"DialogOverlay")),Gw=er("DialogOverlay.RemoveScroll"),Vw=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar(Gu,a),u=Op(),h=Ie(l,u);return f.jsx(Uu,{as:Gw,allowPinchZoom:!0,shards:x.useMemo(()=>[s.contentRef,...s.branchNodes.map(g=>({current:g}))],[s.contentRef,s.branchNodes]),children:f.jsx(He.div,{"data-state":qu(s.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),vi="DialogContent",qw=x.forwardRef(bn(function(r,l){const a=ag(vi,r.__scopeDialog),{forceMount:c=a.forceMount,...s}=r,u=ar(vi,r.__scopeDialog);return f.jsx(Lr,{present:c||u.open,children:u.modal?f.jsx(Yw,{...s,ref:l}):f.jsx(Xw,{...s,ref:l})})},"DialogContent")),Yw=x.forwardRef(bn(function(r,l){const a=ar(vi,r.__scopeDialog),c=x.useRef(null),s=Ie(l,a.contentRef,c);return x.useEffect(()=>{const u=c.current;if(u)return ng(u)},[]),f.jsx(ig,{...r,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:we(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:we(r.onPointerDownOutside,u=>{const h=u.detail.originalEvent,g=h.button===0&&h.ctrlKey===!0;(h.button===2||g)&&u.preventDefault()}),onFocusOutside:we(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),Xw=x.forwardRef(bn(function(r,l){const a=ar(vi,r.__scopeDialog),c=x.useRef(!1),s=x.useRef(!1);return f.jsx(ig,{...r,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;a.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"DialogContentNonModal")),ig=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,"aria-describedby":h,children:g,...m}=r,b=ar(vi,a);return ql(),f.jsx(Dp,{registry:b.branchRegistry,children:f.jsx(Mp,{asChild:!0,loop:!0,trapped:c,branches:b.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:u,children:f.jsx(Tu,{role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?lg(h,b.descriptionId):h,"data-state":qu(b.open),...m,ref:l,deferPointerDownOutside:!0,onDismiss:()=>b.onOpenChange(!1),children:g})})})},"DialogContentImpl")),Kw=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar("DialogTitle",a),{setTitleCount:u}=s;return it(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),f.jsx(He.h2,{id:s.titleId,...c,ref:l})},"DialogTitle")),Fw="DialogClose",Vu=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar(Fw,a);return f.jsx(He.button,{type:"button",...c,ref:l,onClick:we(r.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function lg(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}bn(lg,"concatAriaDescribedby");function qu(n){return n?"open":"closed"}bn(qu,"getState");var Qw=Object.defineProperty,Zw=(n,r)=>Qw(n,"name",{value:r,configurable:!0});function bi(n){const[r,l]=x.useState(void 0);return it(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});let a=0;const c=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const u=s[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let h,g;if("borderBoxSize"in u){const m=u.borderBoxSize,b=Array.isArray(m)?m[0]:m;h=b.inlineSize,g=b.blockSize}else h=n.offsetWidth,g=n.offsetHeight;l({width:h,height:g})})});return c.observe(n,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(n)}}else l(void 0)},[n]),r}Zw(bi,"useSize");var Ww=Object.defineProperty,ir=(n,r)=>Ww(n,"name",{value:r,configurable:!0}),Yu="Checkbox",[Jw,$M]=vn(Yu),[eE,Xu]=Jw(Yu);function sg(n){const{__scopeCheckbox:r,checked:l,children:a,defaultChecked:c,disabled:s,form:u,name:h,onCheckedChange:g,required:m,value:b="on",internal_do_not_use_render:v}=n,[w,C]=tr({prop:l,defaultProp:c??!1,onChange:g,caller:Yu}),[y,S]=x.useState(null),[E,R]=x.useState(null),[N,T]=x.useState(null),O=y?!!u||!!y.closest("form"):!0,D={checked:w,disabled:s,setChecked:C,control:y,setControl:S,name:h,form:u,value:b,userClick:N,onUserClick:T,required:m,defaultChecked:xn(c)?!1:c,isFormControl:O,bubbleInput:E,setBubbleInput:R};return f.jsx(eE,{scope:r,...D,children:cg(v)?v(D):a})}ir(sg,"CheckboxProvider");var tE="CheckboxTrigger",nE=x.forwardRef(ir(function({__scopeCheckbox:r,onKeyDown:l,onClick:a,...c},s){const{control:u,value:h,disabled:g,checked:m,required:b,setControl:v,setChecked:w,onUserClick:C,isFormControl:y,bubbleInput:S}=Xu(tE,r),E=Ie(s,v),R=x.useRef(m);return x.useEffect(()=>{const N=u?.form;if(N){const T=ir(()=>w(R.current),"reset");return N.addEventListener("reset",T),()=>N.removeEventListener("reset",T)}},[u,w]),f.jsx(He.button,{type:"button",role:"checkbox","aria-checked":xn(m)?"mixed":m,"aria-required":b,"data-state":Ku(m),"data-disabled":g?"":void 0,disabled:g,value:h,...c,ref:E,onKeyDown:we(l,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:we(a,N=>{const T=N.isPropagationStopped();C({requestedChecked:xn(m)?!0:!m,hasConsumerStoppedPropagation:T}),w(O=>xn(O)?!0:!O),S&&y&&(T||N.stopPropagation())})})},"CheckboxTrigger")),rE=x.forwardRef(ir(function(r,l){const{__scopeCheckbox:a,name:c,checked:s,defaultChecked:u,required:h,disabled:g,value:m,onCheckedChange:b,form:v,...w}=r;return f.jsx(sg,{__scopeCheckbox:a,checked:s,defaultChecked:u,disabled:g,required:h,onCheckedChange:b,name:c,form:v,value:m,internal_do_not_use_render:({isFormControl:C})=>f.jsxs(f.Fragment,{children:[f.jsx(nE,{...w,ref:l,__scopeCheckbox:a}),C&&f.jsx(lE,{__scopeCheckbox:a})]})})},"Checkbox")),oE="CheckboxIndicator",aE=x.forwardRef(ir(function(r,l){const{__scopeCheckbox:a,forceMount:c,...s}=r,u=Xu(oE,a);return f.jsx(Lr,{present:c||xn(u.checked)||u.checked===!0,children:f.jsx(He.span,{"data-state":Ku(u.checked),"data-disabled":u.disabled?"":void 0,...s,ref:l,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),iE="CheckboxBubbleInput",lE=x.forwardRef(ir(function({__scopeCheckbox:r,onClick:l,...a},c){const{control:s,userClick:u,checked:h,defaultChecked:g,required:m,disabled:b,name:v,value:w,form:C,bubbleInput:y,setBubbleInput:S}=Xu(iE,r),E=Ie(c,S),R=bi(s),N=x.useRef(!1),T=x.useRef(h),O=x.useRef(u),D=x.useRef(null);x.useEffect(()=>{const z=y;if(!z)return;const H=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(H,"checked").set;if(!X)return;const U=T.current!==h;T.current=h;const F=u!==null&&u!==O.current;if(O.current=u,F)D.current=U?null:u,U&&(z.indeterminate=xn(h),X.call(z,xn(h)?!1:h)),z.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(U){const J=D.current;D.current=null;const I=J?.requestedChecked===h;N.current=!0,z.indeterminate=xn(h),X.call(z,xn(h)?!1:h),z.dispatchEvent(new Event("click",{bubbles:!(I&&J.hasConsumerStoppedPropagation)})),N.current=!1}},[y,h,u]);const M=x.useRef(xn(h)?!1:h);return f.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??M.current,required:m,disabled:b,name:v,value:w,form:C,...a,tabIndex:-1,ref:E,onClick:we(l,z=>{N.current&&z.stopPropagation()}),style:{...a.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function cg(n){return typeof n=="function"}ir(cg,"isFunction");function xn(n){return n==="indeterminate"}ir(xn,"isIndeterminate");function Ku(n){return xn(n)?"indeterminate":n?"checked":"unchecked"}ir(Ku,"getState");const sE=["top","right","bottom","left"],kr=Math.min,lr=Math.max,Jl=Math.round,es=Math.floor,sr=n=>({x:n,y:n}),cE={left:"right",right:"left",bottom:"top",top:"bottom"};function ug(n,r,l){return lr(n,kr(r,l))}function cr(n,r){return typeof n=="function"?n(r):n}function Hr(n){return n.split("-")[0]}function la(n){return n.split("-")[1]}function Fu(n){return n==="x"?"y":"x"}function Qu(n){return n==="y"?"height":"width"}function Gn(n){const r=n[0];return r==="t"||r==="b"?"y":"x"}function Zu(n){return Fu(Gn(n))}function uE(n,r,l){l===void 0&&(l=!1);const a=la(n),c=Zu(n),s=Qu(c);let u=c==="x"?a===(l?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[s]>r.floating[s]&&(u=ts(u)),[u,ts(u)]}function dE(n){const r=ts(n);return[Wu(n),r,Wu(r)]}function Wu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const dg=["left","right"],fg=["right","left"],fE=["top","bottom"],hE=["bottom","top"];function mE(n,r,l){switch(n){case"top":case"bottom":return l?r?fg:dg:r?dg:fg;case"left":case"right":return r?fE:hE;default:return[]}}function pE(n,r,l,a){const c=la(n);let s=mE(Hr(n),l==="start",a);return c&&(s=s.map(u=>u+"-"+c),r&&(s=s.concat(s.map(Wu)))),s}function ts(n){const r=Hr(n);return cE[r]+n.slice(r.length)}function gE(n){var r,l,a,c;return{top:(r=n.top)!=null?r:0,right:(l=n.right)!=null?l:0,bottom:(a=n.bottom)!=null?a:0,left:(c=n.left)!=null?c:0}}function hg(n){return typeof n!="number"?gE(n):{top:n,right:n,bottom:n,left:n}}function ns(n){const{x:r,y:l,width:a,height:c}=n;return{width:a,height:c,top:l,left:r,right:r+a,bottom:l+c,x:r,y:l}}function mg(n,r,l){let{reference:a,floating:c}=n;const s=Gn(r),u=Zu(r),h=Qu(u),g=Hr(r),m=s==="y",b=a.x+a.width/2-c.width/2,v=a.y+a.height/2-c.height/2,w=a[h]/2-c[h]/2;let C;switch(g){case"top":C={x:b,y:a.y-c.height};break;case"bottom":C={x:b,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:v};break;case"left":C={x:a.x-c.width,y:v};break;default:C={x:a.x,y:a.y}}const y=la(r);return y&&(C[u]+=w*(y==="end"?1:-1)*(l&&m?-1:1)),C}async function yE(n,r){var l;r===void 0&&(r={});const{x:a,y:c,platform:s,rects:u,elements:h,strategy:g}=n,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:w=!1,padding:C=0}=cr(r,n),y=hg(C),E=h[w?v==="floating"?"reference":"floating":v],R=ns(await s.getClippingRect({element:(l=await(s.isElement==null?void 0:s.isElement(E)))==null||l?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(h.floating)),boundary:m,rootBoundary:b,strategy:g})),N=v==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h.floating)),O=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},D=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:N,offsetParent:T,strategy:g}):N);return{top:(R.top-D.top+y.top)/O.y,bottom:(D.bottom-R.bottom+y.bottom)/O.y,left:(R.left-D.left+y.left)/O.x,right:(D.right-R.right+y.right)/O.x}}const vE=50,bE=async(n,r,l)=>{const{placement:a="bottom",strategy:c="absolute",middleware:s=[],platform:u}=l,h=u.detectOverflow?u:{...u,detectOverflow:yE},g=await(u.isRTL==null?void 0:u.isRTL(r));let m=await u.getElementRects({reference:n,floating:r,strategy:c}),{x:b,y:v}=mg(m,a,g),w=a,C=0;const y={};for(let S=0;S<s.length;S++){const E=s[S];if(!E)continue;const{name:R,fn:N}=E,{x:T,y:O,data:D,reset:M}=await N({x:b,y:v,initialPlacement:a,placement:w,strategy:c,middlewareData:y,rects:m,platform:h,elements:{reference:n,floating:r}});b=T??b,v=O??v,y[R]={...y[R],...D},M&&C<vE&&(C++,typeof M=="object"&&(M.placement&&(w=M.placement),M.rects&&(m=M.rects===!0?await u.getElementRects({reference:n,floating:r,strategy:c}):M.rects),{x:b,y:v}=mg(m,w,g)),S=-1)}return{x:b,y:v,placement:w,strategy:c,middlewareData:y}},xE=n=>({name:"arrow",options:n,async fn(r){const{x:l,y:a,placement:c,rects:s,platform:u,elements:h,middlewareData:g}=r,{element:m,padding:b=0}=cr(n,r)||{};if(m==null)return{};const v=hg(b),w={x:l,y:a},C=Zu(c),y=Qu(C),S=await u.getDimensions(m),E=C==="y",R=E?"top":"left",N=E?"bottom":"right",T=E?"clientHeight":"clientWidth",O=s.reference[y]+s.reference[C]-w[C]-s.floating[y],D=w[C]-s.reference[C],M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let z=M?M[T]:0;(!z||!await(u.isElement==null?void 0:u.isElement(M)))&&(z=h.floating[T]||s.floating[y]);const H=O/2-D/2,G=z/2-S[y]/2-1,X=kr(v[R],G),U=kr(v[N],G),F=z-S[y]-U,J=z/2-S[y]/2+H,I=ug(X,J,F),Y=!g.arrow&&la(c)!=null&&J!==I&&s.reference[y]/2-(J<X?X:U)-S[y]/2<0,k=Y?J<X?J-X:J-F:0;return{[C]:w[C]+k,data:{[C]:I,centerOffset:J-I-k,...Y&&{alignmentOffset:k}},reset:Y}}}),SE=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var l,a;const{placement:c,middlewareData:s,rects:u,initialPlacement:h,platform:g,elements:m}=r,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...E}=cr(n,r);if((l=s.arrow)!=null&&l.alignmentOffset)return{};const R=Hr(c),N=Gn(h),T=Hr(h)===h,O=await(g.isRTL==null?void 0:g.isRTL(m.floating)),D=w||(T||!S?[ts(h)]:dE(h)),M=y!=="none";!w&&M&&D.push(...pE(h,S,y,O));const z=[h,...D],H=await g.detectOverflow(r,E),G=[];let X=((a=s.flip)==null?void 0:a.overflows)||[];if(b&&G.push(H[R]),v){const I=uE(c,u,O);G.push(H[I[0]],H[I[1]])}if(X=[...X,{placement:c,overflows:G}],!G.every(I=>I<=0)){var U,F;const I=(((U=s.flip)==null?void 0:U.index)||0)+1,Y=z[I];if(Y&&(!(v==="alignment"?N!==Gn(Y):!1)||X.every(L=>Gn(L.placement)===N?L.overflows[0]>0:!0)))return{data:{index:I,overflows:X},reset:{placement:Y}};let k=(F=X.filter($=>$.overflows[0]<=0).sort(($,L)=>$.overflows[1]-L.overflows[1])[0])==null?void 0:F.placement;if(!k)switch(C){case"bestFit":{var J;const $=(J=X.filter(L=>{if(M){const Z=Gn(L.placement);return Z===N||Z==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Z=>Z>0).reduce((Z,A)=>Z+A,0)]).sort((L,Z)=>L[1]-Z[1])[0])==null?void 0:J[0];$&&(k=$);break}case"initialPlacement":k=h;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function pg(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function gg(n){return sE.some(r=>n[r]>=0)}const CE=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:l,platform:a}=r,{strategy:c="referenceHidden",...s}=cr(n,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...s,elementContext:"reference"}),h=pg(u,l.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gg(h)}}}case"escaped":{const u=await a.detectOverflow(r,{...s,altBoundary:!0}),h=pg(u,l.floating);return{data:{escapedOffsets:h,escaped:gg(h)}}}default:return{}}}}},yg=new Set(["left","top"]);async function wE(n,r){const{placement:l,platform:a,elements:c}=n,s=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Hr(l),h=la(l),g=Gn(l)==="y",m=yg.has(u)?-1:1,b=s&&g?-1:1,v=cr(r,n);let{mainAxis:w,crossAxis:C,alignmentAxis:y}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof y=="number"&&(C=h==="end"?y*-1:y),g?{x:C*b,y:w*m}:{x:w*m,y:C*b}}const EE=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var l,a;const{x:c,y:s,placement:u,middlewareData:h}=r,g=await wE(r,n);return u===((l=h.offset)==null?void 0:l.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:c+g.x,y:s+g.y,data:{...g,placement:u}}}}},TE=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:l,y:a,placement:c,platform:s}=r,{mainAxis:u=!0,crossAxis:h=!1,limiter:g={fn:N=>{let{x:T,y:O}=N;return{x:T,y:O}}},...m}=cr(n,r),b={x:l,y:a},v=await s.detectOverflow(r,m),w=Gn(c),C=Fu(w);let y=b[C],S=b[w];const E=(N,T)=>ug(T+v[N==="y"?"top":"left"],T,T-v[N==="y"?"bottom":"right"]);u&&(y=E(C,y)),h&&(S=E(w,S));const R=g.fn({...r,[C]:y,[w]:S});return{...R,data:{x:R.x-l,y:R.y-a,enabled:{[C]:u,[w]:h}}}}}},jE=function(n){return n===void 0&&(n={}),{options:n,fn(r){var l,a;const{x:c,y:s,placement:u,rects:h,middlewareData:g}=r,{offset:m=0,mainAxis:b=!0,crossAxis:v=!0}=cr(n,r),w={x:c,y:s},C=Gn(u),y=Fu(C);let S=w[y],E=w[C];const R=cr(m,r),N=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(a=R.crossAxis)!=null?a:0};if(b){const D=y==="y"?"height":"width",M=h.reference[y]-h.floating[D]+N.mainAxis,z=h.reference[y]+h.reference[D]-N.mainAxis;S<M?S=M:S>z&&(S=z)}if(v){var T,O;const D=y==="y"?"width":"height",M=yg.has(Hr(u)),z=h.reference[C]-h.floating[D]+(M&&((T=g.offset)==null?void 0:T[C])||0)+(M?0:N.crossAxis),H=h.reference[C]+h.reference[D]+(M?0:((O=g.offset)==null?void 0:O[C])||0)-(M?N.crossAxis:0);E<z?E=z:E>H&&(E=H)}return{[y]:S,[C]:E}}}},OE=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){const{placement:l,rects:a,platform:c,elements:s}=r,{apply:u=()=>{},...h}=cr(n,r),g=await c.detectOverflow(r,h),m=Hr(l),b=la(l),v=Gn(l)==="y",{width:w,height:C}=a.floating;let y,S;m==="top"||m==="bottom"?(y=m,S=b===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(S=m,y=b==="end"?"top":"bottom");const E=C-g.top-g.bottom,R=w-g.left-g.right,N=kr(C-g[y],E),T=kr(w-g[S],R),O=r.middlewareData.shift,D=!O;let M=N,z=T;O!=null&&O.enabled.x&&(z=R),O!=null&&O.enabled.y&&(M=E),D&&!b&&(v?z=w-2*lr(g.left,g.right):M=C-2*lr(g.top,g.bottom)),await u({...r,availableWidth:z,availableHeight:M});const H=await c.getDimensions(s.floating);return w!==H.width||C!==H.height?{reset:{rects:!0}}:{}}}};function rs(){return typeof window<"u"}function sa(n){return vg(n)?(n.nodeName||"").toLowerCase():"#document"}function Ft(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function ur(n){var r;return(r=(vg(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function vg(n){return rs()?n instanceof Node||n instanceof Ft(n).Node:!1}function Vn(n){return rs()?n instanceof Element||n instanceof Ft(n).Element:!1}function Br(n){return rs()?n instanceof HTMLElement||n instanceof Ft(n).HTMLElement:!1}function bg(n){return!rs()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ft(n).ShadowRoot}function os(n){const{overflow:r,overflowX:l,overflowY:a,display:c}=qn(n);return/auto|scroll|overlay|hidden|clip/.test(r+a+l)&&c!=="inline"&&c!=="contents"}function RE(n){return/^(table|td|th)$/.test(sa(n))}function as(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const NE=/transform|translate|scale|rotate|perspective|filter/,AE=/paint|layout|strict|content/,vo=n=>!!n&&n!=="none";let Ju;function ed(n){const r=Vn(n)?qn(n):n;return vo(r.transform)||vo(r.translate)||vo(r.scale)||vo(r.rotate)||vo(r.perspective)||!td()&&(vo(r.backdropFilter)||vo(r.filter))||NE.test(r.willChange||"")||AE.test(r.contain||"")}function ME(n){let r=bo(n);for(;Br(r)&&!xi(r);){if(ed(r))return r;if(as(r))return null;r=bo(r)}return null}function td(){return Ju==null&&(Ju=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ju}function xi(n){return/^(html|body|#document)$/.test(sa(n))}function qn(n){return Ft(n).getComputedStyle(n)}function is(n){return Vn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function bo(n){if(sa(n)==="html")return n;const r=n.assignedSlot||n.parentNode||bg(n)&&n.host||ur(n);return bg(r)?r.host:r}function xg(n){const r=bo(n);return xi(r)?(n.ownerDocument||n).body:Br(r)&&os(r)?r:xg(r)}function Si(n,r,l){var a;r===void 0&&(r=[]),l===void 0&&(l=!0);const c=xg(n),s=c===((a=n.ownerDocument)==null?void 0:a.body),u=Ft(c);if(s){const h=nd(u);return r.concat(u,u.visualViewport||[],os(c)?c:[],h&&l?Si(h):[])}else return r.concat(c,Si(c,[],l))}function nd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Sg(n){const r=qn(n);let l=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=Br(n),s=c?n.offsetWidth:l,u=c?n.offsetHeight:a,h=Jl(l)!==s||Jl(a)!==u;return h&&(l=s,a=u),{width:l,height:a,$:h}}function rd(n){return Vn(n)?n:n.contextElement}function ca(n){const r=rd(n);if(!Br(r))return sr(1);const l=r.getBoundingClientRect(),{width:a,height:c,$:s}=Sg(r);let u=(s?Jl(l.width):l.width)/a,h=(s?Jl(l.height):l.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const _E=sr(0);function Cg(n){const r=Ft(n);return!td()||!r.visualViewport?_E:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function DE(n,r,l){return r===void 0&&(r=!1),!!l&&r&&l===Ft(n)}function xo(n,r,l,a){r===void 0&&(r=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),s=rd(n);let u=sr(1);r&&(a?Vn(a)&&(u=ca(a)):u=ca(n));const h=DE(s,l,a)?Cg(s):sr(0);let g=(c.left+h.x)/u.x,m=(c.top+h.y)/u.y,b=c.width/u.x,v=c.height/u.y;if(s&&a){const w=Ft(s),C=Vn(a)?Ft(a):a;let y=w,S=nd(y);for(;S&&C!==y;){const E=ca(S),R=S.getBoundingClientRect(),N=qn(S),T=R.left+(S.clientLeft+parseFloat(N.paddingLeft))*E.x,O=R.top+(S.clientTop+parseFloat(N.paddingTop))*E.y;g*=E.x,m*=E.y,b*=E.x,v*=E.y,g+=T,m+=O,y=Ft(S),S=nd(y)}}return ns({width:b,height:v,x:g,y:m})}function ls(n,r){const l=is(n).scrollLeft;return r?r.left+l:xo(ur(n)).left+l}function wg(n,r){const l=n.getBoundingClientRect(),a=l.left+r.scrollLeft-ls(n,l),c=l.top+r.scrollTop;return{x:a,y:c}}function IE(n){let{elements:r,rect:l,offsetParent:a,strategy:c}=n;const s=c==="fixed",u=ur(a),h=r?as(r.floating):!1;if(a===u||h&&s)return l;let g={scrollLeft:0,scrollTop:0},m=sr(1);const b=sr(0),v=Br(a);if((v||!s)&&((sa(a)!=="body"||os(u))&&(g=is(a)),v)){const C=xo(a);m=ca(a),b.x=C.x+a.clientLeft,b.y=C.y+a.clientTop}const w=u&&!v&&!s?wg(u,g):sr(0);return{width:l.width*m.x,height:l.height*m.y,x:l.x*m.x-g.scrollLeft*m.x+b.x+w.x,y:l.y*m.y-g.scrollTop*m.y+b.y+w.y}}function zE(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function LE(n){const r=is(n),l=n.ownerDocument.body,a=lr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=lr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let s=-r.scrollLeft+ls(n);const u=-r.scrollTop;return qn(l).direction==="rtl"&&(s+=lr(n.clientWidth,l.clientWidth)-a),{width:a,height:c,x:s,y:u}}const kE=25;function HE(n,r,l){l===void 0&&(l="viewport");const a=l==="layoutViewport",c=Ft(n),s=ur(n),u=c.visualViewport;let h=s.clientWidth,g=s.clientHeight,m=0,b=0;if(u){const w=!td()||r==="fixed";a?w||(m=-u.offsetLeft,b=-u.offsetTop):(h=u.width,g=u.height,w&&(m=u.offsetLeft,b=u.offsetTop))}if(ls(s)<=0){const w=s.ownerDocument,C=w.body,y=getComputedStyle(C),S=w.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(s.clientWidth-C.clientWidth-S),R=getComputedStyle(s).scrollbarGutter==="stable both-edges"?E/2:E;R<=kE&&(h-=R)}return{width:h,height:g,x:m,y:b}}function BE(n,r){const l=xo(n,!0,r==="fixed"),a=l.top+n.clientTop,c=l.left+n.clientLeft,s=ca(n),u=n.clientWidth*s.x,h=n.clientHeight*s.y,g=c*s.x,m=a*s.y;return{width:u,height:h,x:g,y:m}}function Eg(n,r,l){let a;if(r==="viewport"||r==="layoutViewport")a=HE(n,l,r);else if(r==="document")a=LE(ur(n));else if(Vn(r))a=BE(r,l);else{const c=Cg(n);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return ns(a)}function UE(n,r){const l=r.get(n);if(l)return l;let a=Si(n,[],!1).filter(h=>Vn(h)&&sa(h)!=="body"),c=null;const s=qn(n).position==="fixed";let u=s?bo(n):n;for(;Vn(u)&&!xi(u);){const h=qn(u),g=ed(u),m=c?c.position:s?"fixed":"";!g&&(m==="fixed"||m==="absolute"&&h.position==="static")?a=a.filter(v=>v!==u):c=h,u=bo(u)}return r.set(n,a),a}function PE(n){let{element:r,boundary:l,rootBoundary:a,strategy:c}=n;const u=[...l==="clippingAncestors"?as(r)?[]:UE(r,this._c):[].concat(l),a],h=Eg(r,u[0],c);let g=h.top,m=h.right,b=h.bottom,v=h.left;for(let w=1;w<u.length;w++){const C=Eg(r,u[w],c);g=lr(C.top,g),m=kr(C.right,m),b=kr(C.bottom,b),v=lr(C.left,v)}return{width:m-v,height:b-g,x:v,y:g}}function $E(n){const{width:r,height:l}=Sg(n);return{width:r,height:l}}function GE(n,r,l){const a=Br(r),c=ur(r),s=l==="fixed",u=xo(n,!0,s,r);let h={scrollLeft:0,scrollTop:0};const g=sr(0);if((a||!s)&&((sa(r)!=="body"||os(c))&&(h=is(r)),a)){const w=xo(r,!0,s,r);g.x=w.x+r.clientLeft,g.y=w.y+r.clientTop}!a&&c&&(g.x=ls(c));const m=c&&!a&&!s?wg(c,h):sr(0),b=u.left+h.scrollLeft-g.x-m.x,v=u.top+h.scrollTop-g.y-m.y;return{x:b,y:v,width:u.width,height:u.height}}function od(n){return qn(n).position==="static"}function Tg(n,r){if(!Br(n)||qn(n).position==="fixed")return null;if(r)return r(n);let l=n.offsetParent;return ur(n)===l&&(l=l.ownerDocument.body),l}function jg(n,r){const l=Ft(n);if(as(n))return l;if(!Br(n)){let c=bo(n);for(;c&&!xi(c);){if(Vn(c)&&!od(c))return c;c=bo(c)}return l}let a=Tg(n,r);for(;a&&RE(a)&&od(a);)a=Tg(a,r);return a&&xi(a)&&od(a)&&!ed(a)?l:a||ME(n)||l}const VE=async function(n){const r=this.getOffsetParent||jg,l=this.getDimensions,a=await l(n.floating);return{reference:GE(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function qE(n){return qn(n).direction==="rtl"}const YE={convertOffsetParentRelativeRectToViewportRelativeRect:IE,getDocumentElement:ur,getClippingRect:PE,getOffsetParent:jg,getElementRects:VE,getClientRects:zE,getDimensions:$E,getScale:ca,isElement:Vn,isRTL:qE};function Og(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function XE(n,r,l){let a=null,c;const s=ur(n);function u(){var b;clearTimeout(c),(b=a)==null||b.disconnect(),a=null}function h(b,v){b===void 0&&(b=!1),v===void 0&&(v=1),u();const w=n.getBoundingClientRect(),{left:C,top:y,width:S,height:E}=w;if(b||r(),!S||!E)return;const R=es(y),N=es(s.clientWidth-(C+S)),T=es(s.clientHeight-(y+E)),O=es(C),M={rootMargin:-R+"px "+-N+"px "+-T+"px "+-O+"px",threshold:lr(0,kr(1,v))||1};let z=!0;function H(G){const X=G[0].intersectionRatio;if(!Og(w,n.getBoundingClientRect()))return h();if(X!==v){if(!z)return h();X?h(!1,X):c=setTimeout(()=>{h(!1,1e-7)},1e3)}z=!1}try{a=new IntersectionObserver(H,{...M,root:s.ownerDocument})}catch{a=new IntersectionObserver(H,M)}a.observe(n)}const g=Ft(n),m=()=>h(l);return g.addEventListener("resize",m),h(!0),()=>{g.removeEventListener("resize",m),u()}}function KE(n,r,l,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=a,m=rd(n),b=c||s?[...m?Si(m):[],...r?Si(r):[]]:[];b.forEach(R=>{c&&R.addEventListener("scroll",l),s&&R.addEventListener("resize",l)});const v=m&&h?XE(m,l,s):null;let w=-1,C=null;u&&(C=new ResizeObserver(R=>{let[N]=R;N&&N.target===m&&C&&r&&(C.unobserve(r),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var T;(T=C)==null||T.observe(r)})),l()}),m&&!g&&C.observe(m),r&&C.observe(r));let y,S=g?xo(n):null;g&&E();function E(){const R=xo(n);S&&!Og(S,R)&&l(),S=R,y=requestAnimationFrame(E)}return l(),()=>{var R;b.forEach(N=>{c&&N.removeEventListener("scroll",l),s&&N.removeEventListener("resize",l)}),v?.(),(R=C)==null||R.disconnect(),C=null,g&&cancelAnimationFrame(y)}}const FE=EE,QE=TE,ZE=SE,WE=OE,JE=CE,Rg=xE,eT=jE,tT=(n,r,l)=>{const a=new Map,c=l??{},s={...YE,...c.platform,_c:a};return bE(n,r,{...c,platform:s})};var nT=typeof document<"u",rT=function(){},ss=nT?x.useLayoutEffect:rT;function cs(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let l,a,c;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==r.length)return!1;for(a=l;a--!==0;)if(!cs(n[a],r[a]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(r).length)return!1;for(a=l;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=l;a--!==0;){const s=c[a];if(!(s==="_owner"&&n.$$typeof)&&!cs(n[s],r[s]))return!1}return!0}return n!==n&&r!==r}function Ng(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ag(n,r){const l=Ng(n);return Math.round(r*l)/l}function ad(n){const r=x.useRef(n);return ss(()=>{r.current=n}),r}function oT(n){n===void 0&&(n={});const{placement:r="bottom",strategy:l="absolute",middleware:a=[],platform:c,elements:{reference:s,floating:u}={},transform:h=!0,whileElementsMounted:g,open:m}=n,[b,v]=x.useState({x:0,y:0,strategy:l,placement:r,middlewareData:{},isPositioned:!1}),[w,C]=x.useState(a);cs(w,a)||C(a);const[y,S]=x.useState(null),[E,R]=x.useState(null),N=x.useCallback(L=>{L!==M.current&&(M.current=L,S(L))},[]),T=x.useCallback(L=>{L!==z.current&&(z.current=L,R(L))},[]),O=s||y,D=u||E,M=x.useRef(null),z=x.useRef(null),H=x.useRef(b),G=g!=null,X=ad(g),U=ad(c),F=ad(m),J=x.useCallback(()=>{if(!M.current||!z.current)return;const L={placement:r,strategy:l,middleware:w};U.current&&(L.platform=U.current),tT(M.current,z.current,L).then(Z=>{const A={...Z,isPositioned:F.current!==!1};I.current&&!cs(H.current,A)&&(H.current=A,Dr.flushSync(()=>{v(A)}))})},[w,r,l,U,F]);ss(()=>{m===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,v(L=>({...L,isPositioned:!1})))},[m]);const I=x.useRef(!1);ss(()=>(I.current=!0,()=>{I.current=!1}),[]),ss(()=>{if(O&&(M.current=O),D&&(z.current=D),O&&D){if(X.current)return X.current(O,D,J);J()}},[O,D,J,X,G]);const Y=x.useMemo(()=>({reference:M,floating:z,setReference:N,setFloating:T}),[N,T]),k=x.useMemo(()=>({reference:O,floating:D}),[O,D]),$=x.useMemo(()=>{const L={position:l,left:0,top:0};if(!k.floating)return L;const Z=Ag(k.floating,b.x),A=Ag(k.floating,b.y);return h?{...L,transform:"translate("+Z+"px, "+A+"px)",...Ng(k.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Z,top:A}},[l,h,k.floating,b.x,b.y]);return x.useMemo(()=>({...b,update:J,refs:Y,elements:k,floatingStyles:$}),[b,J,Y,k,$])}const aT=n=>{function r(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:a,padding:c}=typeof n=="function"?n(l):n;return a&&r(a)?a.current!=null?Rg({element:a.current,padding:c}).fn(l):{}:a?Rg({element:a,padding:c}).fn(l):{}}}},iT=(n,r)=>{const l=FE(n);return{name:l.name,fn:l.fn,options:[n,r]}},lT=(n,r)=>{const l=QE(n);return{name:l.name,fn:l.fn,options:[n,r]}},sT=(n,r)=>({fn:eT(n).fn,options:[n,r]}),cT=(n,r)=>{const l=ZE(n);return{name:l.name,fn:l.fn,options:[n,r]}},uT=(n,r)=>{const l=WE(n);return{name:l.name,fn:l.fn,options:[n,r]}},dT=(n,r)=>{const l=JE(n);return{name:l.name,fn:l.fn,options:[n,r]}},fT=(n,r)=>{const l=aT(n);return{name:l.name,fn:l.fn,options:[n,r]}};var hT=Object.defineProperty,mT=(n,r)=>hT(n,"name",{value:r,configurable:!0}),pT=x.forwardRef(mT(function(r,l){const{children:a,width:c=10,height:s=5,...u}=r;return f.jsx(He.svg,{...u,ref:l,width:c,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),gT=Object.defineProperty,dr=(n,r)=>gT(n,"name",{value:r,configurable:!0}),Mg={Partial:"partial"},_g={Optimized:"optimized",Always:"always"},Dg="Popper",[Ig,us]=vn(Dg),[yT,zg]=Ig(Dg),Lg=dr(n=>{const{__scopePopper:r,children:l}=n,[a,c]=x.useState(null),[s,u]=x.useState(void 0);return f.jsx(yT,{scope:r,anchor:a,onAnchorChange:c,placementState:s,setPlacementState:u,children:l})},"Popper"),vT="PopperAnchor",kg=x.forwardRef(dr(function(r,l){const{__scopePopper:a,virtualRef:c,...s}=r,u=zg(vT,a),h=x.useRef(null),g=u.onAnchorChange,m=x.useCallback(S=>{h.current=S,S&&g(S)},[g]),b=Ie(l,m),v=x.useRef(null);x.useEffect(()=>{if(!c)return;const S=v.current;v.current=c.current,S!==v.current&&g(v.current)});const w=u.placementState&&ds(u.placementState),C=w?.[0],y=w?.[1];return c?null:f.jsx(He.div,{"data-radix-popper-side":C,"data-radix-popper-align":y,...s,ref:b})},"PopperAnchor")),Hg="PopperContent",[bT,xT]=Ig(Hg),Bg=x.forwardRef(dr(function(r,l){const{__scopePopper:a,side:c="bottom",sideOffset:s=0,align:u="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:m=!0,collisionBoundary:b=[],collisionPadding:v=0,sticky:w=Mg.Partial,hideWhenDetached:C=!1,updatePositionStrategy:y=_g.Optimized,onPlaced:S,...E}=r,R=zg(Hg,a),[N,T]=x.useState(null),O=Ie(l,T),[D,M]=x.useState(null),z=bi(D),H=z?.width??0,G=z?.height??0,X=c+(u!=="center"?"-"+u:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},F=Array.isArray(b)?b:[b],J=F.length>0,I={padding:U,boundary:F.filter(Ug),altBoundary:J},{refs:Y,floatingStyles:k,placement:$,isPositioned:L,middlewareData:Z}=oT({strategy:"fixed",placement:X,whileElementsMounted:dr((...be)=>KE(...be,{animationFrame:y===_g.Always}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[iT({mainAxis:s+G,alignmentAxis:h}),m&&lT({mainAxis:!0,crossAxis:!1,...w===Mg.Partial?{limiter:sT()}:{},...I}),m&&cT({...I}),uT({...I,apply:dr(({elements:be,rects:de,availableWidth:Se,availableHeight:_e})=>{const{width:Ce,height:Ae}=de.reference,$e=be.floating.style;$e.setProperty("--radix-popper-available-width",`${Se}px`),$e.setProperty("--radix-popper-available-height",`${_e}px`),$e.setProperty("--radix-popper-anchor-width",`${Ce}px`),$e.setProperty("--radix-popper-anchor-height",`${Ae}px`)},"apply")}),D&&fT({element:D,padding:g}),ET({arrowWidth:H,arrowHeight:G}),C&&dT(J?{strategy:"referenceHidden",...I}:{strategy:"referenceHidden",padding:I.padding,altBoundary:I.altBoundary})]}),A=R.setPlacementState;it(()=>(A($),()=>{A(void 0)}),[$,A]);const[V,K]=ds($),ee=An(S);it(()=>{L&&ee?.()},[L,ee]);const le=Z.arrow?.x,ce=Z.arrow?.y,ie=Z.arrow?.centerOffset!==0,[ge,je]=x.useState();return it(()=>{N&&je(window.getComputedStyle(N).zIndex)},[N]),f.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:L?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(bT,{scope:a,placedSide:V,placedAlign:K,onArrowChange:M,arrowX:le,arrowY:ce,shouldHideArrow:ie,children:f.jsx(He.div,{"data-side":V,"data-align":K,...E,ref:O,style:{...E.style,animation:L?E.style?.animation:"none"}})})})},"PopperContent")),ST="PopperArrow",CT={top:"bottom",right:"left",bottom:"top",left:"right"},wT=x.forwardRef(dr(function(r,l){const{__scopePopper:a,...c}=r,s=xT(ST,a),u=CT[s.placedSide];return f.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:f.jsx(pT,{...c,ref:l,style:{...c.style,display:"block"}})})},"PopperArrow"));function Ug(n){return n!==null}dr(Ug,"isNotNull");var ET=dr(n=>({name:"transformOrigin",options:n,fn(r){const{placement:l,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,h=u?0:n.arrowWidth,g=u?0:n.arrowHeight,[m,b]=ds(l),v={start:"0%",center:"50%",end:"100%"}[b],w=(c.arrow?.x??0)+h/2,C=(c.arrow?.y??0)+g/2;let y="",S="";return m==="bottom"?(y=u?v:`${w}px`,S=`${-g}px`):m==="top"?(y=u?v:`${w}px`,S=`${a.floating.height+g}px`):m==="right"?(y=`${-g}px`,S=u?v:`${C}px`):m==="left"&&(y=`${a.floating.width+g}px`,S=u?v:`${C}px`),{data:{x:y,y:S}}}}),"transformOrigin");function ds(n){const[r,l="center"]=n.split("-");return[r,l]}dr(ds,"getSideAndAlignFromPlacement");var TT=Object.defineProperty,id=(n,r)=>TT(n,"name",{value:r,configurable:!0}),ld=!1;function Pg(){const[n,r]=x.useState(ld);return x.useEffect(()=>{ld||(ld=!0,r(!0))},[]),n}id(Pg,"useIsHydrated");var $g=po[" useSyncExternalStore ".trim().toString()];function Gg(){return()=>{}}id(Gg,"subscribe");function Vg(){return $g(Gg,()=>!0,()=>!1)}id(Vg,"useIsHydratedModern");var jT=typeof $g=="function"?Vg:Pg,OT=Object.defineProperty,So=(n,r)=>OT(n,"name",{value:r,configurable:!0}),sd="rovingFocusGroup.onEntryFocus",RT={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[cd,qg,NT]=Ul(fs),[AT,Yg]=vn(fs,[NT]),Xg={Vertical:"vertical",Horizontal:"horizontal"},MT={RTL:"rtl"},[_T,DT]=AT(fs),IT=x.forwardRef(So(function(r,l){return f.jsx(cd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(cd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(zT,{...r,ref:l})})})},"RovingFocusGroup")),zT=x.forwardRef(So(function(r,l){const{__scopeRovingFocusGroup:a,orientation:c,loop:s=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:m,onEntryFocus:b,preventScrollOnEntryFocus:v=!1,...w}=r,C=x.useRef(null),y=Ie(l,C),S=yi(u),[E,R]=tr({prop:h,defaultProp:g??null,onChange:m,caller:fs}),[N,T]=x.useState(!1),O=An(b),D=qg(a),M=x.useRef(!1),[z,H]=x.useState(0);return x.useEffect(()=>{const G=C.current;if(G)return G.addEventListener(sd,O),()=>G.removeEventListener(sd,O)},[O]),f.jsx(_T,{scope:a,orientation:c,dir:S,loop:s,currentTabStopId:E,onItemFocus:x.useCallback(G=>R(G),[R]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(G=>G+1),[]),onFocusableItemRemove:x.useCallback(()=>H(G=>G-1),[]),children:f.jsx(He.div,{tabIndex:N||z===0?-1:0,"data-orientation":c,...w,ref:y,style:{outline:"none",...r.style},onMouseDown:we(r.onMouseDown,()=>{M.current=!0}),onFocus:we(r.onFocus,G=>{const X=!M.current;if(G.target===G.currentTarget&&X&&!N){const U=new CustomEvent(sd,RT);if(G.currentTarget.dispatchEvent(U),!U.defaultPrevented){const F=D().filter($=>$.focusable),J=F.find($=>$.active),I=F.find($=>$.id===E),k=[J,I,...F].filter(Boolean).map($=>$.ref.current);ud(k,v)}}M.current=!1}),onBlur:we(r.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),LT="RovingFocusGroupItem",kT=x.forwardRef(So(function(r,l){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:s=!1,tabStopId:u,children:h,...g}=r,m=rr(),b=u||m,v=DT(LT,a),w=v.currentTabStopId===b,C=qg(a),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:E}=v,R=jT();return it(()=>{if(!(!R||!c))return y(),()=>S()},[R,c,y,S]),x.useEffect(()=>{if(!(R||!c))return y(),()=>S()},[R,c,y,S]),f.jsx(cd.ItemSlot,{scope:a,id:b,focusable:c,active:s,children:f.jsx(He.span,{tabIndex:w?0:-1,"data-orientation":v.orientation,...g,ref:l,onMouseDown:we(r.onMouseDown,N=>{c?v.onItemFocus(b):N.preventDefault()}),onFocus:we(r.onFocus,()=>v.onItemFocus(b)),onKeyDown:we(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){v.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const T=Fg(N,v.orientation,v.dir);if(T!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let D=C().filter(M=>M.focusable).map(M=>M.ref.current);if(T==="last")D.reverse();else if(T==="prev"||T==="next"){T==="prev"&&D.reverse();const M=D.indexOf(N.currentTarget);D=v.loop?Qg(D,M+1):D.slice(M+1)}setTimeout(()=>ud(D))}}),children:typeof h=="function"?h({isCurrentTabStop:w,hasTabStop:E!=null}):h})})},"RovingFocusGroupItem")),HT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Kg(n,r){return r!==MT.RTL?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}So(Kg,"getDirectionAwareKey");function Fg(n,r,l){const a=Kg(n.key,l);if(!(r===Xg.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===Xg.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return HT[a]}So(Fg,"getFocusIntent");function ud(n,r=!1){const l=document.activeElement;for(const a of n)if(a===l||(a.focus({preventScroll:r}),document.activeElement!==l))return}So(ud,"focusFirst");function Qg(n,r){return n.map((l,a)=>n[(r+a)%n.length])}So(Qg,"wrapArray");var BT=Object.defineProperty,UT=(n,r)=>BT(n,"name",{value:r,configurable:!0});function ua(n,[r,l]){return Math.min(l,Math.max(r,n))}UT(ua,"clamp");var PT=Object.defineProperty,Pt=(n,r)=>PT(n,"name",{value:r,configurable:!0}),Zg="Radio",[$T,Wg]=vn(Zg),[GT,hs]=$T(Zg);function Jg(n){const{__scopeRadio:r,checked:l=!1,children:a,disabled:c,form:s,name:u,onCheck:h,required:g,value:m="on",internal_do_not_use_render:b}=n,[v,w]=x.useState(null),[C,y]=x.useState(null),[S,E]=x.useState(null),R=v?!!s||!!v.closest("form"):!0,N={checked:l,disabled:c,required:g,name:u,form:s,value:m,control:v,setControl:w,userClick:S,onUserClick:E,isFormControl:R,bubbleInput:C,setBubbleInput:y,onCheck:Pt(()=>h?.(),"onCheck")};return f.jsx(GT,{scope:r,...N,children:ey(b)?b(N):a})}Pt(Jg,"RadioProvider");var VT="RadioTrigger",qT=x.forwardRef(Pt(function({__scopeRadio:r,onClick:l,...a},c){const{checked:s,disabled:u,value:h,setControl:g,onCheck:m,onUserClick:b,isFormControl:v,bubbleInput:w}=hs(VT,r),C=Ie(c,g);return f.jsx(He.button,{type:"button",role:"radio","aria-checked":s,"data-state":dd(s),"data-disabled":u?"":void 0,disabled:u,value:h,...a,ref:C,onClick:we(l,y=>{const S=y.isPropagationStopped();s||(b({hasConsumerStoppedPropagation:S}),m()),w&&v&&(S||y.stopPropagation())})})},"RadioTrigger")),YT="RadioIndicator",XT=x.forwardRef(Pt(function(r,l){const{__scopeRadio:a,forceMount:c,...s}=r,u=hs(YT,a);return f.jsx(Lr,{present:c||u.checked,children:f.jsx(He.span,{"data-state":dd(u.checked),"data-disabled":u.disabled?"":void 0,...s,ref:l})})},"RadioIndicator")),KT="RadioBubbleInput",FT=x.forwardRef(Pt(function({__scopeRadio:r,onClick:l,...a},c){const{control:s,checked:u,required:h,disabled:g,name:m,value:b,form:v,bubbleInput:w,setBubbleInput:C,userClick:y}=hs(KT,r),S=Ie(c,C),E=bi(s),R=x.useRef(!1),N=x.useRef(u),T=x.useRef(y),O=x.useRef(null);x.useEffect(()=>{const M=w;if(!M)return;const z=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(z,"checked").set;if(!G)return;const X=N.current!==u;N.current=u;const U=y!==null&&y!==T.current;if(T.current=y,U)O.current=X?null:y,X&&G.call(M,u),M.dispatchEvent(new Event("click",{bubbles:!y.hasConsumerStoppedPropagation}));else if(X){const F=O.current;O.current=null;const J=u&&F!==null;R.current=!0,G.call(M,u),M.dispatchEvent(new Event("click",{bubbles:!(J&&F.hasConsumerStoppedPropagation)})),R.current=!1}},[w,u,y]);const D=x.useRef(u);return f.jsx(He.input,{type:"radio","aria-hidden":!0,defaultChecked:D.current,required:h,disabled:g,name:m,value:b,form:v,...a,tabIndex:-1,ref:S,onClick:we(l,M=>{R.current&&M.stopPropagation()}),style:{...a.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function ey(n){return typeof n=="function"}Pt(ey,"isFunction");function dd(n){return n?"checked":"unchecked"}Pt(dd,"getState");var QT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fd="RadioGroup",[ZT,GM]=vn(fd,[Yg,Wg]),ty=Yg(),ms=Wg(),[WT,JT]=ZT(fd),ej=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,name:c,form:s,defaultValue:u,value:h,required:g=!1,disabled:m=!1,orientation:b,dir:v,loop:w=!0,onValueChange:C,...y}=r,S=ty(a),E=yi(v),[R,N]=tr({prop:h,defaultProp:u??null,onChange:C,caller:fd}),[T,O]=x.useState(null),D=Ie(l,O),M=x.useRef(R);return x.useEffect(()=>{const z=s?T?.ownerDocument.getElementById(s):T?.closest("form");if(z instanceof HTMLFormElement){const H=Pt(()=>N(M.current),"reset");return z.addEventListener("reset",H),()=>z.removeEventListener("reset",H)}},[T,s,N]),f.jsx(WT,{scope:a,name:c,form:s,required:g,disabled:m,value:R,onValueChange:N,children:f.jsx(IT,{asChild:!0,...S,orientation:b,dir:E,loop:w,children:f.jsx(He.div,{role:"radiogroup","aria-required":g,"aria-orientation":b,"data-disabled":m?"":void 0,dir:E,...y,ref:D})})})},"RadioGroup")),tj="RadioGroupItemProvider",nj="RadioGroupItemTrigger";function ny(n){const{__scopeRadioGroup:r,value:l,disabled:a,children:c,internal_do_not_use_render:s}=n,u=JT(tj,r),h=ms(r),g=u.disabled||a;return f.jsx(Jg,{...h,checked:u.value===l,disabled:g,required:u.required,name:u.name,form:u.form,value:l,onCheck:()=>u.onValueChange(l),internal_do_not_use_render:s,children:c})}Pt(ny,"RadioGroupItemProvider");var rj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ty(a),u=ms(a),{checked:h,disabled:g}=hs(nj,u.__scopeRadio),m=x.useRef(null),b=Ie(l,m),v=x.useRef(!1);return x.useEffect(()=>{const w=Pt(y=>{QT.includes(y.key)&&(v.current=!0)},"handleKeyDown"),C=Pt(()=>v.current=!1,"handleKeyUp");return document.addEventListener("keydown",w),document.addEventListener("keyup",C),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",C)}},[]),f.jsx(kT,{asChild:!0,...s,focusable:!g,active:h,children:f.jsx(qT,{...u,...c,ref:b,onKeyDown:we(c.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:we(c.onFocus,()=>{v.current&&m.current?.click()})})})},"RadioGroupItemTrigger")),oj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,value:c,disabled:s,...u}=r;return f.jsx(ny,{__scopeRadioGroup:a,value:c,disabled:s,internal_do_not_use_render:({isFormControl:h})=>f.jsxs(f.Fragment,{children:[f.jsx(rj,{...u,ref:l,__scopeRadioGroup:a}),h&&f.jsx(aj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),aj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ms(a);return f.jsx(FT,{...s,...c,ref:l})},"RadioGroupItemBubbleInput")),ij=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ms(a);return f.jsx(XT,{...s,...c,ref:l})},"RadioGroupIndicator")),lj=Object.defineProperty,Pe=(n,r)=>lj(n,"name",{value:r,configurable:!0}),ry={ItemAligned:"item-aligned",Popper:"popper"},sj={RTL:"rtl"},cj=[" ","Enter","ArrowUp","ArrowDown"],uj=[" ","Enter"],da="Select",[ps,gs,dj]=Ul(da),[Co,VM]=vn(da,[dj,us]),hd=us(),[fj,Ur]=Co(da),[hj,mj]=Co(da);function oy(n){const{__scopeSelect:r,children:l,open:a,defaultOpen:c,onOpenChange:s,value:u,defaultValue:h,onValueChange:g,dir:m,name:b,autoComplete:v,disabled:w,required:C,form:y,internal_do_not_use_render:S}=n,E=hd(r),[R,N]=x.useState(null),[T,O]=x.useState(null),[D,M]=x.useState(!1),z=yi(m),[H,G]=tr({prop:a,defaultProp:c??!1,onChange:s,caller:da}),[X,U]=tr({prop:u,defaultProp:h,onChange:g,caller:da}),F=x.useRef(null),J=x.useRef(!1),[I,Y]=x.useState(null),k=Pe(ie=>{Y({value:ie,hasConsumerStoppedPropagation:J.current}),U(ie)},"handleUserSelect"),$=x.useRef(X);x.useEffect(()=>{const ie=y?R?.ownerDocument.getElementById(y):R?.form;if(ie instanceof HTMLFormElement){const ge=Pe(()=>U($.current),"reset");return ie.addEventListener("reset",ge),()=>ie.removeEventListener("reset",ge)}},[y,R,U]);const L=R?!!y||!!R.closest("form"):!0,[Z,A]=x.useState(new Set),V=rr(),K=Array.from(Z).map(ie=>ie.props.value).join(";"),ee=x.useCallback(ie=>{A(ge=>new Set(ge).add(ie))},[]),le=x.useCallback(ie=>{A(ge=>{const je=new Set(ge);return je.delete(ie),je})},[]),ce={required:C,trigger:R,onTriggerChange:N,valueNode:T,onValueNodeChange:O,valueNodeHasChildren:D,onValueNodeHasChildrenChange:M,contentId:V,value:X,onValueChange:U,hasConsumerStoppedPropagationRef:J,userSelection:I,onUserSelect:k,open:H,onOpenChange:G,dir:z,triggerPointerDownPosRef:F,disabled:w,name:b,autoComplete:v,form:y,nativeOptions:Z,nativeSelectKey:K,isFormControl:L};return f.jsx(Lg,{...E,children:f.jsx(fj,{scope:r,...ce,children:f.jsx(ps.Provider,{scope:r,children:f.jsx(hj,{scope:r,onNativeOptionAdd:ee,onNativeOptionRemove:le,children:fy(S)?S(ce):l})})})})}Pe(oy,"SelectProvider");var pj=Pe(n=>{const{__scopeSelect:r,children:l,...a}=n;return f.jsx(oy,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[l,c?f.jsx(Yj,{__scopeSelect:r}):null]})})},"Select"),gj="SelectTrigger",yj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,disabled:c=!1,...s}=r,u=hd(a),h=Ur(gj,a),g=h.disabled||c,m=Ie(l,h.onTriggerChange),b=gs(a),v=x.useRef("touch"),[w,C,y]=gd(E=>{const R=b().filter(O=>!O.disabled),N=R.find(O=>O.value===h.value),T=yd(R,E,N);T!==void 0&&h.onUserSelect(T.value)}),S=Pe(E=>{g||(h.onOpenChange(!0),y()),E&&(h.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})},"handleOpen");return f.jsx(kg,{asChild:!0,...u,children:f.jsx(He.button,{type:"button",role:"combobox","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ci(h.value)?"":void 0,...s,ref:m,onClick:we(s.onClick,E=>{E.currentTarget.focus(),v.current!=="mouse"&&S(E)}),onPointerDown:we(s.onPointerDown,E=>{v.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:we(s.onKeyDown,E=>{const R=w.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&(h.hasConsumerStoppedPropagationRef.current=E.isPropagationStopped(),C(E.key)),!(R&&E.key===" ")&&cj.includes(E.key)&&(S(),E.preventDefault())})})})},"SelectTrigger")),vj="SelectValue",bj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,className:c,style:s,children:u,placeholder:h="",...g}=r,m=Ur(vj,a),{onValueNodeHasChildrenChange:b}=m,v=u!==void 0,w=Ie(l,m.onValueNodeChange);it(()=>{b(v)},[b,v]);const C=Ci(m.value);return f.jsx(He.span,{...g,asChild:C?!1:g.asChild,ref:w,style:{pointerEvents:"none"},children:f.jsx(x.Fragment,{children:C?h:u},C?"placeholder":"value")})},"SelectValue")),xj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,children:c,...s}=r;return f.jsx(He.span,{"aria-hidden":!0,...s,ref:l,children:c||"▼"})},"SelectIcon")),Sj="SelectPortal",[Cj,wj]=Co(Sj,{forceMount:void 0}),Ej=Pe(n=>{const{__scopeSelect:r,forceMount:l,...a}=n;return f.jsx(Cj,{scope:n.__scopeSelect,forceMount:l,children:f.jsx(Du,{asChild:!0,...a})})},"SelectPortal"),wo="SelectContent",Tj=x.forwardRef(Pe(function(r,l){const a=wj(wo,r.__scopeSelect),{forceMount:c=a.forceMount,...s}=r,u=Ur(wo,r.__scopeSelect),[h,g]=x.useState();return it(()=>{g(new DocumentFragment)},[]),f.jsx(Lr,{present:c||u.open,children:({present:m})=>m?f.jsx(Rj,{...s,ref:l}):f.jsx(jj,{...s,fragment:h})})},"SelectContent")),jj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,children:c,fragment:s}=r;return s?Dr.createPortal(f.jsx(ay,{scope:a,children:f.jsx(ps.Slot,{scope:a,children:f.jsx("div",{ref:l,children:c})})}),s):null},"SelectContentFragment")),Mn=10,[ay,Eo]=Co(wo),Oj=er("SelectContent.RemoveScroll"),Rj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a}=r,{position:c=ry.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:h,side:g,sideOffset:m,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:C,collisionPadding:y,sticky:S,hideWhenDetached:E,avoidCollisions:R,...N}=r,T=Ur(wo,a),[O,D]=x.useState(null),[M,z]=x.useState(null),H=Ie(l,D),[G,X]=x.useState(null),[U,F]=x.useState(null),J=gs(a),[I,Y]=x.useState(!1),k=x.useRef(!1),$=x.useRef(!1),L=x.useRef(!1);x.useEffect(()=>{if(O)return ng(O)},[O]),ql();const Z=x.useCallback(de=>{const[Se,..._e]=J().map($e=>$e.ref.current),[Ce]=_e.slice(-1),Ae=document.activeElement;for(const $e of de)if($e===Ae||($e?.scrollIntoView({block:"nearest"}),$e===Se&&M&&(M.scrollTop=0),$e===Ce&&M&&(M.scrollTop=M.scrollHeight),$e?.focus(),document.activeElement!==Ae))return},[J,M]),A=x.useCallback(()=>Z([G,O]),[Z,G,O]);x.useEffect(()=>{I&&A()},[I,A]);const{onOpenChange:V,triggerPointerDownPosRef:K}=T;x.useEffect(()=>{if(O){let de={x:0,y:0};const Se=Pe(Ce=>{de={x:Math.abs(Math.round(Ce.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(K.current?.y??0))}},"handlePointerMove"),_e=Pe(Ce=>{de.x<=10&&de.y<=10?Ce.preventDefault():Ce.composedPath().includes(O)||V(!1),document.removeEventListener("pointermove",Se),K.current=null},"handlePointerUp");return K.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",_e,{capture:!0})}}},[O,V,K]),x.useEffect(()=>{const de=Pe(()=>V(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[V]);const[ee,le]=gd(de=>{const Se=J().filter(Ae=>!Ae.disabled),_e=Se.find(Ae=>Ae.ref.current===document.activeElement),Ce=yd(Se,de,_e);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),ce=x.useCallback((de,Se,_e)=>{const Ce=!$.current;Ce&&($.current=!0);const Ae=!k.current&&!_e;T.value!==void 0&&T.value===Se||Ae?(X(de),Ae&&(k.current=!0)):Ce&&X(de)},[T.value]),ie=x.useCallback(()=>O?.focus(),[O]),ge=x.useCallback((de,Se,_e)=>{if(!de)return;const Ce=!L.current;Ce&&(L.current=!0);const Ae=!k.current&&!_e;(T.value!==void 0&&T.value===Se||Ae||Ce)&&F(de)},[T.value]),je=c===ry.Popper?iy:Nj,be=je===iy?{side:g,sideOffset:m,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:C,collisionPadding:y,sticky:S,hideWhenDetached:E,avoidCollisions:R}:{};return f.jsx(ay,{scope:a,content:O,viewport:M,onViewportChange:z,itemRefCallback:ce,selectedItem:G,onItemLeave:ie,itemTextRefCallback:ge,focusSelectedItem:A,selectedItemText:U,position:c,isPositioned:I,searchRef:ee,children:f.jsx(Uu,{as:Oj,allowPinchZoom:!0,children:f.jsx(Mp,{asChild:!0,trapped:T.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:we(s,de=>{T.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(je,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:de=>de.preventDefault(),...N,...be,onPlaced:()=>Y(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:we(N.onKeyDown,de=>{const Se=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Se&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let Ce=J().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(de.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Ae=de.target,$e=Ce.indexOf(Ae);Ce=Ce.slice($e+1)}setTimeout(()=>Z(Ce)),de.preventDefault()}})})})})})})},"SelectContentImpl")),Nj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,onPlaced:c,...s}=r,u=Ur(wo,a),h=Eo(wo,a),[g,m]=x.useState(null),[b,v]=x.useState(null),w=Ie(l,v),C=gs(a),y=x.useRef(!1),S=x.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:N,focusSelectedItem:T}=h,O=x.useCallback(()=>{if(u.trigger&&u.valueNode&&g&&b&&E&&R&&N){const H=u.trigger.getBoundingClientRect(),G=b.getBoundingClientRect(),X=u.valueNode.getBoundingClientRect(),U=N.getBoundingClientRect();if(u.dir!==sj.RTL){const _e=U.left-G.left,Ce=X.left-_e,Ae=H.left-Ce,$e=H.width+Ae,Dn=Math.max($e,G.width),jt=window.innerWidth-Mn,pe=ua(Ce,[Mn,Math.max(Mn,jt-Dn)]);g.style.minWidth=$e+"px",g.style.left=pe+"px"}else{const _e=G.right-U.right,Ce=window.innerWidth-X.right-_e,Ae=window.innerWidth-H.right-Ce,$e=H.width+Ae,Dn=Math.max($e,G.width),jt=window.innerWidth-Mn,pe=ua(Ce,[Mn,Math.max(Mn,jt-Dn)]);g.style.minWidth=$e+"px",g.style.right=pe+"px"}const F=C(),J=window.innerHeight-Mn*2,I=E.scrollHeight,Y=window.getComputedStyle(b),k=parseInt(Y.borderTopWidth,10),$=parseInt(Y.paddingTop,10),L=parseInt(Y.borderBottomWidth,10),Z=parseInt(Y.paddingBottom,10),A=k+$+I+Z+L,V=Math.min(R.offsetHeight*5,A),K=window.getComputedStyle(E),ee=parseInt(K.paddingTop,10),le=parseInt(K.paddingBottom,10),ce=H.top+H.height/2-Mn,ie=J-ce,ge=R.offsetHeight/2,je=R.offsetTop+ge,be=k+$+je,de=A-be;if(be<=ce){const _e=F.length>0&&R===F[F.length-1].ref.current;g.style.bottom="0px";const Ce=b.clientHeight-E.offsetTop-E.offsetHeight,Ae=Math.max(ie,ge+(_e?le:0)+Ce+L),$e=be+Ae;g.style.height=$e+"px"}else{const _e=F.length>0&&R===F[0].ref.current;g.style.top="0px";const Ae=Math.max(ce,k+E.offsetTop+(_e?ee:0)+ge)+de;g.style.height=Ae+"px",E.scrollTop=be-ce+E.offsetTop}g.style.margin=`${Mn}px 0`,g.style.minHeight=V+"px",g.style.maxHeight=J+"px",c?.(),requestAnimationFrame(()=>y.current=!0)}},[C,u.trigger,u.valueNode,g,b,E,R,N,u.dir,c]);it(()=>O(),[O]);const[D,M]=x.useState();it(()=>{b&&M(window.getComputedStyle(b).zIndex)},[b]);const z=x.useCallback(H=>{H&&S.current===!0&&(O(),T?.(),S.current=!1)},[O,T]);return f.jsx(Aj,{scope:a,contentWrapper:g,shouldExpandOnScrollRef:y,onScrollButtonChange:z,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:f.jsx(He.div,{...s,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),iy=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,align:c="start",collisionPadding:s=Mn,...u}=r,h=hd(a);return f.jsx(Bg,{...h,...u,ref:l,align:c,collisionPadding:s,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[Aj,md]=Co(wo,{}),ly="SelectViewport",Mj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,nonce:c,...s}=r,u=Eo(ly,a),h=md(ly,a),g=Ie(l,u.onViewportChange),m=x.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),f.jsx(ps.Slot,{scope:a,children:f.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:we(s.onScroll,b=>{const v=b.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:C}=h;if(C?.current&&w){const y=Math.abs(m.current-v.scrollTop);if(y>0){const S=window.innerHeight-Mn*2,E=parseFloat(w.style.minHeight),R=parseFloat(w.style.height),N=Math.max(E,R);if(N<S){const T=N+y,O=Math.min(S,T),D=T-O;w.style.height=O+"px",w.style.bottom==="0px"&&(v.scrollTop=D>0?D:0,w.style.justifyContent="flex-end")}}}m.current=v.scrollTop})})})]})},"SelectViewport")),_j="SelectGroup",[Dj,Ij]=Co(_j),zj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r,s=rr();return f.jsx(Dj,{scope:a,id:s,children:f.jsx(He.div,{role:"group","aria-labelledby":s,...c,ref:l})})},"SelectGroup")),Lj="SelectLabel",kj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r,s=Ij(Lj,a);return f.jsx(He.div,{id:s.id,...c,ref:l})},"SelectLabel")),pd="SelectItem",[Hj,sy]=Co(pd),Bj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,value:c,disabled:s=!1,textValue:u,...h}=r,g=Ur(pd,a),m=Eo(pd,a),b=g.value===c,[v,w]=x.useState(u??""),[C,y]=x.useState(!1),S=An(O=>m.itemRefCallback?.(O,c,s)),E=Ie(l,S),R=rr(),N=x.useRef("touch");function T(O){g.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),g.onUserSelect(c),g.onOpenChange(!1)}return Pe(T,"handleSelect"),f.jsx(Hj,{scope:a,value:c,disabled:s,textId:R,isSelected:b,onItemTextChange:x.useCallback(O=>{w(D=>D||(O?.textContent??"").trim())},[]),children:f.jsx(ps.ItemSlot,{scope:a,value:c,disabled:s,textValue:v,children:f.jsx(He.div,{role:"option","aria-labelledby":R,"data-highlighted":C?"":void 0,"aria-selected":b&&C,"data-state":b?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:E,onFocus:we(h.onFocus,()=>y(!0)),onBlur:we(h.onBlur,()=>y(!1)),onClick:we(h.onClick,O=>{s||N.current!=="mouse"&&T(O)}),onPointerUp:we(h.onPointerUp,O=>{s||N.current==="mouse"&&T(O)}),onPointerDown:we(h.onPointerDown,O=>{N.current=O.pointerType}),onPointerMove:we(h.onPointerMove,O=>{N.current=O.pointerType,s?m.onItemLeave?.():N.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(h.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:we(h.onKeyDown,O=>{s||O.target!==O.currentTarget||m.searchRef?.current!==""&&O.key===" "||(uj.includes(O.key)&&T(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),ys="SelectItemText",Uj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,className:c,style:s,...u}=r,h=Ur(ys,a),g=Eo(ys,a),m=sy(ys,a),b=mj(ys,a),[v,w]=x.useState(null),C=An(T=>g.itemTextRefCallback?.(T,m.value,m.disabled)),y=Ie(l,w,m.onItemTextChange,C),S=v?.textContent,E=x.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:S},m.value),[m.disabled,m.value,S]),{onNativeOptionAdd:R,onNativeOptionRemove:N}=b;return it(()=>(R(E),()=>N(E)),[R,N,E]),f.jsxs(f.Fragment,{children:[f.jsx(He.span,{id:m.textId,...u,ref:y}),m.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!Ci(h.value)?Dr.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Pj="SelectItemIndicator",$j=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r;return sy(Pj,a).isSelected?f.jsx(He.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),cy="SelectScrollUpButton",Gj=x.forwardRef(Pe(function(r,l){const a=Eo(cy,r.__scopeSelect),c=md(cy,r.__scopeSelect),[s,u]=x.useState(!1),h=Ie(l,c.onScrollButtonChange);return it(()=>{if(a.viewport&&a.isPositioned){let g=function(){const b=m.scrollTop>0;u(b)};Pe(g,"handleScroll");const m=a.viewport;return g(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,a.isPositioned]),s?f.jsx(dy,{...r,ref:h,onAutoScroll:()=>{const{viewport:g,selectedItem:m}=a;g&&m&&(g.scrollTop=g.scrollTop-m.offsetHeight)}}):null},"SelectScrollUpButton")),uy="SelectScrollDownButton",Vj=x.forwardRef(Pe(function(r,l){const a=Eo(uy,r.__scopeSelect),c=md(uy,r.__scopeSelect),[s,u]=x.useState(!1),h=Ie(l,c.onScrollButtonChange);return it(()=>{if(a.viewport&&a.isPositioned){let g=function(){const b=m.scrollHeight-m.clientHeight,v=Math.ceil(m.scrollTop)<b;u(v)};Pe(g,"handleScroll");const m=a.viewport;return g(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,a.isPositioned]),s?f.jsx(dy,{...r,ref:h,onAutoScroll:()=>{const{viewport:g,selectedItem:m}=a;g&&m&&(g.scrollTop=g.scrollTop+m.offsetHeight)}}):null},"SelectScrollDownButton")),dy=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,onAutoScroll:c,...s}=r,u=Eo("SelectScrollButton",a),h=x.useRef(null),g=gs(a),m=x.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),it(()=>{g().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[g]),f.jsx(He.div,{"aria-hidden":!0,...s,ref:l,style:{flexShrink:0,...s.style},onPointerDown:we(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:we(s.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:we(s.onPointerLeave,()=>{m()})})},"SelectScrollButtonImpl")),qj="SelectBubbleInput",Yj=x.forwardRef(Pe(function({__scopeSelect:r,...l},a){const c=Ur(qj,r),{value:s,onValueChange:u,required:h,disabled:g,name:m,autoComplete:b,form:v,userSelection:w}=c,{nativeOptions:C,nativeSelectKey:y}=c,S=x.useRef(null),E=Ie(a,S),R=s??"",N=x.useRef(R),T=x.useRef(w),O=x.useRef(!1),D=Array.from(C).some(M=>(M.props.value??"")==="");return x.useEffect(()=>{const M=S.current;if(!M)return;const z=window.HTMLSelectElement.prototype,G=Object.getOwnPropertyDescriptor(z,"value").set,X=w!==null&&w!==T.current;T.current=w;const U=N.current!==R;N.current=R;const F=X&&U;if(X&&!U&&w.value!==R&&!w.hasConsumerStoppedPropagation&&G){O.current=!0;try{G.call(M,w.value),M.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,G.call(M,R)}return}const J=F&&!w.hasConsumerStoppedPropagation;if(U&&G){const I=new Event("change",{bubbles:J});G.call(M,R),M.dispatchEvent(I)}},[R,w]),f.jsxs(He.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:m,autoComplete:b,disabled:g,form:v,onChange:M=>{O.current||u(M.target.value)},...l,style:{...rp,...l.style},ref:E,defaultValue:R,children:[Ci(s)&&!D?f.jsx("option",{value:""}):null,Array.from(C)]},y)},"SelectBubbleInput"));function fy(n){return typeof n=="function"}Pe(fy,"isFunction");function Ci(n){return n===""||n===void 0}Pe(Ci,"shouldShowPlaceholder");function gd(n){const r=An(n),l=x.useRef(""),a=x.useRef(0),c=x.useCallback(u=>{const h=l.current+u;r(h);function g(m){l.current=m,window.clearTimeout(a.current),m!==""&&(a.current=window.setTimeout(()=>g(""),1e3))}Pe(g,"updateSearch"),g(h)},[r]),s=x.useCallback(()=>{l.current="",window.clearTimeout(a.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[l,c,s]}Pe(gd,"useTypeaheadSearch");function yd(n,r,l){const c=r.length>1&&Array.from(r).every(m=>m===r[0])?r[0]:r,s=l?n.indexOf(l):-1;let u=hy(n,Math.max(s,0));c.length===1&&(u=u.filter(m=>m!==l));const g=u.find(m=>m.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}Pe(yd,"findNextItem");function hy(n,r){return n.map((l,a)=>n[(r+a)%n.length])}Pe(hy,"wrapArray");var Xj=Object.defineProperty,qe=(n,r)=>Xj(n,"name",{value:r,configurable:!0}),my={Horizontal:"horizontal"},Kj={LTR:"ltr"},py=["PageUp","PageDown"],gy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},wi="Slider",[vd,Fj,Qj]=Ul(wi),[bd,qM]=vn(wi,[Qj]),[Zj,fa]=bd(wi),Wj=x.forwardRef(qe(function(r,l){const{name:a,min:c=0,max:s=100,step:u=1,orientation:h=my.Horizontal,disabled:g=!1,minStepsBetweenThumbs:m=0,preserveThumbOrder:b=!1,defaultValue:v=[c],value:w,onValueChange:C=qe(()=>{},"onValueChange"),onValueCommit:y=qe(()=>{},"onValueCommit"),inverted:S=!1,form:E,...R}=r,N=x.useRef(new Set),T=x.useRef(0),O=x.useRef(!1),[D,M]=x.useState(null),H=h===my.Horizontal?Jj:eO,[G,X]=x.useState(null),U=Ie(l,X),[F=[],J]=tr({prop:w,defaultProp:v,onChange:qe(A=>{[...N.current][T.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,C(A)},"onChange")}),I=x.useRef(F),Y=x.useRef(F);x.useEffect(()=>{const A=E?G?.ownerDocument.getElementById(E):G?.closest("form");if(A instanceof HTMLFormElement){const V=qe(()=>J(Y.current),"reset");return A.addEventListener("reset",V),()=>A.removeEventListener("reset",V)}},[G,E,J]);function k(A){const V=Oy(F,A);Z(A,V)}qe(k,"handleSlideStart");function $(A){Z(A,T.current)}qe($,"handleSlideMove");function L(){String(F)!==String(I.current)&&y(F)}qe(L,"handleSlideEnd");function Z(A,V,{commit:K}={commit:!1}){const ee=Cd(u),le=Ei(Math.round((A-c)/u)*u+c,ee),ce=ua(le,[c,s]),ie=m*u;function ge(be){const de=b?ua(ce,[be[V-1]===void 0?c:be[V-1]+ie,be[V+1]===void 0?s:be[V+1]-ie]):ce,Se=Ty(be,de,V);return Ay(Se,ie)?{nextValues:Se,changedIndex:b?V:Se.indexOf(de),hasChanged:String(Se)!==String(be)}:null}qe(ge,"getNextValues");const je=ge(F);je?.hasChanged&&M(je.nextValues),J((be=[])=>{const de=ge(be);return de?(T.current=de.changedIndex,de.hasChanged&&K&&y(de.nextValues),de.hasChanged?de.nextValues:be):be})}return qe(Z,"updateValues"),f.jsx(Zj,{scope:r.__scopeSlider,name:a,disabled:g,min:c,max:s,valueIndexToChangeRef:T,thumbs:N.current,values:F,orientation:h,form:E,userRequestedValues:D,children:f.jsx(vd.Provider,{scope:r.__scopeSlider,children:f.jsx(vd.Slot,{scope:r.__scopeSlider,children:f.jsx(H,{"aria-disabled":g,"data-disabled":g?"":void 0,...R,ref:U,onPointerDown:we(R.onPointerDown,()=>{g||(I.current=F,O.current=!1)}),min:c,max:s,inverted:S,onSlideStart:g?void 0:k,onSlideMove:g?void 0:$,onSlideEnd:g?void 0:L,onHomeKeyDown:()=>{g||(O.current=!0,Z(c,0,{commit:!0}))},onEndKeyDown:()=>{g||(O.current=!0,Z(s,F.length-1,{commit:!0}))},onStepKeyDown:({event:A,direction:V})=>{if(!g){O.current=!0;const le=py.includes(A.key)||A.shiftKey&&gy.includes(A.key)?10:1,ce=T.current,ie=F[ce],ge=My(ie,{min:c,step:u,direction:V,multiplier:le});Z(ge,ce,{commit:!0})}}})})})})},"Slider")),[vy,by]=bd(wi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Jj=x.forwardRef(qe(function(r,l){const{min:a,max:c,dir:s,inverted:u,onSlideStart:h,onSlideMove:g,onSlideEnd:m,onStepKeyDown:b,...v}=r,[w,C]=x.useState(null),y=Ie(l,C),S=x.useRef(void 0),E=yi(s),R=E===Kj.LTR,N=R&&!u||!R&&u;function T(O){const D=S.current||w.getBoundingClientRect(),M=[0,D.width],H=vs(M,N?[a,c]:[c,a]);return S.current=D,H(O-D.left)}return qe(T,"getValueFromPointer"),f.jsx(vy,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:f.jsx(xy,{dir:E,"data-orientation":"horizontal",...v,ref:y,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const D=T(O.clientX);h?.(D)},onSlideMove:O=>{const D=T(O.clientX);g?.(D)},onSlideEnd:()=>{S.current=void 0,m?.()},onStepKeyDown:O=>{const M=yy[N?"from-left":"from-right"].includes(O.key);b?.({event:O,direction:M?-1:1})}})})},"SliderHorizontal")),eO=x.forwardRef(qe(function(r,l){const{min:a,max:c,inverted:s,onSlideStart:u,onSlideMove:h,onSlideEnd:g,onStepKeyDown:m,...b}=r,v=x.useRef(null),w=Ie(l,v),C=x.useRef(void 0),y=!s;function S(E){const R=C.current||v.current.getBoundingClientRect(),N=[0,R.height],O=vs(N,y?[c,a]:[a,c]);return C.current=R,O(E-R.top)}return qe(S,"getValueFromPointer"),f.jsx(vy,{scope:r.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:f.jsx(xy,{"data-orientation":"vertical",...b,ref:w,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:E=>{const R=S(E.clientY);u?.(R)},onSlideMove:E=>{const R=S(E.clientY);h?.(R)},onSlideEnd:()=>{C.current=void 0,g?.()},onStepKeyDown:E=>{const N=yy[y?"from-bottom":"from-top"].includes(E.key);m?.({event:E,direction:N?-1:1})}})})},"SliderVertical")),xy=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,onSlideStart:c,onSlideMove:s,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:g,onStepKeyDown:m,...b}=r,v=fa(wi,a);return f.jsx(He.span,{...b,ref:l,onKeyDown:we(r.onKeyDown,w=>{w.key==="Home"?(h(w),w.preventDefault()):w.key==="End"?(g(w),w.preventDefault()):py.concat(gy).includes(w.key)&&(m(w),w.preventDefault())}),onPointerDown:we(r.onPointerDown,w=>{const C=w.target;C.setPointerCapture(w.pointerId),w.preventDefault(),v.thumbs.has(C)?C.focus({preventScroll:!0,focusVisible:!1}):c(w)}),onPointerMove:we(r.onPointerMove,w=>{w.target.hasPointerCapture(w.pointerId)&&s(w)}),onPointerUp:we(r.onPointerUp,w=>{const C=w.target;C.hasPointerCapture(w.pointerId)&&(C.releasePointerCapture(w.pointerId),u(w))})})},"SliderImpl")),tO="SliderTrack",nO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(tO,a);return f.jsx(He.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...c,ref:l})},"SliderTrack")),Sy="SliderRange",rO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(Sy,a),u=by(Sy,a),h=x.useRef(null),g=Ie(l,h),m=s.values.length,b=s.values.map(C=>Sd(C,s.min,s.max)),v=m>1?Math.min(...b):0,w=100-Math.max(...b);return f.jsx(He.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...c,ref:g,style:{...r.style,[u.startEdge]:v+"%",[u.endEdge]:w+"%"}})},"SliderRange")),oO="SliderThumb",[aO,Cy]=bd(oO),iO="SliderThumbProvider";function wy(n){const{__scopeSlider:r,name:l,children:a,internal_do_not_use_render:c}=n,s=fa(iO,r),u=Fj(r),[h,g]=x.useState(null),m=x.useMemo(()=>h?u().findIndex(E=>E.ref.current===h):-1,[u,h]),b=bi(h),v=h?!!s.form||!!h.closest("form"):!0,w=s.values[m],C=l??(s.name?s.name+(s.values.length>1?"[]":""):void 0),y=w===void 0?0:Sd(w,s.min,s.max);x.useEffect(()=>{if(h)return s.thumbs.add(h),()=>{s.thumbs.delete(h)}},[h,s.thumbs]);const S={value:w,name:C,form:s.form,isFormControl:v,index:m,thumb:h,onThumbChange:g,percent:y,size:b};return f.jsx(aO,{scope:r,...S,children:_y(c)?c(S):a})}qe(wy,"SliderThumbProvider");var xd="SliderThumbTrigger",lO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(xd,a),u=by(xd,a),{index:h,value:g,percent:m,size:b,onThumbChange:v}=Cy(xd,a),w=Ie(l,v),C=jy(h,s.values.length),y=b?.[u.size],S=y?Ry(y,m,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${m}% + ${S}px)`},children:f.jsx(vd.ItemSlot,{scope:a,children:f.jsx(He.span,{role:"slider","aria-label":r["aria-label"]||C,"aria-valuemin":s.min,"aria-valuenow":g,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...c,ref:w,style:g===void 0?{display:"none"}:r.style,onFocus:we(r.onFocus,()=>{s.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),sO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,name:c,...s}=r;return f.jsx(wy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>f.jsxs(f.Fragment,{children:[f.jsx(lO,{...s,ref:l,__scopeSlider:a}),h?f.jsx(cO,{__scopeSlider:a},u):null]})})},"SliderThumb")),Ey="SliderBubbleInput",cO=x.forwardRef(qe(function({__scopeSlider:r,onInput:l,...a},c){const{index:s,value:u,name:h,form:g}=Cy(Ey,r),{userRequestedValues:m}=fa(Ey,r),b=x.useRef(null),v=Ie(b,c),w=x.useRef(!1),C=x.useRef(u),y=x.useRef(m),S=x.useRef(m);return x.useEffect(()=>{const E=b.current;if(!E)return;const R=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(R,"value").set,O=C.current,D=O!==u;C.current=u;const M=m!==S.current;if(S.current=m,D&&T){const z=m!==y.current;y.current=m;const H=m?.[s],G=z&&(M&&H!==O||H===u);w.current=!G;const X=new Event("input",{bubbles:!0});T.call(E,u),E.dispatchEvent(X),w.current=!1}},[s,u,m]),f.jsx(He.input,{style:{display:"none"},name:h,form:g,...a,ref:v,defaultValue:u,onInput:we(l,E=>{w.current&&E.stopPropagation()})})},"SliderBubbleInput"));function Ty(n=[],r,l){const a=[...n];return a[l]=r,a.sort((c,s)=>c-s)}qe(Ty,"getNextSortedValues");function Sd(n,r,l){const s=100/(l-r)*(n-r);return ua(s,[0,100])}qe(Sd,"convertValueToPercentage");function jy(n,r){return r>2?`Value ${n+1} of ${r}`:r===2?["Minimum","Maximum"][n]:void 0}qe(jy,"getLabel");function Oy(n,r){if(n.length===1)return 0;const l=n.map(c=>Math.abs(c-r)),a=Math.min(...l);return l.indexOf(a)}qe(Oy,"getClosestValueIndex");function Ry(n,r,l){const a=n/2,s=vs([0,50],[0,a]);return(a-s(r)*l)*l}qe(Ry,"getThumbInBoundsOffset");function Ny(n){return n.slice(0,-1).map((r,l)=>n[l+1]-r)}qe(Ny,"getStepsBetweenValues");function Ay(n,r){if(r>0){const l=Ny(n);return Math.min(...l)>=r}return!0}qe(Ay,"hasMinStepsBetweenValues");function vs(n,r){return l=>{if(n[0]===n[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(n[1]-n[0]);return r[0]+a*(l-n[0])}}qe(vs,"linearScale");function Cd(n){if(!Number.isFinite(n))return 0;const r=n.toString();if(r.includes("e")){const[a,c]=r.split("e"),s=a.split(".")[1]||"",u=Number(c);return Math.max(0,s.length-u)}const l=r.split(".")[1];return l?l.length:0}qe(Cd,"getDecimalCount");function Ei(n,r){const l=Math.pow(10,r);return Math.round(n*l)/l}qe(Ei,"roundValue");function My(n,{min:r,step:l,direction:a,multiplier:c}){const s=Cd(l),u=(n-r)/l,h=Math.round(u),g=Ei(h*l+r,s)===Ei(n,s);let m;return g?m=h+c*a:a>0?m=Math.ceil(u):m=Math.floor(u),Ei(m*l+r,s)}qe(My,"getNextStepValue");function _y(n){return typeof n=="function"}qe(_y,"isFunction");var uO=Object.defineProperty,bt=(n,r)=>uO(n,"name",{value:r,configurable:!0}),[wd,YM]=vn("Tooltip",[us]),bs=us(),dO="TooltipProvider",fO=700,Ed="tooltip.open",[hO,Td]=wd(dO),mO=bt(n=>{const{__scopeTooltip:r,delayDuration:l=fO,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:s}=n,u=x.useRef(!0),h=x.useRef(!1),g=x.useRef(0);return x.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),f.jsx(hO,{scope:r,isOpenDelayedRef:u,delayDuration:l,onOpen:x.useCallback(()=>{a<=0||(window.clearTimeout(g.current),u.current=!1)},[a]),onClose:x.useCallback(()=>{a<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(m=>{h.current=m},[]),disableHoverableContent:c,children:s})},"TooltipProvider"),jd="Tooltip",[pO,Ti]=wd(jd),gO=bt(n=>{const{__scopeTooltip:r,children:l,open:a,defaultOpen:c,onOpenChange:s,disableHoverableContent:u,delayDuration:h}=n,g=Td(jd,n.__scopeTooltip),m=bs(r),[b,v]=x.useState(null),[w,C]=x.useState(void 0),y=rr(),S=x.useRef(0),E=u??g.disableHoverableContent,R=h??g.delayDuration,N=x.useRef(!1),[T,O]=tr({prop:a,defaultProp:c??!1,onChange:bt(X=>{X?(g.onOpen(),document.dispatchEvent(new CustomEvent(Ed))):g.onClose(),s?.(X)},"onChange"),caller:jd}),D=x.useMemo(()=>T?N.current?"delayed-open":"instant-open":"closed",[T]),M=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N.current=!1,O(!0)},[O]),z=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),H=x.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{N.current=!0,O(!0),S.current=0},R)},[R,O]);x.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const G=w??y;return f.jsx(Lg,{...m,children:f.jsx(pO,{scope:r,contentId:G,setContentId:C,open:T,stateAttribute:D,trigger:b,onTriggerChange:v,onTriggerEnter:x.useCallback(()=>{g.isOpenDelayedRef.current?H():M()},[g.isOpenDelayedRef,H,M]),onTriggerLeave:x.useCallback(()=>{E?z():(window.clearTimeout(S.current),S.current=0)},[z,E]),onOpen:M,onClose:z,disableHoverableContent:E,children:l})})},"Tooltip"),Dy="TooltipTrigger",yO=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,"aria-describedby":c,...s}=r,u=Ti(Dy,a),h=Td(Dy,a),g=bs(a),m=x.useRef(null),b=Ie(l,m,u.onTriggerChange),v=x.useRef(!1),w=x.useRef(!1),C=x.useCallback(()=>v.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",C),[C]),f.jsx(kg,{asChild:!0,...g,children:f.jsx(He.button,{"aria-describedby":u.open?$y(c,u.contentId):c,"data-state":u.stateAttribute,...s,ref:b,onPointerMove:we(r.onPointerMove,y=>{y.pointerType!=="touch"&&!w.current&&!h.isPointerInTransitRef.current&&(u.onTriggerEnter(),w.current=!0)}),onPointerLeave:we(r.onPointerLeave,()=>{u.onTriggerLeave(),w.current=!1}),onPointerDown:we(r.onPointerDown,()=>{u.open&&u.onClose(),v.current=!0,document.addEventListener("pointerup",C,{once:!0})}),onFocus:we(r.onFocus,()=>{v.current||u.onOpen()}),onBlur:we(r.onBlur,u.onClose),onClick:we(r.onClick,u.onClose)})})},"TooltipTrigger")),Iy="TooltipPortal",[vO,bO]=wd(Iy,{forceMount:void 0}),xO=bt(n=>{const{__scopeTooltip:r,forceMount:l,children:a,container:c}=n,s=Ti(Iy,r);return f.jsx(vO,{scope:r,forceMount:l,children:f.jsx(Lr,{present:l||s.open,children:f.jsx(Du,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),ji="TooltipContent",SO=x.forwardRef(bt(function(r,l){const a=bO(ji,r.__scopeTooltip),{forceMount:c=a.forceMount,side:s="top",...u}=r,h=Ti(ji,r.__scopeTooltip);return f.jsx(Lr,{present:c||h.open,children:h.disableHoverableContent?f.jsx(zy,{side:s,...u,ref:l}):f.jsx(CO,{side:s,...u,ref:l})})},"TooltipContent")),CO=x.forwardRef(bt(function(r,l){const a=Ti(ji,r.__scopeTooltip),c=Td(ji,r.__scopeTooltip),s=x.useRef(null),u=Ie(l,s),[h,g]=x.useState(null),{trigger:m,onClose:b}=a,v=s.current,{onPointerInTransitChange:w}=c,C=x.useCallback(()=>{g(null),w(!1)},[w]),y=x.useCallback((S,E)=>{const R=S.currentTarget,N={x:S.clientX,y:S.clientY},T=Ly(N,R.getBoundingClientRect()),O=ky(N,T),D=Hy(E.getBoundingClientRect()),M=Uy([...O,...D]);g(M),w(!0)},[w]);return x.useEffect(()=>()=>C(),[C]),x.useEffect(()=>{if(m&&v){const S=bt(R=>y(R,v),"handleTriggerLeave"),E=bt(R=>y(R,m),"handleContentLeave");return m.addEventListener("pointerleave",S),v.addEventListener("pointerleave",E),()=>{m.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",E)}}},[m,v,y,C]),x.useEffect(()=>{if(h){const S=bt(E=>{const R=E.target,N={x:E.clientX,y:E.clientY},T=m?.contains(R)||v?.contains(R),O=!By(N,h);T?C():O&&(C(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[m,v,h,b,C]),f.jsx(zy,{...r,ref:u})},"TooltipContentHoverable")),wO=Fm("TooltipContent"),zy=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,children:c,"aria-label":s,id:u,onEscapeKeyDown:h,onPointerDownOutside:g,...m}=r,b=Ti(ji,a),v=bs(a),{onClose:w}=b,[C,y]=x.useState(null),S=Ie(l,y);zp(C),x.useEffect(()=>(document.addEventListener(Ed,w),()=>document.removeEventListener(Ed,w)),[w]),x.useEffect(()=>{if(b.trigger){const R=bt(N=>{N.target instanceof Node&&N.target.contains(b.trigger)&&w()},"handleScroll");return window.addEventListener("scroll",R,{capture:!0}),()=>window.removeEventListener("scroll",R,{capture:!0})}},[b.trigger,w]);const{setContentId:E}=b;return it(()=>(E(u),()=>{E(void 0)}),[u,E]),f.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:R=>R.preventDefault(),onDismiss:w,children:f.jsxs(Bg,{"data-state":b.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:b.contentId,...v,...m,ref:S,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(wO,{children:c}),s?f.jsx(x1,{id:b.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),EO=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,...c}=r,s=bs(a);return f.jsx(wT,{...s,...c,ref:l})},"TooltipArrow"));function Ly(n,r){const l=Math.abs(r.top-n.y),a=Math.abs(r.bottom-n.y),c=Math.abs(r.right-n.x),s=Math.abs(r.left-n.x);switch(Math.min(l,a,c,s)){case s:return"left";case c:return"right";case l:return"top";case a:return"bottom";default:throw new Error("unreachable")}}bt(Ly,"getExitSideFromRect");function ky(n,r,l=5){const a=[];switch(r){case"top":a.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":a.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":a.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":a.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return a}bt(ky,"getPaddedExitPoints");function Hy(n){const{top:r,right:l,bottom:a,left:c}=n;return[{x:c,y:r},{x:l,y:r},{x:l,y:a},{x:c,y:a}]}bt(Hy,"getPointsFromRect");function By(n,r){const{x:l,y:a}=n;let c=!1;for(let s=0,u=r.length-1;s<r.length;u=s++){const h=r[s],g=r[u],m=h.x,b=h.y,v=g.x,w=g.y;b>a!=w>a&&l<(v-m)*(a-b)/(w-b)+m&&(c=!c)}return c}bt(By,"isPointInPolygon");function Uy(n){const r=n.slice();return r.sort((l,a)=>l.x<a.x?-1:l.x>a.x?1:l.y<a.y?-1:l.y>a.y?1:0),Py(r)}bt(Uy,"getHull");function Py(n){if(n.length<=1)return n.slice();const r=[];for(let a=0;a<n.length;a++){const c=n[a];for(;r.length>=2;){const s=r[r.length-1],u=r[r.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const l=[];for(let a=n.length-1;a>=0;a--){const c=n[a];for(;l.length>=2;){const s=l[l.length-1],u=l[l.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))l.pop();else break}l.push(c)}return l.pop(),r.length===1&&l.length===1&&r[0].x===l[0].x&&r[0].y===l[0].y?r:r.concat(l)}bt(Py,"getHullPresorted");function $y(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}bt($y,"concatAriaDescribedby");function TO({delayDuration:n=0,...r}){return f.jsx(mO,{"data-slot":"tooltip-provider",delayDuration:n,...r})}function jO({...n}){return f.jsx(gO,{"data-slot":"tooltip",...n})}function OO({...n}){return f.jsx(yO,{"data-slot":"tooltip-trigger",...n})}function RO({container:n,className:r,sideOffset:l=0,children:a,...c}){return f.jsx(xO,{container:n,children:f.jsxs(SO,{"data-slot":"tooltip-content",sideOffset:l,className:Ve("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(EO,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function Gy(n){return n?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function NO({children:n}){return f.jsx(TO,{delayDuration:400,children:n})}const AO={"portal-wrapper":"_portal-wrapper_1eief_1"},MO={footer:"_footer_yp9z4_1"};/**
90
+ * @license lucide-react v1.58.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const _O=n=>n?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
95
+ * @license lucide-react v1.58.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */function DO(n,r,l=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:_O(n),size:24,node:r,...l.length>0?{aliases:l}:{}}}/**
100
+ * @license lucide-react v1.58.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const IO=n=>{let r="",l=!1;for(const a of n){if(a==="-"||a==="_"||a<=" "){l=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=l?a.toUpperCase():a,l=!1}return r};/**
105
+ * @license lucide-react v1.58.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const zO=n=>{const r=IO(n);return r.charAt(0).toUpperCase()+r.slice(1)};/**
110
+ * @license lucide-react v1.58.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Od=(...n)=>n.filter((r,l,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===l).join(" ").trim();/**
115
+ * @license lucide-react v1.58.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const To={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
120
+ * @license lucide-react v1.58.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */function Rd(n){return n!=null}function LO(n,r={}){const l=r.attributeNames??{},a=w=>l[w]??w,c=n.size??n.width??To.width,s=n.size??n.height??To.height,u=n.aliases?.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`)??[],h=[...n.name?[`lucide-${n.name}`]:[],...u],g=r.className?.split(" ").filter(Boolean)??[],m=r.includeDefaultClasses===!1?Od(...g):Od("lucide",...h,...g),b=r.absoluteStrokeWidth?Number(r.strokeWidth??To["stroke-width"])*Number(n.size??n.width??To.width)/Number(r.size??r.width??To.width):r.strokeWidth??To["stroke-width"];return["svg",{...Object.entries(To).reduce((w,[C,y])=>(w[a(C)]=y,w),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Rd(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Rd(r.width)&&{[a("width")]:r.width},..."height"in r&&Rd(r.height)&&{[a("height")]:r.height},[a("stroke-width")]:b,...m&&{[a("class")]:m},[a("viewBox")]:`0 0 ${c} ${s}`,...r.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in r&&r.attributes},n.node.map(w=>{const[C,y,S]=w,E=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...y}:y;return S?[C,E,S]:[C,E]})]}/**
125
+ * @license lucide-react v1.58.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */function kO(n,r={}){return LO(n,{...r,attributeNames:{...r.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
130
+ * @license lucide-react v1.58.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const HO=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},BO=x.createContext({}),UO=()=>x.useContext(BO),PO=x.forwardRef(({color:n,size:r,width:l,height:a,strokeWidth:c,absoluteStrokeWidth:s,nonScalingStroke:u,className:h="",children:g,iconNode:m=[],icon:b={node:m,aliases:[],size:24},...v},w)=>{const{size:C=24,strokeWidth:y=2,absoluteStrokeWidth:S=!1,nonScalingStroke:E=!1,color:R="currentColor",className:N=""}=UO()??{},T=!!g||HO(v),[O,D,M=[]]=kO(b,{color:n??R,width:l??r??C,height:a??r??C,strokeWidth:c??y,absoluteStrokeWidth:s??S,nonScalingStroke:u??E,className:Od(N,h),hasA11yProp:T,attributes:v});return x.createElement(O,{ref:w,...D},[...M.map(([z,H])=>x.createElement(z,H)),...Array.isArray(g)?g:[g]])});/**
135
+ * @license lucide-react v1.58.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */function _n(n,r=[],l=[]){const a=typeof n=="string"?DO(n,r,l):n,c=x.forwardRef(({className:s,...u},h)=>x.createElement(PO,{ref:h,icon:a,className:s,...u}));return a.name&&(c.displayName=zO(a.name)),c}/**
140
+ * @license lucide-react v1.58.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Vy={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Vy.node;const qy=_n(Vy);/**
145
+ * @license lucide-react v1.58.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Yy={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Yy.node;const Xy=_n(Yy);/**
150
+ * @license lucide-react v1.58.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const Ky={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Ky.node;const $O=_n(Ky);/**
155
+ * @license lucide-react v1.58.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Fy={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Fy.node;const GO=_n(Fy);/**
160
+ * @license lucide-react v1.58.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const Qy={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};Qy.node;const VO=_n(Qy);/**
165
+ * @license lucide-react v1.58.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const Zy={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};Zy.node;const qO=_n(Zy);/**
170
+ * @license lucide-react v1.58.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const Wy={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};Wy.node;const YO=_n(Wy);/**
175
+ * @license lucide-react v1.58.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Jy={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Jy.node;const XO=_n(Jy);/**
180
+ * @license lucide-react v1.58.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const ev={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};ev.node;const KO=_n(ev);/**
185
+ * @license lucide-react v1.58.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const tv={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};tv.node;const FO=_n(tv);/**
190
+ * @license lucide-react v1.58.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const nv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};nv.node;const QO=_n(nv),Nd={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},rv={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Ad={exports:{}};/*!
195
+ Copyright (c) 2018 Jed Watson.
196
+ Licensed under the MIT License (MIT), see
197
+ http://jedwatson.github.io/classnames
198
+ */var ov;function ZO(){return ov||(ov=1,(function(n){(function(){var r={}.hasOwnProperty;function l(){for(var s="",u=0;u<arguments.length;u++){var h=arguments[u];h&&(s=c(s,a(h)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return l.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var h in s)r.call(s,h)&&s[h]&&(u=c(u,h));return u}function c(s,u){return u?s?s+" "+u:s+u:s}n.exports?(l.default=l,n.exports=l):window.classNames=l})()})(Ad)),Ad.exports}var WO=ZO();const av=hm(WO),iv=n=>{const{padding:r="",active:l=!1,className:a,...c}=n,s=x.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:av(a,rv["press-wrapper"],l?rv.active:""),style:{padding:s},children:n.children})};function lv({title:n,children:r}){const[l,a]=x.useState(null);return f.jsxs(jO,{children:[f.jsx(OO,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(RO,{container:Gy(l),className:"ui-tooltip",side:"top",sideOffset:6,children:n})]})}const JO={"icon-quanping":qO,"icon-quxiaoquanping":YO,"icon-shitudaohang":KO},sv=n=>{const{type:r,children:l,tooltip:a,...c}=n,s=JO[r];return a?f.jsx(lv,{title:a,children:f.jsx(iv,{...c,children:f.jsx(s,{size:14,"aria-hidden":"true"})})}):f.jsx(iv,{...c,children:f.jsx(s,{size:14,"aria-hidden":"true"})})};function eR({className:n,type:r,...l}){return f.jsx("input",{type:r,"data-slot":"input",className:Ve("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",n),...l})}function tR({className:n,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:Ve("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",n),...r})}const Oi=x.forwardRef(function({className:r,controlSize:l,size:a,status:c,...s},u){return f.jsx(eR,{...s,ref:u,"aria-invalid":c==="error"||s["aria-invalid"],"data-control-size":l||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function xs({autoSize:n,className:r,...l}){const a=x.useRef(null);return x.useLayoutEffect(()=>{const c=a.current;if(!c||!n)return;const s=getComputedStyle(c),u=parseFloat(s.lineHeight)||20,h=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(n.minRows*u+h,Math.min(n.maxRows*u+h,c.scrollHeight+2))}px`},[l.value,n]),f.jsx(tR,{...l,ref:a,className:Ve("ui-control ui-textarea",r)})}function nR({...n}){return f.jsx(pj,{"data-slot":"select",...n})}function rR({...n}){return f.jsx(zj,{"data-slot":"select-group",...n})}function oR({...n}){return f.jsx(bj,{"data-slot":"select-value",...n})}function aR({className:n,size:r="default",children:l,...a}){return f.jsxs(yj,{"data-slot":"select-trigger","data-size":r,className:Ve("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",n),...a,children:[l,f.jsx(xj,{asChild:!0,children:f.jsx(Xy,{className:"size-4 opacity-50"})})]})}function iR({container:n,className:r,children:l,position:a="item-aligned",align:c="center",...s}){return f.jsx(Ej,{container:n,children:f.jsxs(Tj,{"data-slot":"select-content",className:Ve("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...s,children:[f.jsx(cR,{}),f.jsx(Mj,{className:Ve("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:l}),f.jsx(uR,{})]})})}function lR({className:n,...r}){return f.jsx(kj,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",n),...r})}function sR({className:n,children:r,...l}){return f.jsxs(Bj,{"data-slot":"select-item",className:Ve("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...l,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx($j,{children:f.jsx(qy,{className:"size-4"})})}),f.jsx(Uj,{children:r})]})}function cR({className:n,...r}){return f.jsx(Gj,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",n),...r,children:f.jsx($O,{className:"size-4"})})}function uR({className:n,...r}){return f.jsx(Vj,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",n),...r,children:f.jsx(Xy,{className:"size-4"})})}function Md(n){return x.Children.toArray(n).flatMap(r=>x.isValidElement(r)?r.type===x.Fragment?Md(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Md(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const Ss="__empty_option__";function cv(n,r){return n.map((l,a)=>l.options?f.jsxs(rR,{children:[f.jsx(lR,{children:l.label}),cv(l.options,r)]},a):f.jsx(sR,{value:String(l.value)||Ss,disabled:l.disabled,"data-option-value":l.value,onKeyDown:c=>{c.key==="Enter"&&!l.disabled&&(c.preventDefault(),r(String(l.value)||Ss))},children:l.label},String(l.value)))}function Vt({className:n,controlSize:r,size:l,children:a,options:c,value:s,onChange:u,disabled:h,...g}){const m=x.useRef(null),[b,v]=x.useState(!1),w=y=>{if(y){v(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Dr.flushSync(()=>v(!1)),S&&m.current?.focus({preventScroll:!0})},C=y=>{w(!1),u?.(y===Ss?"":y)};return f.jsxs(nR,{value:s===void 0?void 0:String(s)||Ss,onValueChange:C,disabled:h,open:b,onOpenChange:w,children:[f.jsx(aR,{...g,ref:m,className:Ve("ui-control ui-select",n),"data-value":s===void 0?"":String(s),"data-control-size":r||(l==="small"?"compact":l),children:f.jsx(oR,{})}),f.jsx(iR,{container:Gy(m.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:y=>y.preventDefault(),onEscapeKeyDown:y=>{y.preventDefault(),y.stopPropagation(),w(!1)},children:cv(c||Md(a),C)})]})}const uv=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,dv=jm,dR=((n,r)=>l=>{var a;if(r?.variants==null)return dv(n,l?.class,l?.className);const{variants:c,defaultVariants:s}=r,u=Object.keys(c).map(m=>{const b=l?.[m],v=s?.[m];if(b===null)return null;const w=uv(b)||uv(v);return c[m][w]}),h=l&&Object.entries(l).reduce((m,b)=>{let[v,w]=b;return w===void 0||(m[v]=w),m},{}),g=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((m,b)=>{let{class:v,className:w,...C}=b;return Object.entries(C).every(y=>{let[S,E]=y;return Array.isArray(E)?E.includes({...s,...h}[S]):{...s,...h}[S]===E})?[...m,v,w]:m},[]);return dv(n,u,g,l?.class,l?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function fv({className:n,variant:r="default",size:l="default",asChild:a=!1,...c}){const s=a?u1:"button";return f.jsx(s,{"data-slot":"button","data-variant":r,"data-size":l,className:Ve(dR({variant:r,size:l,className:n})),...c})}function ue({type:n="default",htmlType:r="button",size:l="middle",danger:a,loading:c,className:s,children:u,...h}){return f.jsxs(fv,{variant:n==="primary"?"default":n==="text"?"ghost":"outline",size:l==="small"?"xs":l==="large"?"lg":"sm",...h,type:r,disabled:h.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",s),children:[c&&f.jsx(VO,{className:"animate-spin","aria-hidden":"true"}),u]})}function fR({className:n,...r}){return f.jsx(rE,{"data-slot":"checkbox",className:Ve("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",n),...r,children:f.jsx(aE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(qy,{className:"size-3.5"})})})}function qt({children:n,className:r,onChange:l,id:a,...c}){const s=x.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||s,children:[f.jsx(fR,{...c,id:a||s,className:"ui-checkbox",onCheckedChange:u=>l?.({target:{checked:u===!0}})}),n&&f.jsx("span",{children:n})]})}function ha({value:n,onChange:r,precision:l,className:a,onBlur:c,...s}){const[u,h]=x.useState(n==null?"":String(n));return x.useEffect(()=>{h(n==null?"":String(n))},[n]),f.jsx(Oi,{...s,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:g=>{const m=g.target.value;h(m),m?Number.isFinite(Number(m))&&r?.(Number(m)):r?.(null)},onBlur:g=>{const m=Number(u),b=u&&Number.isFinite(m)&&l!==void 0?String(Number(m.toFixed(l))):u;h(n==null?"":b||String(n)),c?.(g)}})}function hR({...n}){return f.jsx(Bw,{"data-slot":"dialog",...n})}function mR({...n}){return f.jsx(Pw,{"data-slot":"dialog-portal",...n})}function pR({...n}){return f.jsx(Vu,{"data-slot":"dialog-close",...n})}function gR({className:n,...r}){return f.jsx($w,{"data-slot":"dialog-overlay",className:Ve("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function yR({className:n,children:r,showCloseButton:l=!0,portal:a=!0,overlay:c=!0,...s}){const u=f.jsxs(x.Fragment,{children:[c&&f.jsx(gR,{className:"ui-dialog-overlay"}),f.jsxs(qw,{"data-slot":"dialog-content",className:Ve("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",n),...s,children:[r,l&&f.jsxs(Vu,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(QO,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(mR,{children:u}):u}function vR({className:n,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",n),...r})}function bR({className:n,showCloseButton:r=!1,children:l,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a,children:[l,r&&f.jsx(Vu,{asChild:!0,children:f.jsx(fv,{variant:"outline",children:"Close"})})]})}function xR({className:n,...r}){return f.jsx(Kw,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",n),...r})}function Cs({open:n,modal:r=!0,panelRef:l,width:a=460,zIndex:c=900,className:s,title:u,footer:h,children:g,classNames:m,closeLabel:b,closeIcon:v,onCancel:w,onOpenAutoFocus:C,onEscapeKeyDown:y,wrapProps:S}){const E=x.useId(),R=x.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(hR,{open:n,modal:r,onOpenChange:N=>{N||w()},children:f.jsxs(yR,{...S,ref:l,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":E,"aria-modal":r,className:Ve("ui-dialog",s),style:{width:a,zIndex:c},onInteractOutside:N=>N.preventDefault(),onOpenAutoFocus:C,onEscapeKeyDown:N=>{if(!r&&N.target instanceof Element&&!N.target.closest(".ui-dialog")){N.preventDefault();return}y?.(N)},onCloseAutoFocus:N=>{N.preventDefault(),r&&R.current?.isConnected&&R.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(vR,{className:Ve("ui-dialog-header",m?.header),children:f.jsx(xR,{asChild:!0,id:E,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",m?.body),children:g}),h&&f.jsx(bR,{className:Ve("ui-dialog-footer",m?.footer),children:h})]}),f.jsx(pR,{"aria-label":b,className:"ui-dialog-close",children:v})]})})}function SR({className:n,...r}){return f.jsx(ej,{"data-slot":"radio-group",className:Ve("grid gap-3",n),...r})}function CR({children:n,indicator:r=!0,className:l,...a}){return f.jsxs(oj,{"data-slot":"radio-group-item",className:Ve("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",l),...a,children:[r&&f.jsx(ij,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(GO,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),n]})}function wR(n){return null}function ER({value:n,onChange:r,children:l,className:a,name:c,disabled:s}){const u=x.Children.toArray(l).filter(x.isValidElement);return f.jsx(SR,{name:c,disabled:s,className:Ve("ui-radio-group",a),value:String(n),onValueChange:h=>{const g=u.find(m=>String(m.props.value)===h);g&&r({target:{value:g.props.value}})},children:u.map(({props:h})=>f.jsx(CR,{value:String(h.value),disabled:h.disabled,className:"ui-radio-option",indicator:!1,children:h.children},String(h.value)))})}const ht={Group:ER,Button:wR};function TR({thumbLabel:n,className:r,defaultValue:l,value:a,min:c=0,max:s=100,...u}){const h=x.useMemo(()=>Array.isArray(a)?a:Array.isArray(l)?l:[c,s],[a,l,c,s]);return f.jsxs(Wj,{"data-slot":"slider",defaultValue:l,value:a,min:c,max:s,className:Ve("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(nO,{"data-slot":"slider-track",className:Ve("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(rO,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(g,m)=>f.jsx(sO,{"data-slot":"slider-thumb","aria-label":n,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}function hv({value:n,onChange:r,ariaLabelForHandle:l,...a}){return f.jsx(TR,{...a,value:[n],onValueChange:c=>r(c[0]),thumbLabel:l})}const mv=n=>{let r;const l=new Set,a=(m,b)=>{const v=typeof m=="function"?m(r):m;if(!Object.is(v,r)){const w=r;r=b??(typeof v!="object"||v===null)?v:Object.assign({},r,v),l.forEach(C=>C(r,w))}},c=()=>r,h={setState:a,getState:c,getInitialState:()=>g,subscribe:m=>(l.add(m),()=>l.delete(m))},g=r=n(a,c,h);return h},jR=(n=>n?mv(n):mv),OR=n=>n;function RR(n,r=OR){const l=hi.useSyncExternalStore(n.subscribe,hi.useCallback(()=>r(n.getState()),[n,r]),hi.useCallback(()=>r(n.getInitialState()),[n,r]));return hi.useDebugValue(l),l}const pv=n=>{const r=jR(n),l=a=>RR(r,a);return Object.assign(l,r),l},NR=(n=>n?pv(n):pv),ws={min:20,max:150},gv={width:4e3,height:2e3},yv={width:210,height:297},jo=NR((n,r)=>({scale:100,navigatorVisible:!0,setScale:l=>n(a=>({...a,scale:Math.max(ws.min,Math.min(ws.max,Math.round(l)))})),getScale:()=>r().scale,setNavigatorVisible:l=>n(a=>({...a,navigatorVisible:l}))})),AR=()=>{const{scale:n,setScale:r,getScale:l}=jo(),a=c=>r(l()+c);return x.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),s=h=>{if(!h.ctrlKey)return;h.preventDefault();const g=document.getElementById("answer-sheet"),m=g.getBoundingClientRect(),b=(h.clientX-m.left)/m.width,v=(h.clientY-m.top)/m.height;Dr.flushSync(()=>r(l()+(h.deltaY<0?5:-5)));const w=g.getBoundingClientRect();c.scrollLeft+=w.left+b*w.width-h.clientX,c.scrollTop+=w.top+v*w.height-h.clientY},u=h=>{(h.ctrlKey||h.metaKey)&&(h.key==="+"||h.key==="="||h.key==="-")&&(h.preventDefault(),r(l()+(h.key==="-"?-10:10)))};return c.addEventListener("wheel",s,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",s),window.removeEventListener("keydown",u)}},[l,r]),f.jsxs("div",{className:Nd["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ue,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(XO,{})}),f.jsx(hv,{className:Nd.bar,ariaLabelForHandle:"缩放比例",min:ws.min,max:ws.max,step:1,value:n,onChange:r}),f.jsx(ue,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(FO,{})}),f.jsx(lv,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:av("font-12 grey ml-5 pointer",Nd.percent),children:[n,"%"]})})]})},MR=()=>{const[n,r]=x.useState(!1);x.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const l=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(sv,{type:n?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":n?"取消全屏":"全屏",tooltip:n?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),l())},onClick:l})},_R=({summary:n})=>{const{navigatorVisible:r,setNavigatorVisible:l}=jo();return f.jsxs("div",{className:MO.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:n}),f.jsxs("div",{children:[f.jsx(sv,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),l(!r))},className:"mr-5",onClick:()=>l(!r)}),f.jsx(AR,{}),f.jsx(MR,{})]})]})},vv={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},DR=({width:n=ho(yv.width),height:r=ho(yv.height),children:l})=>{const{scale:a}=jo();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:n},children:l})};var Ri=(n=>(n.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",n))(Ri||{});class IR{constructor(){Qh(this,"callbacks",new Map)}on(r,l){this.callbacks.set(r,l)}emit(r,...l){const a=this.callbacks.get(r);a&&a(l)}depose(r){this.callbacks.delete(r)}}const Es=new IR,zR=({width:n,height:r,children:l,onBackgroundClick:a})=>{const c=x.useRef(null),s=x.useRef(null),{scale:u}=jo(),h=u/100,g=Math.max(gv.width,n*h+600),m=Math.max(gv.height,r*h+600),b=x.useRef(null);return x.useLayoutEffect(()=>{const v=s.current,w=(g-n*h)/2,C=(m-r*h)/2,y=b.current;if(!y||y.width!==n)v.scrollLeft=Math.max(0,w+n*h/2-v.clientWidth/2),v.scrollTop=Math.max(0,C-54);else{const S=(v.scrollLeft+v.clientWidth/2-y.left)/y.zoom,E=(v.scrollTop+v.clientHeight/2-y.top)/y.zoom;v.scrollLeft=w+S*h-v.clientWidth/2,v.scrollTop=C+E*h-v.clientHeight/2}b.current={left:w,top:C,zoom:h,width:n},Es.emit(Ri.STADIO_SCROLL_CHANGE)},[g,m,n,r,h]),x.useEffect(()=>{const v=s.current,w=c.current;let C=()=>{};const y=E=>{if(E.button!==1)return;E.preventDefault(),C();const R=E.clientX,N=E.clientY,T=v.scrollLeft,O=v.scrollTop,D=document.body.style.cursor;document.body.style.cursor="grabbing";const M=H=>v.scrollTo({left:T-H.clientX+R,top:O-H.clientY+N}),z=H=>{H.button===1&&C()};C=()=>{document.body.style.cursor=D,window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",z),window.removeEventListener("blur",C)},window.addEventListener("mousemove",M),window.addEventListener("mouseup",z),window.addEventListener("blur",C)},S=()=>Es.emit(Ri.STADIO_SCROLL_CHANGE);return w.addEventListener("mousedown",y),v.addEventListener("scroll",S),()=>{C(),w.removeEventListener("mousedown",y),v.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:vv["stadio-wrapper"],ref:s,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:vv.container,ref:c,id:"answer-sheet-container",style:{height:m,width:g},onPointerDown:v=>{v.target===v.currentTarget&&a?.()},children:f.jsx(DR,{width:n,height:r,children:l})})})},_d={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},LR=()=>{const{scale:n}=jo(),[r,l]=x.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=x.useRef(null),c=x.useRef(()=>{});return x.useEffect(()=>{const s=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),h=document.getElementById("answer-sheet");let g=0;const m=()=>{const w=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),C=u.getBoundingClientRect(),y=Array.from(h.querySelectorAll("[data-paper-page]")),S=(y.length?y:[h]).map(R=>{const N=R.getBoundingClientRect();return{x:(N.left-C.left)/w,y:(N.top-C.top)/w,width:N.width/w,height:N.height/w}}),E={ratio:w,width:u.offsetWidth/w,height:u.offsetHeight/w,view:{x:s.scrollLeft/w,y:s.scrollTop/w,width:s.clientWidth/w,height:s.clientHeight/w},pages:S};l(R=>JSON.stringify(R)===JSON.stringify(E)?R:E)},b=()=>{cancelAnimationFrame(g),g=requestAnimationFrame(m)};c.current=b;const v=new ResizeObserver(b);return[s,u,h].forEach(w=>v.observe(w)),Es.on(Ri.STADIO_SCROLL_CHANGE,b),b(),()=>{c.current=()=>{},cancelAnimationFrame(g),v.disconnect(),Es.depose(Ri.STADIO_SCROLL_CHANGE)}},[]),x.useLayoutEffect(()=>{c.current()},[n]),f.jsxs("div",{className:_d["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((s,u)=>f.jsx("div",{className:_d["fake-page"],"data-nav-page":u+1,style:{left:s.x,top:s.y,width:s.width,height:s.height}},u)),f.jsx("div",{className:_d.viewport,role:"button",tabIndex:0,"aria-label":"拖动导航视口",style:{left:r.view.x,top:r.view.y,width:r.view.width,height:r.view.height},onPointerDown:s=>{if(s.button!==0)return;s.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:s.clientX,y:s.clientY,left:u.scrollLeft,top:u.scrollTop},s.currentTarget.setPointerCapture(s.pointerId)},onPointerMove:s=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(s.clientX-a.current.x)*r.ratio,top:a.current.top+(s.clientY-a.current.y)*r.ratio})},onPointerUp:s=>{a.current=null,s.currentTarget.releasePointerCapture(s.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:s=>{const h={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[s.key];h&&(s.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:h[0],top:h[1]}))}})]})},bv=x.createContext(null),Dd=x.forwardRef((n,r)=>{const l=x.useContext(bv);if(!l)throw new Error("制卡需要显式注册富文本插件");const a=x.useRef(null),c=x.useRef(null),s=x.useRef(n);s.current=n;const u=x.useRef(null),h=x.useRef(null),g=x.useRef(!1),m=x.useRef(0),b=()=>({...s.current,onChange:w=>s.current.onChange?.(w),onLayout:w=>s.current.onLayout?.(w),onContentSelect:w=>s.current.onContentSelect?.(w)}),v=w=>{const C=c.current,y=++m.current;C&&C.ready.then(()=>{let S=0;const E=()=>{y!==m.current||c.current!==C||s.current.readOnly||(C.getStatus().editable?w(C):++S<120&&requestAnimationFrame(E))};requestAnimationFrame(E)}).catch(S=>{h.current=S})};return x.useImperativeHandle(r,()=>({getDocument:()=>g.current?c.current.getDocument():null,getAnswerRegions:()=>g.current?c.current.getAnswerRegions():[],setDocument(w){g.current?c.current.setDocument(w):u.current=w},syncDocument(w){g.current?c.current.syncDocument(w):u.current=w},focus:w=>v(C=>C.focus(w)),focusContent:w=>s.current.contentTargets?.some(C=>C.id===w)?(v(C=>{C.focusContent(w)||C.focus("start")}),!0):!1,insertAnswerRegion:(w,C,y)=>v(S=>S.insertAnswerRegion(w,C,y)),getStatus(){if(h.current)throw h.current;return g.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),x.useEffect(()=>{let w=!0;h.current=null;const C=document.createElement("div");C.style.display="contents",a.current.append(C);const y=l.create(C,b());return c.current=y,y.ready.then(()=>{w&&(g.current=!0,y.setOptions(b()),u.current&&(y.syncDocument(u.current),u.current=null))}).catch(S=>{w&&(h.current=S)}),()=>{w=!1,g.current=!1,c.current=null,m.current++,C.remove(),queueMicrotask(()=>y.destroy())}},[l]),x.useEffect(()=>{c.current?.setOptions(b())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),xv={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function kR(n){if(n.reference||!n.exercise)return n;const r=n.exercise,l=xv[n.kind]||"SHORTANSWER",a=tu(l);return a.fillNewLine=r.fillNewLine,a.optional=n.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const s=l==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":xv[c.kind]||"SHORTANSWER":l,u=s==="MIXED"?"SHORTANSWER":s,h=ru({...nu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(h.id=c.id,h.label=c.label,h.document=c.document,h.choice={...Wo(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},h.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),h.lines=Math.min(100,Math.max(1,c.area.rows)),h.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")h.parts=c.blanks.map((g,m)=>({...ui(c.blanks.length===1?c.label:`${c.label}.${m+1}`,g.score,u),id:g.id,width:g.width,breakAfter:g.breakAfter})),h.score=Un(h.parts);else if(u==="SHORTANSWER")h.parts=[{...ui(c.label,c.score,u),document:c.document,height:h.height}];else if(ke(u)){const g=ui(c.label,c.score,u,c.choice.options.length);h.parts=[{...g,choice:{...h.choice,id:g.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(h.document={...h.document,content:{...h.document.content,content:[...ii(h.label,h.score).content.content,...h.document.content.content||[]]}},h.parts=h.parts.map(g=>({...g,document:{...g.document,content:{...g.document.content,content:[...ii(g.label,g.score).content.content,...g.document.content.content||[]]}}}))),h}),{...n,reference:a}}const fr="reference-merged-objective";function HR(n,r){const l=n.blocks.map(h=>h.reference&&n.choiceDirection&&n.choiceDirection!==h.reference.layout.direction?{...h,reference:{...h.reference,layout:{...h.reference.layout,direction:n.choiceDirection}}}:h);if(!n.mergeObjective)return l;const a=l.find(h=>h.reference?.questions.some(g=>Ct(g.type)));if(!a?.reference)return l;const c=l.flatMap(h=>{if(!h.reference)return[];const g=Ko({...h.reference.layout,questions:Jo(h.reference)},h.document,n.questionCard!==!1||r===h.id).concentrated,m=new Set(g.questions.map(b=>b.id));return h.reference.questions.filter(b=>Ct(b.type)).flatMap(b=>{if(!ke(b.type))return m.has(b.id)?[b]:[];const v=b.parts.filter(w=>m.has(w.id));return v.length?[{...b,parts:v}]:[]})});if(!c.length)return l;const s={...a,id:fr,document:Bt(),reference:{...tu("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=l.flatMap(h=>{if(!h.reference)return[h];const g=h.reference.questions.filter(b=>!Ct(b.type)),m=n.questionCard!==!1&&!pn(h.document)||r===h.id;return!g.length&&!m&&h.reference.questions.length?[]:[h]});return[s,...u]}function Sv(n){const r=n.reference;if(!r)return[];const l=r.type==="MIXED"?[{id:n.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=ke(a.type);l.push({id:a.id,label:c?`第 ${a.parts.map(s=>s.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&Ct(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(s=>r.textVersion!==1||s.text).forEach(s=>l.push({id:s.id,label:`第 ${s.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&Ct(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),l}function Cv(n,r){return{...n,attrs:{...n.attrs,contentId:r}}}function BR(n,r,l){const a=new Map(r.questions.filter(u=>si(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const h=u.type==="answerLine"&&a.get(u.attrs?.id),g=h&&Math.max(24,Math.min(600,l*h.width/100));if(h&&(u.attrs?.label!==h.label||u.attrs?.width!==g))return{...u,attrs:{...u.attrs,label:h.label,width:g}};const m=u.content?.map(c);return m?.some((b,v)=>b!==u.content[v])?{...u,content:m}:u},s=c(n.content);return s===n.content?n:{...n,content:s}}function UR(n){if(!n.reference)return n.document;const r=new Map;n.reference.questions.forEach(c=>{[c.choice,...c.parts.map(s=>s.choice)].forEach(s=>{s.contentTarget&&r.set(s.contentTarget.groupId,s.id)})});let l=!1;const a=n.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let s;const u=h=>{h.type==="choiceGroup"&&(s=r.get(h.attrs?.id)||s),h.type==="choiceStemAnchor"&&(s=r.get(h.attrs?.groupId)||s),h.content?.forEach(u)};return u(c),s?(l=!0,Cv(c,s)):c});return l?{...n.document,content:{...n.document.content,content:a}}:n.document}function PR(n,r,l){const a=E=>E.questions.flatMap(R=>[R.id,...R.parts.map(N=>N.id)]),c=new Set(a(r)),s=new Set(a(l)),u=new Set([...c].filter(E=>!s.has(E)));let h=!1;const g=E=>{if(u.has(E.attrs?.contentId)||E.type==="answerLine"&&u.has(E.attrs?.id))return h=!0,null;const R=E.content?.map(g).filter(N=>N!==null);return R?{...E,content:R}:E},m=g(n.content),b=m.content||[],v=a(l),w=b.filter(E=>s.has(E.attrs?.contentId)),C=[...w].sort((E,R)=>v.indexOf(E.attrs.contentId)-v.indexOf(R.attrs.contentId));let y=0;const S=b.map(E=>s.has(E.attrs?.contentId)?C[y++]:E);return w.some((E,R)=>E!==C[R])&&(h=!0),h?{...n,content:{...m,content:S.length?S:Bt().content.content}}:n}function $R(n,r,l){const a=new Map([[r.id,l.id],...r.parts.map((C,y)=>[C.id,l.parts[y].id])]),c=new Map([...r.choice.options.map((C,y)=>[C.id,l.choice.options[y].id]),...r.parts.flatMap((C,y)=>C.choice.options.map((S,E)=>[S.id,l.parts[y].choice.options[E].id]))]),s=new Map([[r.text?.groupId,l.text?.groupId],...r.parts.map((C,y)=>[C.text?.groupId,l.parts[y].text?.groupId])].filter(C=>!!(C[0]&&C[1]))),u=n.content.content||[],h=u.filter(C=>a.has(C.attrs?.contentId));if(!h.length)return n;const g=fo(h),m=(C,y)=>({...C,...C.attrs?{attrs:{...C.attrs,...C.type==="choiceOption"&&c.has(y.attrs?.id)?{id:c.get(y.attrs.id)}:{},...C.type==="choiceGroup"&&s.has(y.attrs?.id)?{id:s.get(y.attrs.id)}:{},...a.has(y.attrs?.contentId)?{contentId:a.get(y.attrs.contentId)}:{},...C.type==="choiceStemAnchor"&&a.has(String(y.attrs?.groupId).slice(9))?{groupId:qc(a.get(String(y.attrs.groupId).slice(9)))}:{}}}:{},...C.content?{content:C.content.map((S,E)=>m(S,y.content[E]))}:{}}),b=new Map(r.parts.map((C,y)=>[C.id,l.parts[y].id])),v=(C,y)=>({...C,...y.type==="answerLine"&&b.has(y.attrs?.id)?{attrs:{...C.attrs,id:b.get(y.attrs.id)}}:{},...C.content?{content:C.content.map((S,E)=>v(S,y.content[E]))}:{}}),w=Math.max(...h.map(C=>u.indexOf(C)));return{...n,content:{...n.content,content:[...u.slice(0,w+1),...g.map((C,y)=>v(m(C,h[y]),h[y])),...u.slice(w+1)]}}}function GR(n,r){const l=n.content.content||[],a=new Set(l.map(s=>s.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(s=>s.attrs?.contentId&&!a.has(s.attrs.contentId));return c.length?{...n,content:{...n.content,content:[...pn(n)?[]:l,...c]}}:n}function VR(n,r){const l={};let a=1;return{sectionInfoList:n.filter(s=>s.reference).map((s,u)=>{const h=s.reference,g=h.textVersion===1?h:dm({...h,questions:h.questions.map(y=>({...y,text:y.text||{...li(y.type,y.choice,ke(y.type)),numbered:!1,itemsContent:[]},parts:y.parts.map(S=>({...S,text:S.text||{...li(y.type,S.choice),numbered:!1,itemsContent:[]}}))}))},s.document,s.id),m=g.sectionSeq??u+1,b=y=>y?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],v=y=>r.serialize(y?.content||Bt()),w=(y,S,E)=>{const R=y?_l({...y,itemsContent:[]},S,E):[],N=r.serialize(_r(R)),T=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:T(N,!0),contentNoP:T(N),items:b(y).map(O=>`${O.key}.${T(O.content)}`)}},C=g.questions.map(y=>{const S=ke(y.type),E=a;a+=S?y.parts.length:1;const R=y.referenceData||{},N=R.questionId??y.id,T=S?y.parts.map((M,z)=>({...M.referenceData,questionId:M.referenceData?.questionId??M.id,questionPid:N,questiontypeCode:y.type,seq:E+z,showSeq:M.label,itemShowNames:[M.label],score:M.score,itemcount:M.choice.options.length,content:v(M.text),itemsContent:b(M.text)})):void 0,O={...R,questionId:N,questiontypeCode:y.type,seq:E,showSeq:y.label,showSeqs:S?y.parts.map(M=>M.label):null,itemShowNames:y.parts.length?y.parts.map(M=>M.label):[y.label],itemcount:Ct(y.type)?y.choice.options.length:y.parts.length||1,childNum:S?y.parts.length:void 0,score:y.score,itemScores:y.parts.length?y.parts.map(M=>M.score):[y.score],content:v(y.text),itemsContent:b(y.text),...T?{items:T}:{},lessScore:y.choice.lessScore,scoreType:y.choice.scoreType,rightAnswers:y.rightAnswers,singleScore:y.singleScore,extension:{...R.extension||{},...y.type==="CCOMPOSITION"?{kong:y.characters}:{},...y.type==="ECOMPOSITION"?{hang:y.lines}:{},uniEditor:{text:y.text,choice:y.choice,height:y.height,contentHeight:y.contentHeight,halfPoint:y.halfPoint,parts:y.parts.map(M=>({id:M.id,text:M.text,width:M.width,height:M.height,breakAfter:M.breakAfter,choice:M.choice,document:M.document})),document:y.document}}},D=w(y.text,y.id,y.label);return l[String(N)]=S?{...D,items:y.parts.map((M,z)=>({seq:E+z,...w(M.text,M.id,M.label)}))}:D,g.type==="MIXED"&&(l[`secContent${N}`]=r.serialize(g.material||Bt())),O});return{...g.referenceData,sectionSeq:m,sectionName:s.title,sectionQuestionType:g.type,questionInfolist:C,...g.type==="MIXED"?{content:r.serialize(g.material||Bt())}:{},extension:{...g.referenceData?.extension||{},uniEditor:{id:s.id,layout:g.layout,material:g.material,document:s.document,optional:g.optional,choose:g.choose,optionalHeight:g.optionalHeight,scoreType:g.scoreType,fillNewLine:g.fillNewLine}}}}),quesTextMap:l}}function wv(n,r){const l=Array.isArray(n)?n:n.sectionInfoList;if(!Array.isArray(l))throw new Error("缺少 sectionInfoList");const a=new Set,c=s=>{const u=s==null||s===""?crypto.randomUUID():String(s);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return l.map(s=>{if(!(s.sectionQuestionType in Wn)||!Array.isArray(s.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=fm(s.sectionQuestionType),h=s.extension;h?.uniEditor?.id&&(u.id=h.uniEditor.id),u.title=s.sectionName;const{questionInfolist:g,...m}=s,b=[],v=new Map;g.forEach(C=>{if(C.questionPid!==void 0&&C.questionPid!==null&&ke(C.questiontypeCode)){const y=String(C.questionPid);let S=v.get(y);S||(S={...C,questionId:C.questionPid,questionPid:void 0,content:String(C.parentContent||""),items:[],showSeqs:[]},v.set(y,S),b.push(S)),S.items.push(C),S.showSeqs.push(C.showSeq??C.seq??S.items.length)}else b.push(C)}),v.forEach(C=>{C.itemScores=C.items.map(y=>y.score??null),C.score=C.itemScores.some(y=>y===null)?null:C.itemScores.reduce((y,S)=>y+(S||0),0)});const w=b.map((C,y)=>{if(!(C.questiontypeCode in Wn)||C.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=C.questiontypeCode,E=ke(S),R=E?C.items?.length||C.showSeqs?.length||C.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(C.itemScores?.length||C.itemcount)||1;if(!Number.isInteger(R)||R<1||R>200)throw new Error("子题数量无效");const N=C.score??null,T=nu(S),O=ru({...T,characters:Number(C.extension?.kong)||T.characters,lines:Number(C.extension?.hang)||T.lines,partCount:R,score:E||["FILLBLANK","SHORTANSWER"].includes(S)?C.itemScores?.[0]??(N===null?null:N/R):N,optionCount:C.itemcount||C.itemsContent?.length||4},Number(C.seq)||y+1);O.id=c(C.questionId??C.id),O.label=String(C.showSeq??C.itemShowNames?.[0]??C.seq??y+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=N,O.choice.scoreType=C.scoreType||O.choice.scoreType,O.choice.lessScore=C.lessScore??O.choice.lessScore,O.rightAnswers=C.rightAnswers??O.rightAnswers,O.singleScore=C.singleScore??O.singleScore,O.score=N,O.referenceData=C;const D=C.extension?.uniEditor;D?.choice&&(O.choice={...D.choice,id:O.id,label:O.label,score:N}),O.height=D?.height??O.height,O.contentHeight=D?.contentHeight??O.contentHeight,O.halfPoint=D?.halfPoint??O.halfPoint;const M=(z,H,G,X=!1,U)=>{if(U)return structuredClone(U);const F=li(S,{...G,id:H},X);return{...F,content:r.parse(z.content||""),itemsContent:!X&&z.itemsContent?z.itemsContent.map((J,I)=>({id:J.id===void 0?G.options[I]?.id||crypto.randomUUID():String(J.id),key:J.key,content:r.parse(J.content||"")})):F.itemsContent}};return O.text=M(C,O.id,O.choice,E,D?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(z=>({id:z.id,label:z.key}))),O.document=D?.document||gn(O.document,O.label,O.score),O.parts=O.parts.map((z,H)=>{const G=C.items?.[H],X=D?.parts?.[H];return z.id=c(X?.id??G?.questionId??G?.id),z.referenceData=G,z.label=String(G?.showSeq??C.itemShowNames?.[H]??C.showSeqs?.[H]??(E?Number(C.seq||1)+H:R===1?O.label:`${O.label}.${H+1}`)),z.score=G?.score??C.itemScores?.[H]??z.score,z.choice={...X?.choice||z.choice,id:z.id,label:z.label,score:z.score,scoreType:G?.scoreType||C.scoreType||z.choice.scoreType,lessScore:G?.lessScore??C.lessScore??z.choice.lessScore},E&&S!=="TEXT_COMPLETION"&&(z.text=M(G||{itemsContent:C.itemsContent?.map(({key:U,content:F})=>({key:U,content:F}))},z.id,z.choice,!1,X?.text)),z.text?.itemsContent.length&&(z.choice.options=z.text.itemsContent.map(U=>({id:U.id,label:U.key}))),z.document=X?.document||gn(z.document,z.label,z.score),{...z,...X?{width:X.width??z.width,height:X.height??z.height,breakAfter:X.breakAfter??z.breakAfter}:{}}}),O.characters=Number(C.extension?.kong)||O.characters,O.lines=Number(C.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:s.sectionSeq,referenceData:m,questions:w,material:h?.uniEditor?.material||r.parse(s.content||""),...h?.uniEditor?{layout:h.uniEditor.layout||u.reference.layout,optional:!!h.uniEditor.optional,choose:h.uniEditor.choose||1,optionalHeight:h.uniEditor.optionalHeight??200,scoreType:h.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!h.uniEditor.fillNewLine}:{}},h?.uniEditor?.document&&(u.document=h.uniEditor.document),u.document=eu(u),u})}function qR({uploadImage:n,editorPlugin:r,initialValue:l,onSave:a,dictionaries:c}){const s=x.useMemo(()=>Pc(c),[c]),u=r.html,[h,g]=x.useState(l||lm),m=x.useCallback(se=>g(Re=>{let ye=typeof se=="function"?se(Re):se;ye.blocks.some(Ne=>Ne.exercise&&!Ne.reference)&&(ye={...ye,blocks:ye.blocks.map(kR)}),ye={...ye,blocks:ye.blocks.map(Ne=>{const Fe=Re.blocks.find(In=>In.id===Ne.id);if(Ne.reference?.textVersion===1)return ZS(Ne,Fe,!!ye.questionCard);if(!Ne.reference||Fe?.reference===Ne.reference)return Ne;let Xt=Fe?.reference?PR(Ne.document,Fe.reference,Ne.reference):Ne.document;if(Xt.content.content?.length===1&&Xt.content.content[0].type==="paragraph"&&!Xt.content.content[0].content?.length&&!Xt.content.content[0].attrs?.contentId&&Ne.reference.questions.length){const In=Ne.reference.questions[0],pr=Ne.reference.type==="MIXED"?Ne.id:In.id;Xt={...Xt,content:{...Xt.content,content:[Cv(Xt.content.content[0],pr)]}}}const Yn=In=>JSON.stringify(In.reference?.questions.flatMap(pr=>[pr.choice,...pr.parts.map(Ns=>Ns.choice)]).map(pr=>[pr.id,pr.contentTarget])),No=!Fe||Yn(Fe)!==Yn(Ne)?UR({...Ne,document:Xt}):Xt;return No===Ne.document?Ne:{...Ne,document:No}})};const ve=ye.blocks.filter(Ne=>Ne.reference).map(Ne=>Jo(Ne.reference));return(ye.mergeObjective?[ve.flat()]:ve).some(Ne=>new Set(Ne.map(Fe=>Fe.options.length)).size>1)&&ye.choiceDirection!=="column"?{...ye,choiceDirection:"column"}:ye}),[]),[b,v]=x.useState(""),[w,C]=x.useState(!l),[y,S]=x.useState(null),[E,R]=x.useState(null),[N,T]=x.useState(null),[O,D]=x.useState(!0),[M,z]=x.useState({}),H=se=>{const Re=se.reference?Il(se.reference):se.exercise?.items||se.choices?.questions;return Re?.find(ye=>ye.id===M[se.id])?.id||Re?.[0]?.id},G=(se,Re)=>z(ye=>ye[se]===Re?ye:{...ye,[se]:Re}),X=se=>{S(se),se===null&&R(null),se&&T(Re=>Re===null?null:se)},[U,F]=x.useState({}),[J,I]=x.useState(),[Y,k]=x.useState(!1),$=se=>{se&&R(null),k(se)},[L,Z]=x.useState(null),A=x.useRef(new Map),V=x.useCallback((se,Re)=>{Re?A.current.set(se,Re):A.current.delete(se)},[]),{scale:K,setScale:ee}=jo(),le=K/100,ce=x.useMemo(()=>HR(h,E),[h,E]),ie=JSON.stringify([h.preset,h.margin,h.gap,h.header,h.paperTitle?.id,h.paperTitle?.height,ce.map(se=>[se.id,se.answerHeight])]),{geometry:ge,placements:je,pageCount:be}=x.useMemo(()=>XS({...h,blocks:ce},U,J),[ie,U,J]),de=h.paperTitle?.id===J?.id&&J?.overflowing,Se=be*ge.height+(be-1)*mo,_e=je.filter(se=>se.overflowing),Ce=new Map(je.map(se=>[se.id,se])),Ae=Ce.get(fr);Ae&&h.blocks.forEach(se=>{Ce.has(se.id)||Ce.set(se.id,Ae)});const $e=()=>{const se=document.getElementById("answer-sheet-stadio");se&&ee(Math.max(20,Math.min(100,Math.floor((se.clientWidth-96)/ge.width*100))))};x.useEffect(()=>{$e()},[h.preset]);const Dn=(se,Re)=>m(ye=>({...ye,blocks:ye.blocks.map(ve=>ve.id===se?{...ve,...Re}:ve)})),jt=(se,Re)=>m(ye=>{const ve=[...ye.blocks],Ke=ve.findIndex(Fe=>Fe.id===se);if(Ke<0||Re<0||Re>=ve.length||Ke===Re)return ye;const[Ne]=ve.splice(Ke,1);return ve.splice(Re,0,Ne),{...ye,blocks:ve}}),pe=(se,Re=!1)=>{if(X(se),!Re)return;const ye=document.getElementById("answer-sheet-stadio"),ve=Array.from(document.querySelectorAll("[data-block-id]")),Ke=ve.find(Ne=>Ne.dataset.blockId===se&&!Ne.hidden)||ve.find(Ne=>Ne.dataset.blockId===fr);if(ye&&Ke){const Ne=Ke.getBoundingClientRect(),Fe=ye.getBoundingClientRect();ye.scrollTo({left:Math.max(0,ye.scrollLeft+Ne.left-Fe.left-40),top:Math.max(0,ye.scrollTop+Ne.top-Fe.top-90),behavior:"smooth"})}},ct=()=>VR(h.blocks,u);return{card:h,creationDictionary:s,saveMessage:b,setSaveMessage:v,saveAction:a?"保存":"导出",editors:A,measurements:U,titleMeasurement:J,paperBlocks:ce,setCard:m,uploadImage:n,setQuestionCard:se=>{R(null),m(Re=>({...Re,questionCard:se}))},editQuestion:(se,Re)=>{X(se),R(se),T(null);const ye=h.blocks.find(Ke=>Ke.id===se),ve=Re||ye&&H(ye);ye?.reference?.textVersion===1&&pn(ye.document)&&Dn(se,{document:eu(ye)}),requestAnimationFrame(()=>{const Ke=A.current.get(`content/${ve}`)||A.current.get(se);(!ve||!Ke?.focusContent(ve))&&Ke?.focus("start")})},insertMaterialBlank:(se,Re,ye,ve)=>{X(se),R(se),requestAnimationFrame(()=>A.current.get(se)?.insertAnswerRegion(Re,ye,ve))},editingQuestionId:E,registerEditor:V,creationOpen:w,setCreationOpen:C,newCard:se=>{m(Wc(se)),X(null),T(null),Z(null),F({}),I(void 0),z({}),$(!1),C(!1)},selectedId:y,setSelectedId:X,selectedChoiceId:H,selectChoice:G,settingsId:N,setSettingsId:T,settingsAutoFocus:O,openSettings:(se,Re=!0)=>{Y||(X(se),T(se),D(Re))},setMeasurements:F,setTitleMeasurement:I,titleOverflow:de,readOnly:Y,setReadOnly:$,deleted:L,setDeleted:Z,scale:le,geometry:ge,placements:je,pageCount:be,totalHeight:Se,overflow:_e,placementById:Ce,fitPage:$e,updateBlock:Dn,moveBlock:jt,selectBlock:pe,download:()=>{if(a){a();return}const se=URL.createObjectURL(new Blob([JSON.stringify({...h,...ct()},null,2)],{type:"application/json"})),Re=document.createElement("a");Re.href=se,Re.download=`${h.title||"答题卡"}.json`,Re.click(),setTimeout(()=>URL.revokeObjectURL(se),1e3)},getReferenceData:ct,setReferenceData:se=>{const Re=wv(se,u);m(ye=>({...ye,blocks:Re})),X(null),T(null),z({})}}}const Ev=x.createContext(null);function YR({children:n,...r}){return f.jsx(bv.Provider,{value:r.editorPlugin,children:f.jsx(Ev.Provider,{value:qR(r),children:n})})}function Tt(){const n=x.useContext(Ev);if(!n)throw new Error("制卡内容需要 CardProvider");return n}const XR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function Oo({name:n,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:XR[n]})})}function Id(n){const[r,l]=x.useState(null),a=x.useRef(n);a.current=n;const c=x.useRef(null),s=(b,v)=>{if(!r)return;const w=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-w.width-8,b))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-w.height-8,v))}px`},u=()=>{if(!r)return;const b=r.getBoundingClientRect(),v=a.current?.(r)||{left:(window.innerWidth-b.width)/2,top:(window.innerHeight-b.height)/2};s(v.left,v.top)},h=()=>{const b=c.current;c.current=null,r&&delete r.dataset.dragging,b?.target.hasPointerCapture(b.pointerId)&&b.target.releasePointerCapture(b.pointerId)},g=()=>c.current?(s(c.current.left,c.current.top),h(),!0):!1;return x.useLayoutEffect(()=>{if(!r)return;u();const b=()=>{const w=r.getBoundingClientRect();s(w.left,w.top)},v=new ResizeObserver(b);return v.observe(r),window.addEventListener("resize",b),document.addEventListener("fullscreenchange",b),window.addEventListener("blur",g),()=>{h(),v.disconnect(),window.removeEventListener("resize",b),document.removeEventListener("fullscreenchange",b),window.removeEventListener("blur",g)}},[r]),{dialog:r,setDialog:l,titleProps:{role:"button",tabIndex:0,onPointerDown:b=>{if(b.button!==0||!b.isPrimary||!r)return;b.preventDefault(),b.stopPropagation(),b.currentTarget.focus({preventScroll:!0});const{left:v,top:w}=r.getBoundingClientRect();c.current={x:b.clientX,y:b.clientY,left:v,top:w,target:b.currentTarget,pointerId:b.pointerId},r.dataset.dragging="true",b.currentTarget.setPointerCapture(b.pointerId)},onPointerMove:b=>{const v=c.current;v?.pointerId===b.pointerId&&s(v.left+b.clientX-v.x,v.top+b.clientY-v.y)},onPointerUp:h,onPointerCancel:g,onLostPointerCapture:h,onKeyDown:b=>{if(b.key==="Escape"&&g()&&(b.preventDefault(),b.stopPropagation()),b.key==="Home"&&(b.preventDefault(),b.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(b.key))return;b.preventDefault(),b.stopPropagation();const v=b.shiftKey?50:10,w=r.getBoundingClientRect();s(w.left+(b.key==="ArrowRight"?v:b.key==="ArrowLeft"?-v:0),w.top+(b.key==="ArrowDown"?v:b.key==="ArrowUp"?-v:0))}},cancelDrag:g}}function KR({creation:n,onAdd:r,onClose:l}){const[a,c]=x.useState(null),s=cm(n),u=x.useId(),{dialog:h,setDialog:g,titleProps:m,cancelDrag:b}=Id();x.useLayoutEffect(()=>{h?.setAttribute("aria-labelledby",u)},[h,u]);const v=f.jsx("div",{...m,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:u,children:"添加题块"})});return f.jsx(Cs,{open:!0,panelRef:g,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:v,closeLabel:"关闭添加题块",closeIcon:f.jsx(Oo,{name:"close",size:16}),onCancel:l,onEscapeKeyDown:w=>{b()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:l,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!a||!s.includes(a),onClick:()=>{a&&s.includes(a)&&r(a)},children:"添加"})]}),children:f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:s.map(w=>f.jsx(ue,{"aria-pressed":a===w,onClick:()=>c(w),children:Wn[w]},w))})})}function Ts({label:n,value:r,min:l,max:a,onChange:c}){const[s,u]=x.useState();return f.jsx(ha,{className:"ui-control ui-number","aria-label":n,min:l,max:a,precision:0,value:s===void 0?r:s,onChange:h=>{u(h),h!==null&&h>=l&&h<=a&&h!==r&&c(h)},onBlur:()=>{if(s!==void 0){const h=Math.max(l,Math.min(a,s??l));h!==r&&c(h),u(void 0)}}})}function Ni({label:n,value:r,min:l=.5,max:a=15,placeholder:c,onChange:s}){const[u,h]=x.useState(),g=u==null||Bn(u)&&u>=l&&u<=a;return f.jsx(ha,{className:"ui-control ui-number","aria-label":n,value:u===void 0?r:u,min:l,max:a,step:.5,placeholder:c,status:g?void 0:"error",onChange:m=>{h(m),(m===null||Bn(m)&&m>=l&&m<=a)&&s(m)},onBlur:()=>h(void 0)})}function FR({value:n,creation:r,onChange:l}){const[a,c]=x.useState("all"),[s,u]=x.useState([]),[h,g]=x.useState("settings"),[m,b]=x.useState("keep"),[v,w]=x.useState(null),[C,y]=x.useState(null),[S,E]=x.useState("keep"),[R,N]=x.useState(null),[T,O]=x.useState(1),[D,M]=x.useState(null),[z,H]=x.useState(""),[G,X]=x.useState(""),U=n.questions.filter(J=>a==="all"||s.includes(J.id)).map(J=>J.id),F=()=>{const J={};m!=="keep"&&(J.kind=m),v!==null&&(J.optionCount=v),C!==null&&(J.score=C),S!=="keep"&&(J.scoreType=S),R!==null&&S!=="ITEM_SCORE"&&(J.lessScore=R);let I;h==="settings"?I={type:h,patch:J}:h==="numbering"?I={type:h,start:T}:h==="average"?I={type:h,total:D??0}:I={type:h,text:z};const Y=DS(n,U,I,r);X(Y.error||""),Y.value&&l(Y.value)};return f.jsxs("details",{className:"card-choice-batch",children:[f.jsx("summary",{children:"批量设置"}),f.jsxs("div",{className:"card-choice-batch-fields",children:[f.jsxs("label",{className:"card-field",children:["范围",f.jsxs(Vt,{"aria-label":"批量修改范围",value:a,onChange:c,children:[f.jsx("option",{value:"all",children:"全部题目"}),f.jsx("option",{value:"selected",children:"指定题目"})]})]}),f.jsxs("label",{className:"card-field",children:["操作",f.jsxs(Vt,{"aria-label":"选择题批量操作",value:h,onChange:J=>{g(J),X("")},children:[f.jsx("option",{value:"settings",children:"修改属性"}),f.jsx("option",{value:"numbering",children:"连续题号"}),f.jsx("option",{value:"average",children:"平均分配总分"}),f.jsx("option",{value:"answers",children:"录入答案"})]})]}),a==="selected"&&f.jsx("div",{className:"card-choice-batch-selection",role:"group","aria-label":"选择批量修改题目",children:n.questions.map(J=>f.jsxs(qt,{checked:U.includes(J.id),onChange:I=>u(Y=>I.target.checked?[...Y,J.id]:Y.filter(k=>k!==J.id)),children:["第 ",J.label," 题"]},J.id))}),h==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Vt,{"aria-label":"批量选择题类型",value:m,onChange:b,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(ha,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:mn.options,precision:0,value:v,onChange:w})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Ni,{label:"批量每题分值",value:C,placeholder:"保持不变",onChange:y})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Vt,{"aria-label":"批量少选计分",value:S,onChange:E,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Ni,{label:"批量少选得分",min:0,value:R,placeholder:"保持不变",onChange:N})]})]}),h==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(Ts,{label:"批量起始题号",min:1,max:1e3,value:T,onChange:O})]}),h==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Ni,{label:"平均分配总分",max:mn.score*U.length,value:D,onChange:M})]}),h==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(xs,{"aria-label":"批量选择题答案",value:z,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:J=>H(J.target.value)})]}),G&&f.jsx("div",{className:"card-choice-error",role:"alert",children:G}),f.jsxs(ue,{className:"card-choice-batch-apply",type:"primary",disabled:!U.length,onClick:F,children:["应用到 ",U.length," 题"]})]})]})}function Tv({value:n,document:r,creation:l,selectedId:a,onSelect:c,onChange:s,singleQuestion:u=!1}){const[h,g]=x.useState([]),[m,b]=x.useState([]),v=n.questions.find(U=>U.id===a)||n.questions[0],w=n.questions.indexOf(v),C=Fc(n),y=Yc(n),S=Ol(r),E=new Set(n.questions.map(U=>U.options.length)).size>1,R=()=>({value:n,selectedId:v?.id}),N=(U,F=v?.id)=>{g(I=>[...I.slice(-49),R()]),b([]),s({...U,source:"manual"});const J=U.questions.find(I=>I.id===F)||U.questions[Math.max(0,Math.min(w,U.questions.length-1))];J&&c(J.id)},T=U=>{s(U.value),U.selectedId&&c(U.selectedId)},O=U=>N({...n,questions:n.questions.map(F=>F.id===v.id?{...F,...U}:F)}),D=U=>O($c(v,U,l)),M=U=>{const F=[...n.questions];F.splice(w,1),F.splice(w+U,0,v),N({...n,questions:F})},z=(U=!1)=>{const F=U&&v?_S(v,Vc(n.questions)):{...Fo(0),label:Vc(n.questions)},J=[...n.questions];J.splice(w+1,0,F),N({...n,questions:J},F.id)},H=n.questions.reduce((U,F)=>U+(F.score??0),0),G=n.questions.filter(U=>typeof U.score!="number").length,X=v&&(tm(n.questions,v.id,v.label)||Gc(v));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Vt,{"aria-label":"选择题填涂位置",value:y,onChange:U=>N(Xc(n,r,U)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[n.questions.length," 题 · ",G===n.questions.length?"未设分":`${H} 分${G?` · ${G} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Vt,{"aria-label":"选择题填涂位置",value:y,onChange:U=>N(Xc(n,r,U)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(Ts,{label:"选择题数量",min:1,max:mn.questions,value:n.questions.length,onChange:U=>{const F=n.questions.slice(0,U);for(;F.length<U;)F.push({...Fo(0),label:Vc(F)});N({...n,questions:F})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Vt,{"aria-label":"填涂排列方向",value:C,onChange:U=>N({...n,direction:U}),children:[f.jsx("option",{value:"row",disabled:E,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:E?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),C==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(Ts,{label:"每列题数",min:1,max:5,value:n.rowsPerColumn,onChange:U=>N({...n,rowsPerColumn:U})})]})]})]}),v&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Vt,{"aria-label":"当前选择题",value:v.id,onChange:c,children:n.questions.map(U=>f.jsxs("option",{value:U.id,children:["第 ",U.label," 题"]},U.id))})]}),y!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Vt,{"aria-label":"填涂对应正文选项",value:S.some(U=>U.id===v.contentTarget?.groupId)?v.contentTarget.groupId:"",onChange:U=>{const F=S.find(J=>J.id===U);O({contentTarget:F?{groupId:F.id,optionIds:F.options.map(J=>J.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((U,F)=>f.jsxs("option",{value:U.id,disabled:n.questions.some(J=>J.id!==v.id&&J.contentTarget?.groupId===U.id),children:["第 ",U.label||F+1," 组选项(",U.options.length," 项)"]},U.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(Oi,{"aria-label":"选择题题号",value:v.label,maxLength:12,onChange:U=>O({label:U.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Ts,{label:"选择题选项个数",min:2,max:Math.max(mn.options,v.options.length),value:v.options.length,onChange:U=>D({optionCount:U})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Vt,{"aria-label":"选择题类型",value:NS(v),onChange:U=>D({kind:U}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Ni,{label:"选择题分值",value:v.score??null,placeholder:"未设置",onChange:U=>D({score:U})})]}),v.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Vt,{"aria-label":"选择题少选计分",value:v.scoreType||"LESS_SCORE",onChange:U=>D({scoreType:U,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),v.multiple&&v.scoreType!=="ITEM_SCORE"&&typeof v.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Ni,{label:"选择题少选得分",min:0,max:v.score,value:v.lessScore??0,onChange:U=>D({lessScore:U??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:v.options.map(U=>f.jsx(ue,{type:"text","aria-label":`正确答案 ${U.label}`,"aria-pressed":v.correctIds.includes(U.id),onClick:()=>O({correctIds:v.correctIds.includes(U.id)?v.correctIds.filter(F=>F!==U.id):v.multiple?[...v.correctIds,U.id]:[U.id]}),children:U.label},U.id))})]}),v.multiple&&v.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",MS(v)??"—"," 分 · 错选、不选 0 分"]}),X&&f.jsx("div",{className:"card-choice-error",role:"alert",children:X}),!u&&f.jsx(qt,{className:"card-choice-break",checked:v.breakBefore,onChange:U=>O({breakBefore:U.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ue,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:n.questions.length>=mn.questions,onClick:()=>z(),children:"新增"}),f.jsx(ue,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:n.questions.length>=mn.questions,onClick:()=>z(!0),children:"复制"}),f.jsx(ue,{type:"text","aria-label":"上移选择题",disabled:w<=0,onClick:()=>M(-1),children:"上移"}),f.jsx(ue,{type:"text","aria-label":"下移选择题",disabled:w>=n.questions.length-1,onClick:()=>M(1),children:"下移"}),f.jsx(ue,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:n.questions.length<=1,onClick:()=>{const U=n.questions.filter(F=>F.id!==v.id);N({...n,questions:U},U[Math.min(w,U.length-1)]?.id)},children:"删除"})]})]},v.id),!v&&f.jsx(ue,{className:"card-choice-actions",onClick:()=>z(),children:"新增选择题"}),!u&&f.jsx(FR,{value:n,creation:l,onChange:N}),!u&&(h.length>0||m.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ue,{type:"text",className:"card-choice-undo",disabled:!h.length,onClick:()=>{const U=h.at(-1);g(h.slice(0,-1)),b(F=>[...F,R()]),T(U)},children:"撤销选择题设置"}),f.jsx(ue,{type:"text",disabled:!m.length,onClick:()=>{const U=m.at(-1);b(m.slice(0,-1)),g(F=>[...F,R()]),T(U)},children:"重做"})]})]})}function Yt({label:n,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:n}),r]})}function mt({label:n,value:r,min:l=0,max:a=200,step:c=1,onChange:s}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,value:r,min:l,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&s(Math.max(l,Math.min(a,Math.round(u/c)*c)))}})})}function Qt({label:n,value:r,max:l=70,onChange:a}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,placeholder:"未设置",min:.5,max:l,step:.5,precision:1,value:r,onChange:c=>a(c===null?null:Math.max(.5,Math.min(l,Math.round(c*2)/2)))})})}function rn({label:n,value:r,onChange:l,maxLength:a=200}){return f.jsx(Yt,{label:n,children:f.jsx(Oi,{"aria-label":n,value:r,maxLength:a,onChange:c=>l(c.target.value)})})}function ot({label:n,value:r,options:l,onChange:a}){return f.jsx(Yt,{label:n,children:f.jsx(Vt,{"aria-label":n,value:r,onChange:a,children:Object.entries(l).map(([c,s])=>f.jsx("option",{value:c,children:s},c))})})}function js({index:n,count:r,onAdd:l,onCopy:a,onDelete:c,onMove:s,name:u="小题",maximum:h=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small","aria-label":`新增${u}`,disabled:r>=h,onClick:l,children:"新增"}),f.jsx(ue,{size:"small","aria-label":`复制当前${u}`,disabled:n<0||r>=h,onClick:a,children:"复制"}),f.jsx(ue,{size:"small","aria-label":`上移当前${u}`,disabled:n<=0,onClick:()=>s(-1),children:"↑"}),f.jsx(ue,{size:"small","aria-label":`下移当前${u}`,disabled:n<0||n>=r-1,onClick:()=>s(1),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:n<0,onClick:c,children:"删除"})]})}function Ai({value:n,onEditor:r,...l}){const a=x.useRef(null),c=x.useCallback(u=>{a.current=u,r?.(u)},[r]),s=x.useRef(JSON.stringify(n));return x.useEffect(()=>{const u=JSON.stringify(n);u!==s.current&&(s.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(n))},[n]),f.jsx(Dd,{ref:c,initialValue:n,...l})}function jv({value:n,onChange:r,drawing:l=!1}){const{uploadImage:a}=Tt(),c=x.useRef(null),[s,u]=x.useState(!1),[h,g]=x.useState(""),m=x.useRef(!0),b=x.useRef({value:n,onChange:r});b.current={value:n,onChange:r},x.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const v=w=>r({...n,...w});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"作答区样式",value:n.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:w=>v({style:w})}),f.jsx(mt,{label:"作答行数",value:n.rows,min:0,max:120,onChange:w=>v({rows:w})}),f.jsx(mt,{label:"作答行高",value:n.rowHeight,min:16,max:80,onChange:w=>v({rowHeight:w})}),["characters","grid","coordinates"].includes(n.style)&&f.jsx(mt,{label:"每行格数",value:n.columns,min:4,max:40,onChange:w=>v({columns:w})}),n.style==="characters"&&f.jsx(mt,{label:"字数标记间隔",value:n.wordMark,min:0,max:500,onChange:w=>v({wordMark:w})})]}),f.jsx(qt,{checked:n.title,onChange:w=>v({title:w.target.checked}),children:"标题填写区"}),l&&f.jsxs("div",{children:[f.jsx(rn,{label:"作图底图 URL",value:n.backgroundUrl,maxLength:4096,onChange:w=>v({backgroundUrl:w})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async w=>{const C=w.target.files?.[0];if(w.target.value="",!!C){u(!0),g("");try{const y=a?await a(C):await new Promise((S,E)=>{const R=new FileReader;R.onload=()=>S(String(R.result)),R.onerror=()=>E(new Error("读取失败")),R.readAsDataURL(C)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(y))throw new Error("图片地址无效");m.current&&b.current.onChange({...b.current.value,backgroundUrl:y})}catch{m.current&&g("图片上传失败,请重试")}finally{m.current&&u(!1)}}}}),f.jsx(ue,{size:"small",loading:s,onClick:()=>c.current?.click(),children:"上传底图"}),h&&f.jsx("p",{role:"alert",children:h})]})]})}function QR({value:n,onChange:r,correction:l=!1,practice:a=!1}){const[c,s]=x.useState(n[0]?.id),u=n.find(v=>v.id===c)||n[0],h=n.indexOf(u),g=l?"改错位置":a?"评价项":"评分点",m=v=>r(n.map(w=>w.id===u.id?{...w,...v}:w)),b=v=>{const w=v&&u?{...fo(u),label:Mr(n)}:{id:crypto.randomUUID(),label:Mr(n),score:null,prompt:"",answer:""},C=[...n];C.splice(h+1,0,w),r(C),s(w.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${g}`,children:n.map(v=>f.jsx(ue,{size:"small","aria-pressed":v.id===u?.id,onClick:()=>s(v.id),children:v.label},v.id))}),f.jsx(js,{name:g,maximum:20,index:h,count:n.length,onAdd:()=>b(!1),onCopy:()=>b(!0),onMove:v=>r(Qo(n,u.id,v)),onDelete:()=>r(n.filter(v=>v.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`${g}编号`,value:u.label,onChange:v=>m({label:v})}),f.jsx(Qt,{label:`${g}分值`,value:u.score,onChange:v=>m({score:v})})]}),f.jsx(rn,{label:l?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:v=>m({prompt:v})}),f.jsx(Yt,{label:l?"改正答案":a?"评价标准":"评分要点",children:f.jsx(xs,{"aria-label":l?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:v=>m({answer:v.target.value})})})]})]})}function ZR({value:n,onChange:r,onInsert:l}){const[a,c]=x.useState(n[0]?.id),s=n.find(m=>m.id===a)||n[0],u=n.indexOf(s),h=m=>r(n.map(b=>b.id===s.id?{...b,...m}:b)),g=m=>{const b=m&&s?{...fo(s),label:Mr(n)}:{...am(),label:Mr(n)},v=[...n];v.splice(u+1,0,b),r(v),c(b.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:n.map(m=>f.jsx(ue,{size:"small","aria-pressed":m.id===s?.id,onClick:()=>c(m.id),children:m.label},m.id))}),f.jsx(js,{name:"空位",maximum:20,index:u,count:n.length,onAdd:()=>g(!1),onCopy:()=>g(!0),onMove:m=>r(Qo(n,s.id,m)),onDelete:()=>{r(n.filter(m=>m.id!==s.id)),c(n[Math.max(0,u-1)]?.id)}}),s&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"空位编号",value:s.label,onChange:m=>h({label:m})}),f.jsx(Qt,{label:"每空分值",value:s.score,max:15,onChange:m=>h({score:m})}),f.jsx(ot,{label:"空位样式",value:s.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:m=>h({style:m})}),f.jsx(ot,{label:"空位宽度",value:String(s.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:m=>h({width:Number(m)})}),s.style==="characters"&&f.jsx(mt,{label:"字格数量",value:s.characters,min:1,max:40,onChange:m=>h({characters:m})}),f.jsx(rn,{label:"空前提示",value:s.prefix,onChange:m=>h({prefix:m})}),f.jsx(rn,{label:"空后单位",value:s.suffix,onChange:m=>h({suffix:m})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(qt,{checked:s.breakAfter,onChange:m=>h({breakAfter:m.target.checked}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>r(n.map(m=>({...m,width:s.width,style:s.style,characters:s.characters}))),children:"统一空位样式"})]}),f.jsx(ue,{size:"small",onClick:()=>l(s),children:"插入此空到题干"}),f.jsx(Yt,{label:"可接受答案(每行一个)",children:f.jsx(xs,{"aria-label":"可接受答案",value:s.answers.join(`
199
+ `),autoSize:{minRows:2,maxRows:5},onChange:m=>h({answers:m.target.value.split(`
200
+ `)})})})]})]})}function Ov({value:n,onChange:r,onRemove:l,category:a=!1}){const{uploadImage:c}=Tt(),[s,u]=x.useState(n[0]?.id),h=n.find(v=>v.id===s)||n[0],g=n.indexOf(h),m=a?"类别":"共享选项",b=v=>{const w=v&&h?fo(h):{id:crypto.randomUUID(),label:"",text:""},C=new Set(n.map(S=>S.label));w.label=Array.from({length:26},(S,E)=>String.fromCharCode(65+E)).find(S=>!C.has(S))||Mr(n);const y=[...n];y.splice(g+1,0,w),r(y),u(w.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:n.map(v=>f.jsx(ue,{size:"small","aria-pressed":v.id===h?.id,onClick:()=>u(v.id),children:v.label},v.id))}),f.jsx(js,{name:m,maximum:26,index:g,count:n.length,onAdd:()=>b(!1),onCopy:()=>b(!0),onMove:v=>r(Qo(n,h.id,v)),onDelete:()=>l(h.id)}),h&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`${m}编号`,value:h.label,onChange:v=>r(n.map(w=>w.id===h.id?{...w,label:v}:w))}),f.jsx(rn,{label:`${m}内容`,value:h.text,onChange:v=>r(n.map(w=>w.id===h.id?{...w,text:v}:w))})]}),h&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Ai,{value:h.document||Bt(),ariaLabel:`共享选项 ${h.label} 图文内容`,uploadImage:c,onChange:v=>r(n.map(w=>w.id===h.id?{...w,document:v}:w))},h.id)]})]})}function WR({value:n,kind:r,item:l,onChange:a}){const c=s=>a({...n,...s});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(Ov,{value:n.pool,onChange:s=>c({pool:s,sequence:[...n.sequence.filter(u=>s.some(h=>h.id===u)),...s.filter(u=>!n.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:s=>a(PS(n,s))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"匹配呈现",value:n.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:s=>c({matchingDisplay:s})}),f.jsx(ot,{label:"对应关系",value:n.relation,options:{one:"一对一",many:"一对多"},onChange:s=>c({relation:s,items:n.items.map(u=>({...u,targets:s==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(qt,{checked:n.reuseOptions,onChange:s=>{const u=new Set;c({reuseOptions:s.target.checked,items:n.items.map(h=>({...h,targets:h.targets.filter(g=>s.target.checked?!0:u.has(g)?!1:(u.add(g),!0))}))})},children:"允许选项重复使用"}),l&&f.jsx(Yt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:n.pool.map(s=>f.jsx(ue,{size:"small","aria-pressed":l.targets.includes(s.id),onClick:()=>a($S(n,l.id,l.targets.includes(s.id)?l.targets.filter(u=>u!==s.id):[...l.targets,s.id])),children:s.label},s.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(ot,{label:"排序或分类",value:n.ordering,options:{sequence:"排序",category:"分类"},onChange:s=>c({ordering:s})}),n.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:n.sequence.map((s,u)=>f.jsx(ot,{label:`第 ${u+1} 位答案`,value:s,options:Object.fromEntries(n.pool.map(h=>[h.id,`${h.label}. ${h.text}`])),onChange:h=>{const g=[...n.sequence],m=g.indexOf(h);m>=0&&(g[m]=s),g[u]=h,c({sequence:g})}},u))}):f.jsxs("div",{children:[f.jsx(Ov,{category:!0,value:n.categories,onChange:s=>c({categories:s}),onRemove:s=>c({categories:n.categories.filter(u=>u.id!==s),assignments:Object.fromEntries(Object.entries(n.assignments).filter(([,u])=>u!==s))})}),n.pool.map(s=>f.jsx(ot,{label:`${s.label} 所属类别`,value:n.assignments[s.id]||"",options:{"":"未设置",...Object.fromEntries(n.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...n.assignments,[s.id]:u}})},s.id))]})]})]})}function JR({value:n,onChange:r}){const[l,a]=x.useState(0),c=s=>r({...n,...s});return f.jsxs("div",{children:[f.jsx(Yt,{label:"待断句原文",children:f.jsx(xs,{"aria-label":"待断句原文",value:n.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:s=>a(s.currentTarget.selectionStart),onChange:s=>r(GS(n,s.target.value))})}),f.jsx(ue,{size:"small",disabled:l<=0||l>=n.chunkText.length||n.chunkPoints.length>=26||n.chunkPoints.some(s=>s.offset===l),onClick:()=>{const s=new Set(n.chunkPoints.map(h=>h.label)),u=Array.from({length:26},(h,g)=>String.fromCharCode(65+g)).find(h=>!s.has(h));c({chunkPoints:[...n.chunkPoints,{id:crypto.randomUUID(),offset:l,label:u}].sort((h,g)=>h.offset-g.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:n.chunkPoints.map(s=>f.jsxs("div",{children:[f.jsxs(qt,{checked:n.chunkCorrect.includes(s.id),onChange:u=>c({chunkCorrect:u.target.checked?[...n.chunkCorrect,s.id]:n.chunkCorrect.filter(h=>h!==s.id)}),children:[s.label," · ",n.chunkText.slice(Math.max(0,s.offset-4),s.offset),"|",n.chunkText.slice(s.offset,s.offset+4)]}),f.jsx(ue,{size:"small",type:"text","aria-label":`删除断点 ${s.label}`,onClick:()=>c({chunkPoints:n.chunkPoints.filter(u=>u.id!==s.id),chunkCorrect:n.chunkCorrect.filter(u=>u!==s.id)}),children:"删除"})]},s.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"最多选择断点数",value:n.chunkMax,min:1,max:26,onChange:s=>c({chunkMax:s})}),f.jsx(Qt,{label:"断句满分",value:n.groupScore,max:10,onChange:s=>c({groupScore:s})}),f.jsx(Qt,{label:"每个正确断点分值",value:n.chunkScore,max:10,onChange:s=>c({chunkScore:s})})]})]})}function eN({value:n,kind:r,blockId:l,selectedId:a,onSelect:c,onChange:s}){const{card:u,uploadImage:h,insertMaterialBlank:g,geometry:m}=Tt(),b=x.useRef([]),v=x.useRef([]),[,w]=x.useState(0),[C,y]=x.useState(1),[S,E]=x.useState(1),[R,N]=x.useState(null),T=n.items.find(I=>I.id===a)||n.items[0],O=n.items.indexOf(T),D=(I,Y=T?.id)=>{JSON.stringify(n)!==JSON.stringify(I)&&(b.current.push({value:n,id:T?.id}),b.current=b.current.slice(-50),v.current=[],s(I),Y&&c(Y),w(k=>k+1))},M=I=>D({...n,...I}),z=I=>M({items:n.items.map(Y=>Y.id===T.id?{...Y,...I}:Y)}),H=I=>s({...n,items:n.items.map(Y=>Y.id===T.id?{...Y,...I}:Y)}),G=I=>{const Y=I&&T?US(T,Mr(n.items)):Qc(T?.kind||Zc(r),Mr(n.items)),k=[...n.items];k.splice(O+1,0,Y),D({...n,items:k},Y.id)},X=I=>{const Y=I?v.current:b.current,k=I?b.current:v.current,$=Y.pop();if(!$)return;k.push({value:n,id:T?.id});const L=$.value.items.map(Z=>{const A=n.items.find(V=>V.id===Z.id);return A?{...Z,document:A.document,reference:A.reference,explanation:A.explanation}:Z});s({...$.value,items:L}),$.id&&c($.id),w(Z=>Z+1)},U=nm.includes(r),F=T&&["answer","calculation","correction","drawing","writing","english"].includes(T.kind),J=VS(n,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:n.items.map(I=>f.jsx(ue,{size:"small","aria-pressed":T?.id===I.id,onClick:()=>c(I.id),children:I.label},I.id))}),f.jsx(js,{index:O,count:n.items.length,maximum:om(r),onAdd:()=>G(!1),onCopy:()=>G(!0),onMove:I=>M({items:Qo(n.items,T.id,I)}),onDelete:()=>{const I=n.items.filter(Y=>Y.id!==T.id);D({...n,items:I,chooseCount:Math.min(n.chooseCount,Math.max(1,I.length))},I[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"追加题数",value:C,min:1,max:50,onChange:y}),f.jsx(mt,{label:"起始题号",value:S,min:1,max:1e3,onChange:E}),f.jsx(Qt,{label:"统一题分",value:R,max:Math.min(70,...n.items.map(I=>Al(I.kind))),onChange:N})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:n.items.length+C>om(r),onClick:()=>{const I=[...n.items],Y=[];for(let k=0;k<C;k++)Y.push(Qc(T?.kind||Zc(r),Mr([...I,...Y])));I.splice(O+1,0,...Y),D({...n,items:I},Y[0].id)},children:"追加空白题"}),f.jsx(ue,{size:"small",onClick:()=>M({items:n.items.map((I,Y)=>({...I,label:String(S+Y),choice:{...I.choice,label:String(S+Y)}}))}),children:"连续编号"}),f.jsx(ue,{size:"small",disabled:R!==null&&n.items.some(I=>R>Al(I.kind)),onClick:()=>M({items:n.items.map(I=>({...I,score:R,choice:{...I.choice,score:R}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!b.current.length,onClick:()=>X(!1),children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!v.current.length,onClick:()=>X(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(JR,{value:n,onChange:D}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"选做题数",value:n.chooseCount,min:1,max:Math.max(1,n.items.length),onChange:I=>M({chooseCount:I})}),f.jsx(Qt,{label:"选做题组总分",value:n.groupScore,max:200,onChange:I=>M({groupScore:I})})]}),T&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"当前题号",value:T.label,onChange:I=>z({label:I,choice:{...T.choice,label:I}})}),f.jsx(Qt,{label:"当前题分",value:T.score,max:Al(T.kind),onChange:I=>z({score:I,choice:{...T.choice,score:I}})}),U&&r!=="cloze"&&r!=="completion"&&f.jsx(ot,{label:"小题题型",value:T.kind,options:HS,onChange:I=>z({kind:I})})]}),r==="cloze"&&f.jsx(ue,{size:"small",onClick:()=>g(l,T.id,T.label,60),children:"插入题号到公共材料"}),T.kind==="judge"&&f.jsxs("div",{children:[f.jsx(ot,{label:"判断标记",value:n.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:I=>M({judgeLabels:I})}),f.jsx(Yt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:rm[n.judgeLabels].map((I,Y)=>f.jsx(ue,{size:"small","aria-pressed":T.judgment===(Y===0),onClick:()=>z({judgment:T.judgment===(Y===0)?null:Y===0}),children:I},Y))})}),f.jsx(qt,{checked:T.needsReason,onChange:I=>z({needsReason:I.target.checked}),children:"判断后改正/说明理由"}),T.needsReason&&f.jsx(jv,{value:T.area,onChange:I=>z({area:I})})]}),T.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(Tv,{value:{...Kc(0),presentation:T.presentation,questions:[T.choice]},document:T.document,creation:u.creation,selectedId:T.choice.id,onSelect:()=>{},onChange:I=>{const Y=I.questions.find(k=>k.id===T.choice.id);Y&&z({choice:Y,presentation:I.presentation,score:Y.score??null})},singleQuestion:!0})]}),T.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(qt,{checked:n.fillNewLine,onChange:I=>M({fillNewLine:I.target.checked}),children:"每题一行"}),f.jsx(ZR,{value:T.blanks,onChange:I=>z({blanks:I}),onInsert:I=>g(l,I.id,`${T.label}.${I.label}`,m.columnWidth*I.width/100-30)})]}),F&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(jv,{value:T.area,drawing:T.kind==="drawing",onChange:I=>z({area:I})})]}),["answer","calculation","correction"].includes(T.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":T.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(QR,{value:T.steps,correction:T.kind==="correction",practice:r==="practice",onChange:I=>z({steps:I})})]}),T.kind==="table"&&f.jsx(ue,{size:"small",disabled:!pn(T.document),onClick:()=>z({document:qS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(WR,{value:n,kind:r,item:T,onChange:D}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Ai,{value:T.document,ariaLabel:`小题 ${T.label} 正文设置`,uploadImage:h,onChange:I=>H({document:I})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Yt,{label:"参考答案",children:f.jsx(Ai,{value:T.reference,ariaLabel:"参考答案",uploadImage:h,onChange:I=>H({reference:I})})}),f.jsx(Yt,{label:"解析",children:f.jsx(Ai,{value:T.explanation,ariaLabel:"答案解析",uploadImage:h,onChange:I=>H({explanation:I})})})]})]},T.id),r==="practice"&&f.jsx(rn,{label:"作品/音视频引用 URL",value:n.attachmentUrl,maxLength:4096,onChange:I=>M({attachmentUrl:I})}),J.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:J.join(";")})]})}function tN({group:n,creation:r,start:l,scanMarking:a,onAdd:c}){const s=y=>{const S=nu(y,l,r);return n.type==="MIXED"&&y==="MCHOICE"?{...S,scoreType:n.scoreType||"LESS_SCORE",score:n.scoreType==="ITEM_SCORE"?S.score:null}:S},[u,h]=x.useState(()=>s(n.type==="MIXED"?"SCHOICE":n.type)),[g,m]=x.useState(null),[b,v]=x.useState({start:null,end:null}),w=y=>{m(null),h(S=>({...S,...y}))},C=Zo[u.type];return f.jsxs("div",{className:"reference-add-panel",children:[n.type==="MIXED"&&f.jsx(ot,{label:"子题题型",value:u.type,options:Object.fromEntries(cm(r,!0).map(y=>[y,Wn[y]])),onChange:y=>{h(s(y)),v({start:null,end:null}),m(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ma,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:y=>v(S=>({...S,start:y}))}),!ci(u.type)&&f.jsx(ma,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+C.count-1),onChange:y=>v(S=>({...S,end:y}))}),Ct(u.type)&&(C.options[0]===C.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:C.options[0]})]}):f.jsx(ma,{label:"选项个数",value:u.optionCount,min:C.options[0],max:C.options[1],onChange:y=>w({optionCount:y})})),ke(u.type)&&f.jsx(ma,{label:"子题数量",value:u.partCount,min:1,max:C.parts,onChange:y=>w({partCount:y})}),["FILLBLANK","SHORTANSWER"].includes(u.type)&&f.jsx(mt,{label:u.type==="FILLBLANK"?"每题空数":"每题小题数",value:u.partCount||1,min:1,max:u.type==="SHORTANSWER"&&(a||n.optional)?1:C.parts,onChange:y=>w({partCount:y})}),f.jsx(Qt,{label:u.type==="FILLBLANK"?"每空分值":u.type==="SHORTANSWER"?"每小题分值":"每题分值",value:u.score,max:C.score,onChange:y=>w({score:y,lessScore:0})}),u.type==="MCHOICE"&&f.jsxs(x.Fragment,{children:[n.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:u.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:y=>w({scoreType:y,lessScore:0})}),u.scoreType==="LESS_SCORE"&&f.jsx(mt,{label:"少选得分",value:u.lessScore,min:0,max:u.score||0,step:.5,onChange:y=>w({lessScore:y})})]}),u.type==="CHUNK_CHOICE"&&f.jsxs(x.Fragment,{children:[f.jsx(ma,{label:"正确答案个数",value:u.rightAnswers,min:1,max:(u.optionCount||2)-1,onChange:y=>w({rightAnswers:y})}),f.jsx(Qt,{label:"每涂对一处得分",value:u.singleScore,max:u.score||10,onChange:y=>w({singleScore:y})})]}),u.type==="CCOMPOSITION"&&f.jsx(mt,{label:"作文格数",value:u.characters,min:1,max:1200,onChange:y=>w({characters:y})}),u.type==="ECOMPOSITION"&&f.jsx(mt,{label:"作文行数",value:u.lines,min:1,max:100,onChange:y=>w({lines:y})})]}),g&&f.jsx("p",{role:"alert",className:"card-choice-error",children:g}),f.jsx(ue,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!ci(u.type)&&b.end===null){m("请输入起始题号和结束题号");return}const y={...u,start:b.start,end:ci(u.type)?b.start:b.end},S=JS(n,y,a);m(S),S||c(y)},children:"添加题目"})]})}function ma({label:n,value:r,min:l,max:a,onChange:c}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,value:r,min:l,max:a,precision:0,placeholder:"请输入",onChange:c})})}function nN({value:n,onChange:r,onClose:l}){const a=n.questions.filter(C=>Ct(C.type)).flatMap(C=>ke(C.type)?C.parts:[C]),[c,s]=x.useState([]),[u,h]=x.useState(!1),[g,m]=x.useState(!1),[b,v]=x.useState(2),w=()=>{const C=(y,S)=>!c.includes(y.id)||!y.text?y:{...y,text:{...y.text,layout:{...y.text.layout,indent:u,layout:g?"fixed":"natural",columns:g?b:S?4:2}}};r({...n,questions:n.questions.map(y=>({...C(y,y.type==="CLOZE"),parts:y.parts.map(S=>C(S,y.type==="CLOZE"))}))}),l()};return f.jsx(Cs,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(Oo,{name:"close"}),onCancel:l,footer:f.jsxs(f.Fragment,{children:[f.jsx(ue,{onClick:l,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c.length,onClick:w,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(qt,{checked:c.length===a.length,onChange:C=>s(C.target.checked?a.map(y=>y.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(C=>f.jsxs(qt,{checked:c.includes(C.id),onChange:y=>s(S=>y.target.checked?[...S,C.id]:S.filter(E=>E!==C.id)),children:["第 ",C.label," 题"]},C.id))}),f.jsx(ot,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:C=>h(C==="true")}),f.jsx(ot,{label:"个数排版",value:String(g),options:{false:"否",true:"是"},onChange:C=>m(C==="true")}),g&&f.jsx(ot,{label:"排版方式",value:String(b),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:C=>v(Number(C))})]})})}function rN({block:n,value:r,selectedId:l,onSelect:a,onChange:c}){const{card:s,geometry:u,setCard:h,editQuestion:g,insertMaterialBlank:m}=Tt(),[b,v]=x.useState(null),[w,C]=x.useState(!1),[y,S]=x.useState([]),[E,R]=x.useState([]),[N,T]=x.useState(""),[O,D]=x.useState(!1),M=r.questions.find(L=>L.id===l||L.parts.some(Z=>Z.id===l))||r.questions[0],z=r.questions.indexOf(M),H=(L,Z)=>{S(A=>[...A.slice(-49),{value:r,document:n.document}]),R([]),T(""),v(null),c(L,Z)},G=L=>H({...r,questions:r.questions.map(Z=>Z.id===L.id?L:Z)}),X=Jo(r),U=Yc(r.layout),F=Ol(n.document),J={...r.layout,direction:s.choiceDirection||r.layout.direction,questions:X},I=Fc(J),Y=U!=="concentrated"?Ko(J,n.document,!0).concentrated.questions:[],k=Sv(n),$=L=>{const Z=L.value;c({...Z,questions:Z.questions.map(A=>{const V=r.questions.find(K=>K.id===A.id);return V?{...A,text:V.text||A.text,document:gn(V.document,A.label,A.score),parts:A.parts.map(K=>({...K,text:V.parts.find(ee=>ee.id===K.id)?.text||K.text,document:gn(V.parts.find(ee=>ee.id===K.id)?.document||K.document,K.label,K.score)}))}:A})},GR(n.document,L.document))};return f.jsxs("div",{className:"exercise-panel reference-panel",children:[r.type==="MIXED"&&f.jsx(ot,{label:"复合题少选计分",value:r.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:L=>H({...r,scoreType:L,questions:r.questions.map(Z=>Z.type==="MCHOICE"?{...Z,choice:{...Z.choice,scoreType:L,lessScore:L==="ITEM_SCORE"?0:Z.choice.lessScore}}:Z)})}),X.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"选择题填涂位置",value:U,options:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:L=>{const Z=Xc(J,n.document,L),A=new Map(Z.questions.map(V=>[V.id,V]));H({...r,layout:{...Z,questions:[]},questions:r.questions.map(V=>({...V,choice:A.get(V.id)||V.choice,parts:V.parts.map(K=>({...K,choice:A.get(K.id)||K.choice}))}))})}}),f.jsx(ot,{label:"填涂排列方向",value:I,options:new Set(X.map(L=>L.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:L=>h(Z=>({...Z,choiceDirection:L}))}),I==="column"&&f.jsx(mt,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:L=>H({...r,layout:{...r.layout,rowsPerColumn:L}})}),r.textVersion===1&&s.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ue,{size:"small",onClick:()=>D(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(x.Fragment,{children:[f.jsx(ot,{label:"当前题目",value:M.id,options:Object.fromEntries(r.questions.map(L=>[L.id,`${ke(L.type)?L.parts.map(Z=>Z.label).join("、"):L.label} · ${Wn[L.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>C(L=>!L),children:"新增题目"}),f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Dl(r)+M.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const L=tC(M,Dl(r)),Z=[...r.questions];Z.splice(z+1,0,L),H({...r,questions:Z},$R(n.document,M,L)),a(L.id)},children:"复制当前题目"}),f.jsx(ue,{size:"small","aria-label":"上移当前题目",disabled:z<=0,onClick:()=>H({...r,questions:Qo(r.questions,M.id,-1)}),children:"↑"}),f.jsx(ue,{size:"small","aria-label":"下移当前题目",disabled:z>=r.questions.length-1,onClick:()=>H({...r,questions:Qo(r.questions,M.id,1)}),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,onClick:()=>{const L=r.questions.filter(Z=>Z.id!==M.id);H({...r,questions:L,optional:r.optional&&L.length>1,choose:Math.max(1,Math.min(r.choose,L.length-1))}),L.length&&a(L[Math.max(0,z-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||w)&&f.jsx(tN,{group:r,creation:s.creation,start:Dl(r),scanMarking:!!s.scanMarking,onAdd:L=>{const Z=eC(r,{...L,paperWidth:u.columnWidth},M?.id);H({...Z,questions:Z.questions.map(A=>r.questions.some(V=>V.id===A.id)?A:{...A,halfPoint:!!s.halfPoint})}),a(Z.questions.find(A=>!r.questions.some(V=>V.id===A.id)).id),C(!1)}},`${r.type}/${Dl(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(x.Fragment,{children:[f.jsx(qt,{checked:r.optional,disabled:r.questions.some(L=>L.parts.length>1),onChange:L=>H({...r,optional:L.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(mt,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:s.scanMarking?r.questions.length-1:1,onChange:L=>H({...r,choose:L})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Qt,{label:"分组总分",value:b??Un(r.questions),max:1e4,onChange:v}),f.jsx(ue,{size:"small",disabled:(b??Un(r.questions))===null,onClick:()=>{const L=oC(r,b??Un(r.questions));L?H(L):T("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),M&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"编辑正文",value:k.some(L=>L.id===l)?l:M.id,options:Object.fromEntries(k.map(L=>[L.id,L.label])),onChange:L=>{a(L),g(n.id,L)}}),f.jsx(ue,{size:"small",onClick:()=>g(n.id,l||M.id),children:"编辑当前正文"})]}),Y.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",Y.map(L=>L.label).join("、")," 题",U==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),M&&f.jsx(oN,{value:M,group:r,scanMarking:!!s.scanMarking,onApply:L=>{const Z=r.questions.find(ee=>ee.id===L.id),A={...L,document:gn(Z.document,L.label,L.score),parts:L.parts.map(ee=>({...ee,document:gn(Z.parts.find(le=>le.id===ee.id)?.document||ee.document,ee.label,ee.score)}))},V=r.questions.filter(ee=>ee.id!==A.id).flatMap(ee=>ke(ee.type)?ee.parts.map(le=>le.label):[ee.label]),K=ke(A.type)?A.parts.map(ee=>ee.label):[A.label];return K.some(ee=>!ee.trim()||V.includes(ee))||new Set(K).size!==K.length?(T("题号不能为空或重复"),!1):(r.optional?H({...r,questions:r.questions.map(ee=>ee.id===A.id?A:{...ee,score:A.score,document:gn(ee.document,ee.label,A.score),parts:ee.parts.map(le=>({...le,score:A.score,document:gn(le.document,le.label,A.score)}))})}):G(A),!0)}},M.id),M&&si(M.type)&&f.jsxs(x.Fragment,{children:[f.jsx(qt,{checked:r.fillNewLine,onChange:L=>H({...r,fillNewLine:L.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:M.parts.map(L=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`空位 ${L.label} 显示题号`,maxLength:10,value:L.label,onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,label:Z}:A)})}),f.jsx(ot,{label:`空位 ${L.label} 宽度`,value:String(L.width),options:{...s.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,width:Number(Z)}:A)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",onClick:()=>m(n.id,L.id,L.label,u.columnWidth*L.width/100),children:"插入此空到正文"}),f.jsx(qt,{checked:L.breakAfter,onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,breakAfter:Z.target.checked}:A)}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>H({...r,questions:r.questions.map(Z=>si(Z.type)?{...Z,parts:Z.parts.map(A=>({...A,width:L.width}))}:Z)}),children:"宽度统一设置"})]})]},L.id))})]}),M&&Ct(M.type)&&f.jsx(x.Fragment,{children:(ke(M.type)?M.parts.map(L=>L.choice):[M.choice]).map(L=>f.jsxs("div",{children:[f.jsxs(qt,{checked:L.breakBefore,onChange:Z=>{const A={...L,breakBefore:Z.target.checked};G({...M,choice:M.choice.id===L.id?A:M.choice,parts:M.parts.map(V=>V.choice.id===L.id?{...V,choice:A}:V)})},children:[L.label," 题前换行"]}),U==="option"&&r.textVersion!==1&&f.jsx(ot,{label:`${L.label} 题对应正文选项`,value:L.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries(F.map((Z,A)=>[Z.id,`第 ${Z.label||A+1} 组选项`]))},onChange:Z=>{const A=F.find(K=>K.id===Z),V={...L,contentTarget:A?{groupId:Z,optionIds:A.options.map(K=>K.id)}:null};G({...M,choice:M.choice.id===L.id?V:M.choice,parts:M.parts.map(K=>K.choice.id===L.id?{...K,choice:V}:K)})}})]},L.id))}),N&&f.jsx("p",{className:"card-choice-error",role:"alert",children:N}),O&&f.jsx(nN,{value:r,onChange:H,onClose:()=>D(!1)}),(y.length>0||E.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!y.length,onClick:()=>{const L=y.at(-1);S(y.slice(0,-1)),R(Z=>[...Z,{value:r,document:n.document}]),$(L)},children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!E.length,onClick:()=>{const L=E.at(-1);R(E.slice(0,-1)),S(Z=>[...Z,{value:r,document:n.document}]),$(L)},children:"重做题型配置"})]})]})}function oN({value:n,group:r,scanMarking:l,onApply:a}){const{card:c}=Tt(),[s,u]=x.useState(null),[h,g]=x.useState(""),m=s||n,b=E=>{u({...m,...E}),g("")},v=m.type,w=Zo[v],C=m.choice.options.length,y=m.parts.length,S=E=>{const R=Array.from({length:E},(N,T)=>m.parts[T]||ui(ke(v)?String(Number(m.parts[0]?.label||m.label)+T):E===1?m.label:`${m.label}.${T+1}`,m.parts[0]?.score??null,v,m.choice.options.length));ke(v)||R.forEach((N,T)=>{R[T]={...N,label:E===1?m.label:`${m.label}.${T+1}`}}),b({parts:R,score:Un(R)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(v)&&f.jsx(ot,{label:"题型",value:v,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:E=>{const R=E==="MCHOICE"&&ri(c.creation)&&m.score===null?6:m.score;b({type:E,score:R,choice:{...Wo(m.choice,E,C),score:R,scoreType:E==="MCHOICE"&&ri(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!ke(v)&&f.jsx(rn,{label:"题目题号",value:m.label,maxLength:10,onChange:E=>b({label:E,choice:{...m.choice,label:E},parts:m.parts.map((R,N)=>({...R,label:m.parts.length===1?E:`${E}.${N+1}`}))})}),Ct(v)&&f.jsx(mt,{label:"选项个数",min:w.options[0],max:w.options[1],value:C,onChange:E=>b({choice:Wo(m.choice,v,E),parts:m.parts.map(R=>({...R,choice:Wo(R.choice,v,E)}))})}),y>0&&(v==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Yt,{label:"子题数量",children:f.jsx("span",{children:y})}),y>0&&v!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(mt,{label:ke(v)?"子题数量":v==="FILLBLANK"?"每题空数":"每题小题数",value:y,min:1,max:v==="SHORTANSWER"&&(l||r.optional)?1:w.parts,onChange:S}),!y&&f.jsx(Qt,{label:"本题分值",value:m.score,max:w.score,onChange:E=>b({score:E,choice:{...m.choice,score:E,lessScore:0}})}),ke(v)&&f.jsx(Qt,{label:"每题分值",value:m.parts[0]?.score??null,max:w.score,onChange:E=>{const R=m.parts.map(N=>({...N,score:E,choice:{...N.choice,score:E}}));b({parts:R,score:Un(R)})}}),v==="MCHOICE"&&f.jsxs(x.Fragment,{children:[r.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:m.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:E=>b({choice:{...m.choice,scoreType:E,lessScore:0}})}),m.choice.scoreType!=="ITEM_SCORE"&&f.jsx(mt,{label:"少选得分",min:0,max:m.score||0,step:.5,value:m.choice.lessScore||0,onChange:E=>b({choice:{...m.choice,lessScore:E}})})]}),v==="CHUNK_CHOICE"&&f.jsxs(x.Fragment,{children:[f.jsx(ma,{label:"正确答案个数",value:m.rightAnswers,min:1,max:C-1,onChange:E=>b({rightAnswers:E})}),f.jsx(Qt,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:E=>b({singleScore:E})})]}),v==="CCOMPOSITION"&&f.jsx(mt,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:E=>b({characters:E})}),v==="ECOMPOSITION"&&f.jsx(Yt,{label:"初始作文行数",children:f.jsx("span",{children:m.lines})}),v==="CCOMPOSITION"&&f.jsx(mt,{label:"题干区域高度",value:m.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:E=>b({contentHeight:E})})]}),m.parts.map((E,R)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}题号`,value:E.label,maxLength:10,onChange:N=>b({parts:m.parts.map(T=>T.id===E.id?{...T,label:N,choice:{...T.choice,label:N}}:T)})}),!ke(v)&&f.jsx(Qt,{label:`第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}分值`,value:E.score,max:w.score,onChange:N=>{const T=m.parts.map(O=>O.id===E.id?{...O,score:N,choice:{...O.choice,score:N}}:O);b({parts:T,score:Un(T)})}}),["FILLBLANK","SHORTANSWER"].includes(v)&&r.type!=="MIXED"&&!r.optional&&y>1&&f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const N=m.parts.filter(T=>T.id!==E.id).map((T,O)=>({...T,label:y===2?m.label:`${m.label}.${O+1}`}));b({parts:N,score:Un(N)})},children:"删除"}),v==="SHORTANSWER"&&!r.optional&&f.jsx(mt,{label:`第 ${R+1} 小题作答高度`,value:E.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:N=>b({parts:m.parts.map(T=>T.id===E.id?{...T,height:N}:T)})})]},E.id)),m.parts.length>0&&f.jsx(Yt,{label:"本题总分",children:f.jsx("span",{children:m.score??"未设置"})}),!Ct(v)&&!si(v)&&f.jsx(qt,{checked:m.halfPoint,onChange:E=>b({halfPoint:E.target.checked}),children:"计分栏显示 0.5"}),h&&f.jsx("p",{className:"card-choice-error",role:"alert",children:h}),f.jsx(ue,{size:"small",disabled:!s,onClick:()=>{if((y?m.parts:[m]).some(E=>E.score===null||E.score<.5||E.score>w.score)){g("请填写符合题型范围的分值");return}if(m.parts.some(E=>!E.label.trim())){g("题号不能为空");return}if(v==="INFO_MATCHING"&&y>C){g("选项个数需大于等于子题数量");return}if(v==="CHUNK_CHOICE"&&(!m.rightAnswers||m.rightAnswers>=C||m.singleScore===null||m.score!==null&&m.rightAnswers*m.singleScore>m.score)){g("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(v==="MCHOICE"&&(m.choice.lessScore||0)>(m.score||0)){g("少选得分不能超过本题分值");return}a(m)&&u(null)},children:"应用配置"})]})}function aN({block:n,autoFocus:r,onClose:l}){const{card:a,setCard:c,setSelectedId:s,setDeleted:u,updateBlock:h,editQuestion:g,selectedChoiceId:m,selectChoice:b}=Tt(),{dialog:v,setDialog:w,titleProps:C,cancelDrag:y}=Id(T=>{const O=T.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(O?.left??window.innerWidth)-T.getBoundingClientRect().width-12,top:(O?.top??0)+12}}),S=x.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);x.useLayoutEffect(()=>{if(!v)return;const T=v;T.setAttribute("aria-modal","false"),T.setAttribute("aria-labelledby","card-block-modal-title");let O=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=M=>{M.target instanceof HTMLElement&&!T.contains(M.target)&&(O=M.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),T.contains(document.activeElement)&&O?.isConnected&&O.focus({preventScroll:!0})}},[v]),x.useLayoutEffect(()=>{v&&(v.dataset.settingsBlock=n.id)},[v,n.id]);const E=f.jsxs("div",{...C,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:n.reference?Wn[n.reference.type]:im[n.kind]})]}),R=()=>{u({block:n,index:a.blocks.findIndex(T=>T.id===n.id)}),c(T=>({...T,blocks:T.blocks.filter(O=>O.id!==n.id)})),s(null),l()},N=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ue,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:R,children:[f.jsx(Oo,{name:"trash",size:16}),"删除题块"]}),f.jsx(ue,{type:"text",onClick:()=>{const T=fo(n);c(O=>{const D=[...O.blocks];return D.splice(D.findIndex(M=>M.id===n.id)+1,0,T),{...O,blocks:D}}),s(T.id)},children:"复制题块"}),f.jsx(ue,{type:"primary",className:"card-edit-question",onClick:()=>g(n.id),children:"编辑题目"})]});return f.jsx(Cs,{open:!0,modal:!1,panelRef:w,className:"card-modal card-block-modal",width:400,zIndex:900,classNames:{header:"card-modal-header",body:"card-modal-body card-inspector",footer:"card-modal-footer"},closeLabel:"关闭题块设置",closeIcon:f.jsx(Oo,{name:"close",size:16}),onCancel:l,onOpenAutoFocus:T=>{T.preventDefault(),r?v?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):S.current?.focus({preventScroll:!0})},onEscapeKeyDown:T=>{T.preventDefault(),T.stopPropagation(),y()||l()},title:E,footer:N,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(Oi,{"aria-label":"题块标题",value:n.title,maxLength:300,onChange:T=>h(n.id,{title:T.target.value})})]}),n.reference&&f.jsx(rN,{block:n,value:n.reference,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:(T,O)=>h(n.id,{reference:T,...O?{document:O}:{}})}),!n.reference&&n.kind==="choice"&&n.choices&&f.jsx(Tv,{value:n.choices,document:n.document,creation:a.creation,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:T=>h(n.id,{choices:T})}),!n.reference&&n.kind!=="choice"&&n.exercise&&f.jsx(eN,{value:n.exercise,kind:n.kind,blockId:n.id,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:T=>h(n.id,{exercise:T})}),!n.reference&&n.kind!=="choice"&&!n.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[n.answerHeight," px"]}),f.jsx(hv,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:n.answerHeight,onChange:T=>h(n.id,{answerHeight:T})}),f.jsx(ue,{size:"small",onClick:()=>{if(n.kind==="choice")return;const T=BS(n.kind);T.items[0].area.rows=Math.ceil(n.answerHeight/T.items[0].area.rowHeight),h(n.id,{exercise:T})},children:"启用题型配置"})]})]},n.id)})}function iN(n){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...Jh(n,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function lN({initial:n,dictionary:r,replacing:l,onCreate:a,onClose:c}){const[s,u]=x.useState(n),h={...s,...Jh(r,s)},g=r.gradeCourseMap[h.gradeCode]||[],[m,b]=x.useState(""),v=x.useId(),w=x.useRef(null),{dialog:C,setDialog:y,titleProps:S}=Id();x.useLayoutEffect(()=>{C?.setAttribute("aria-labelledby",`${v}-title`)},[C,v]);const E=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${v}-title`,children:"新建答题卡"})});return f.jsx(Cs,{open:!0,panelRef:y,width:460,className:"card-modal card-create-modal",title:E,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(Oo,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:R=>{R.preventDefault(),w.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:c,children:"取消"}),f.jsx(ue,{type:"primary",htmlType:"submit",form:v,disabled:!h.gradeCode||!h.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:v,onSubmit:R=>{if(R.preventDefault(),!h.name.trim()){b("请输入题卡名称"),w.current?.focus();return}if(!h.gradeCode||!h.courseCode){b("没有可用的年级和课程");return}a({...h,name:h.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(R=>f.jsx(ue,{type:h.mode===R?"primary":"default","aria-pressed":h.mode===R,onClick:()=>u(N=>({...N,mode:R})),children:R==="template"?"答题卡模板":"考试答题卡"},R))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(Oi,{ref:w,"aria-label":"题卡名称",status:m?"error":void 0,"aria-invalid":!!m,"aria-describedby":m?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:h.name,onChange:R=>{u(N=>({...N,name:R.target.value})),b("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Vt,{"aria-label":"年级",value:h.gradeCode,disabled:!r.grades.length,onChange:R=>u(N=>({...N,...ni(r,R,r.gradeCourseMap[R][0].value)})),children:r.grades.map(R=>f.jsx("option",{value:R.value,children:R.label},R.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Vt,{"aria-label":"科目",value:h.courseCode,disabled:!g.length,onChange:R=>u(N=>({...N,...ni(r,h.gradeCode,R)})),children:g.map(R=>f.jsx("option",{value:R.value,children:R.label},R.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),m&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:m}),l&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function sN(){const{card:n,setCard:r,setQuestionCard:l,readOnly:a,geometry:c}=Tt(),s=u=>r(h=>h.header?{...h,header:{...h.header,...u}}:h);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(oi).map((u,h)=>f.jsxs(ue,{type:"text","aria-label":oi[u].label,"aria-pressed":n.preset===u,disabled:a,onClick:()=>r(g=>({...g,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${oi[u].columns}`,children:Array.from({length:oi[u].columns},(g,m)=>f.jsx("i",{},m))}),f.jsx("span",{children:["一栏","两栏","三栏"][h]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.scanMarking,onChange:u=>r(h=>({...h,scanMarking:u.target.value,blocks:h.blocks.map(g=>g.reference?.optional&&!u.target.value?{...g,reference:{...g.reference,choose:1}}:g)})),children:[f.jsx(ht.Button,{value:!1,children:"手阅"}),f.jsx(ht.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.halfPoint,onChange:u=>r(h=>({...h,halfPoint:u.target.value,blocks:h.blocks.map(g=>g.reference?{...g,reference:{...g.reference,questions:g.reference.questions.map(m=>({...m,halfPoint:u.target.value}))}}:g)})),children:[f.jsx(ht.Button,{value:!0,children:"显示"}),f.jsx(ht.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:n.questionCard!==!1,onChange:u=>l(u.target.value),children:[f.jsx(ht.Button,{value:!0,children:"是"}),f.jsx(ht.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:n.choiceDirection||"row",onChange:u=>r(h=>({...h,choiceDirection:u.target.value})),children:[f.jsx(ht.Button,{value:"row",children:"横排"}),f.jsx(ht.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.mergeObjective,onChange:u=>r(h=>({...h,mergeObjective:u.target.value})),children:[f.jsx(ht.Button,{value:!1,children:"不合并"}),f.jsx(ht.Button,{value:!0,children:"合并"})]})]}),n.header&&f.jsxs(x.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,h])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:h}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:n.header[u],onChange:g=>s({[u]:g.target.value}),children:[f.jsx(ht.Button,{value:!0,children:"显示"}),f.jsx(ht.Button,{value:!1,children:"不显示"})]})]},u)),f.jsxs("fieldset",{className:"card-setting-row card-exam-number-setting",disabled:a,children:[f.jsx("legend",{children:"考号版式"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:n.header.kaohao,onChange:u=>s({kaohao:u.target.value}),children:[f.jsx(ht.Button,{value:"code",children:"条形码"}),f.jsx(ht.Button,{value:"school",children:"校内准考证号"})]})]}),n.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Vt,{"aria-label":"准考证号位数",size:"small",disabled:a,value:n.header.weishu,onChange:u=>s({weishu:Number(u)}),children:Array.from({length:9},(u,h)=>f.jsxs("option",{value:h+4,children:[h+4,"位"]},h))})]})]})]})]})}function cN(){const{card:n,creationDictionary:r,saveMessage:l,saveAction:a,setCard:c,creationOpen:s,setCreationOpen:u,newCard:h,selectedId:g,setSelectedId:m,settingsId:b,setSettingsId:v,settingsAutoFocus:w,openSettings:C,readOnly:y,setReadOnly:S,titleOverflow:E,deleted:R,setDeleted:N,overflow:T,placementById:O,fitPage:D,moveBlock:M,selectBlock:z,download:H}=Tt(),G=n.blocks.find(I=>I.id===b),[X,U]=x.useState(!1),[F,J]=x.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ue,{type:"text","aria-pressed":!y,onClick:()=>S(!1),children:"编辑"}),f.jsx(ue,{type:"text","aria-pressed":y,onClick:()=>S(!0),children:"预览"})]}),f.jsxs(ue,{type:"text",onClick:H,className:"card-export",children:[f.jsx(Oo,{name:"upload",size:15}),a]})]}),l&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:l}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ue,{type:"text",onClick:D,children:"适合宽度"})}),T.length>0&&f.jsxs("div",{className:"card-overflow-notice",role:"alert",children:[T.length," 个题块超出单栏,内容可滚动查看。请调整版式、正文或作答高度。"]}),E&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:n.title||"未新建答题卡"}),n.creation&&f.jsxs("p",{className:"card-section-note",children:[n.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",n.creation.grade," · ",n.creation.subject]}),f.jsx(ue,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(sN,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[n.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!n.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:n.blocks.map((I,Y)=>{const k=O.get(I.id);return f.jsxs("li",{className:g===I.id?"active":"",draggable:!y,onDragStart:$=>{J(I.id),$.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",I.id)},onDragEnd:()=>J(null),onDragOver:$=>{!y&&F&&$.preventDefault()},onDrop:$=>{$.preventDefault(),F&&!y&&M(F,Y),J(null)},children:[f.jsxs(ue,{type:"text",className:"card-outline-item","aria-haspopup":y?void 0:"dialog",onClick:()=>{y?z(I.id,!0):C(I.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(Y+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:I.title||im[I.kind]}),f.jsxs("small",{children:["第 ",k.page+1," 页 · 第 ",k.column+1," 栏",k.overflowing?" · 超出":""]})]})]}),!y&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ue,{type:"text","aria-label":`上移题块 ${Y+1}`,title:"上移",disabled:Y===0,onClick:()=>M(I.id,Y-1),children:"↑"}),f.jsx(ue,{type:"text","aria-label":`下移题块 ${Y+1}`,title:"下移",disabled:Y===n.blocks.length-1,onClick:()=>M(I.id,Y+1),children:"↓"})]})]},I.id)})}),!y&&f.jsx("div",{className:"card-add",children:f.jsx(ue,{type:"text","aria-haspopup":"dialog",onClick:()=>U(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),s&&f.jsx(lN,{initial:iN(r),dictionary:r,replacing:!!(n.paperTitle||n.blocks.length),onCreate:h,onClose:()=>u(!1)}),G&&!y&&f.jsx(aN,{block:G,autoFocus:w,onClose:()=>v(null)}),X&&!y&&!s&&f.jsx(KR,{creation:n.creation,onClose:()=>U(!1),onAdd:I=>{const Y=fm(I);c(k=>({...k,blocks:[...k.blocks,Y]})),U(!1),C(Y.id)}}),R&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ue,{type:"text",onClick:()=>{c(I=>{const Y=[...I.blocks];return Y.splice(R.index,0,R.block),{...I,blocks:Y}}),m(R.block.id),N(null)},children:"撤销"}),f.jsx(ue,{type:"text","aria-label":"关闭删除提示",onClick:()=>N(null),children:f.jsx(Oo,{name:"close",size:14})})]})]})}function Rv({settings:n,activeQuestionId:r}){if(!n.questions.length)return null;const l=Fc(n),a=s=>f.jsxs("div",{className:`card-choice-row${s.id===r?" is-current-choice":""}`,"data-question-id":s.id,"aria-current":s.id===r?"true":void 0,children:[f.jsxs("b",{children:[s.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":n.marker,children:s.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-option-id":u.id,"data-marker":n.marker,children:n.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},s.id),c=[[]];for(const s of n.questions)s.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(s);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:n.rowGap,columnGap:n.columnGap},"data-direction":l,children:l==="column"?LS(n).map((s,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:n.columnGap,rowGap:n.rowGap},children:s.map(h=>f.jsx("div",{className:"card-choice-column",style:{gap:n.rowGap,minHeight:n.rowsPerColumn*20+(n.rowsPerColumn-1)*n.rowGap},children:h.map(a)},h[0].id))},u)):c.map((s,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:n.rowGap,columnGap:n.columnGap},children:s.map(a)},u))})}function Nv(n){const r=n.getBoundingClientRect(),l=getComputedStyle(n),a=u=>Math.round(u*64)/64,c=a(parseFloat(l.width)+(l.boxSizing==="border-box"?0:parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)+parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))),s=c>0&&r.width>0?r.width/c:1;return u=>{const h=u.getBoundingClientRect();let g=0;for(let m=u;m&&m!==n;m=m.parentElement)g+=parseFloat(m.style.translate.split(/\s+/)[1])||0;return{top:a((h.top-r.top)/s-g),height:a(h.height/s),width:a(h.width/s)}}}function Av(n){return Nv(n.closest(".card-question")||n)(n)}function uN(n){return Av(n).top}function Os({id:n,label:r,value:l,visible:a,readOnly:c,placement:s,onUnits:u,onChange:h,onActiveFragment:g,uploadImage:m,choiceFillPosition:b,choiceFillBindings:v,activeChoiceQuestionId:w,contentTargets:C,editorKeys:y,onContentSelect:S}){const{geometry:E,registerEditor:R}=Tt(),N=JSON.stringify(y||[]),T=x.useCallback(J=>{JSON.parse(N).forEach(I=>R(`content/${I}`,J))},[N,R]),O=x.useRef(null),D=x.useRef(!1);a&&(D.current=!0);const M=x.useRef([]),[z,H]=x.useState(0),G=x.useRef({id:n,visible:a,onUnits:u});G.current={id:n,visible:a,onUnits:u};const X=x.useCallback(()=>{const J=O.current?.querySelector(".rt-content"),I=J?uN(J):0;H(Y=>Math.abs(Y-I)<.5?Y:I),G.current.onUnits(G.current.id,G.current.visible?M.current.map(Y=>({top:Y.top+I,bottom:Y.bottom+I})):[])},[]),U=x.useCallback(J=>{M.current=J,X()},[X]);x.useLayoutEffect(()=>{X()},[X,a,s.fragments,l]),x.useLayoutEffect(()=>()=>G.current.onUnits(G.current.id,[]),[]);const F=x.useMemo(()=>s.fragments.map(J=>({from:J.from-z,to:J.to-z,x:J.x-s.x,y:J.y-s.y-J.from+(J.topPadding||0)})),[s.fragments,s.x,s.y,z]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:D.current&&f.jsx(Ai,{value:l,readOnly:c||!a,uploadImage:m,ariaLabel:r,onChange:h,onEditor:T,contentTargets:C,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:F,maxUnitHeight:E.contentHeight-80,onMeasure:U,onActiveSliceChange:g},choiceFillPosition:b,choiceFillBindings:v,activeChoiceQuestionId:w})})}function dN({rows:n,rowHeight:r,label:l,onChange:a}){const{scale:c}=Tt(),s=x.useRef(null),u=()=>{s.current&&a(s.current.rows),s.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${l} 题作答高度`,title:"拖动调整作答高度",onPointerDown:h=>{h.preventDefault(),h.stopPropagation(),h.currentTarget.focus(),s.current={y:h.clientY,rows:n},h.currentTarget.setPointerCapture(h.pointerId)},onPointerMove:h=>{s.current&&a(Math.max(1,Math.min(120,s.current.rows+Math.round((h.clientY-s.current.y)/c/r))))},onPointerUp:h=>{s.current=null,h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{s.current=null},onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(h.key)&&(h.preventDefault(),a(Math.max(1,Math.min(120,n+(h.key==="ArrowDown"?1:-1)))))}})}function Mv({blank:n,item:r,active:l,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${n.width}%`},className:`exercise-flow-unit exercise-blank${l?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":n.id,children:[f.jsxs("span",{children:[a?`${r.label}.${n.label}`:`(${n.label})`," ",n.prefix]}),f.jsx("span",{className:`exercise-blank-space ${n.style}`,children:n.style==="characters"&&Array.from({length:n.characters},(c,s)=>f.jsx("i",{},s))}),f.jsx("span",{children:n.suffix})]})}function fN({area:n,item:r,active:l,readOnly:a,onResize:c,prefix:s=""}){const u={"--area-columns":n.columns,"--area-line":`${n.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":n.style,style:u,children:[n.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${l?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:n.rows},(h,g)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${l?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":g,style:{height:n.rowHeight,...n.backgroundUrl?{backgroundImage:`url(${JSON.stringify(n.backgroundUrl)})`,backgroundSize:`100% ${n.rows*n.rowHeight}px`,backgroundPosition:`0 -${g*n.rowHeight}px`}:{}},children:[s&&g===0&&f.jsx("span",{className:"exercise-area-prefix",children:s}),n.style==="characters"&&Array.from({length:n.columns},(m,b)=>{const v=g*n.columns+b+1;return f.jsx("span",{className:"exercise-character",children:n.wordMark>0&&v%n.wordMark===0&&f.jsxs("small",{children:[v,"字"]})},b)}),n.style==="coordinates"&&g===Math.floor(n.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),n.style==="coordinates"&&g===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},g)),!a&&n.rows>0&&f.jsx(dN,{rows:n.rows,rowHeight:n.rowHeight,label:r.label,onChange:c})]})}function hN({value:n,kind:r,placement:l,showQuestion:a,readOnly:c,activeId:s,onUnits:u,onChange:h,onActiveFragment:g,uploadImage:m}){const b=(S,E="")=>`exercise-flow-unit ${E}${S===s?" is-current":""}`,v=n.pool,w=x.useMemo(()=>new Map(n.items.filter(S=>S.kind==="choice").map(S=>[S.id,Ko({...Kc(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[n.items,a]),C=(S=!1)=>v.map(E=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":E.id,children:[S?"● ":"",E.label,". ",a?E.text:""]}),E.document&&f.jsx(Os,{id:`pool/${E.id}`,label:`共享选项 ${E.label} 正文`,value:E.document,visible:a,readOnly:c,placement:l,uploadImage:m,onUnits:u,onActiveFragment:g,onChange:R=>h({...n,pool:n.pool.map(N=>N.id===E.id?{...N,document:R}:N)})})]},E.id)),y=["fill","completion"].includes(r)&&(!a||n.items.every(S=>pn(S.document)));if(r==="chunk"){let S=0;const E=n.chunkPoints.map(R=>{const N=n.chunkText.slice(S,R.offset);return S=R.offset,{text:N,...R}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Os,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:E.map(R=>`${R.text}〔${R.label}〕`).join("")+n.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:l,onUnits:u,onChange:()=>{},onActiveFragment:g}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[n.chunkPoints.map(R=>f.jsx("span",{className:"exercise-mark","data-answer-id":R.id,children:R.label},R.id)),f.jsxs("span",{children:["(最多选 ",n.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[y&&f.jsx("div",{className:"exercise-blanks",children:n.items.map(S=>f.jsxs(x.Fragment,{children:[S.blanks.map(E=>f.jsxs(x.Fragment,{children:[f.jsx(Mv,{blank:E,item:S,active:S.id===s,fullLabel:!0}),E.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},E.id)),n.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",n.items.length," 题中选做 ",n.chooseCount," 题",n.groupScore!==null?`,共 ${n.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",n.items.map(S=>f.jsx("span",{className:"exercise-mark","data-exercise-id":S.id,children:S.label},S.id))]})]}),["matching","ordering"].includes(r)&&a&&(r!=="matching"||n.matchingDisplay==="letters")&&C(),f.jsxs("div",{hidden:y,className:r==="matching"&&n.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:n.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",v.map((S,E)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),E<v.length-1?"→":""]},S.id))]}):n.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):n.items.map(S=>{const E=S.id===s,R=w.get(S.id),N=!y&&(S.kind==="table"||a&&(!pn(S.document)||!c&&(nm.includes(r)||n.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:b(S.id,"exercise-item-heading"),"data-exercise-id":S.id,children:[f.jsxs("b",{children:[S.label,"."]}),S.score!==null&&f.jsxs("span",{children:["(",S.score," 分)"]}),r==="matching"&&n.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Os,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:N,readOnly:c,placement:l,uploadImage:m,onUnits:u,onActiveFragment:g,onChange:T=>h({...n,items:n.items.map(O=>O.id===S.id?{...O,document:T}:O)}),choiceFillPosition:R?.position,choiceFillBindings:R?.bindings,activeChoiceQuestionId:E?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!R?.concentrated.questions.length)&&f.jsx("div",{className:b(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((T,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||n.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":T.id,children:S.kind==="judge"?rm[n.judgeLabels][O]:T.label},T.id))}),r==="matching"&&n.matchingDisplay==="letters"&&f.jsx("div",{className:b(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!y&&f.jsx("div",{className:"exercise-blanks","data-new-line":n.fillNewLine,children:S.blanks.map(T=>f.jsxs(x.Fragment,{children:[f.jsx(Mv,{blank:T,item:S,active:E}),T.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},T.id))}),S.steps.map(T=>f.jsxs("div",{className:b(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":T.id,children:[f.jsxs("span",{children:["(",T.label,") ",T.prompt,T.score!==null?`(${T.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},T.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(fN,{area:S.area,item:S,active:E,readOnly:c,onResize:T=>h({...n,items:n.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:T}}:O)})})]},S.id)})}),r==="matching"&&n.matchingDisplay==="lines"&&f.jsx("div",{children:C(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function mN({height:n,min:r,label:l,onChange:a}){const{scale:c}=Tt(),s=x.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":l,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),s.current={y:u.clientY,height:n},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{s.current&&a(Math.max(r,Math.round(s.current.height+(u.clientY-s.current.y)/c)))},onPointerUp:u=>{s.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{s.current=null},onPointerCancel:()=>{s.current&&a(s.current.height),s.current=null},onKeyDown:u=>{u.key==="Escape"&&s.current&&(a(s.current.height),s.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,n+(u.key==="ArrowDown"?10:-10))))}})}function zd({placement:n,children:r,className:l=""}){const a=x.useRef(null),[c,s]=x.useState({top:0,height:0});return x.useLayoutEffect(()=>{const u=()=>{const{top:g,height:m}=Av(a.current);s(b=>b.top===g&&b.height===m?b:{top:g,height:m})};u();const h=new ResizeObserver(u);return h.observe(a.current),()=>h.disconnect()},[n.fragments,r]),f.jsxs("div",{ref:a,className:`reference-paper-frame ${l}`,children:[r,n.fragments.map((u,h)=>{const g=Math.max(c.top,u.from),m=Math.min(c.top+c.height,u.to);return m>g&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border",style:{left:u.x-n.x,top:g-c.top+u.y-n.y-u.from+(g>u.from&&u.topPadding||0),height:m-g+(g===u.from&&u.topPadding||0)+(m===u.to&&u.bottomPadding||0)}},h)})]})}function pN({score:n,halfPoint:r,active:l,id:a}){const{card:c}=Tt();return!c.scanMarking&&n!==null&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${l?" is-current":""}`,"data-exercise-id":a,children:aC(n,r).map((s,u)=>f.jsx("span",{children:s},u))})}function Ld({question:n,part:r,props:l,optional:a=!1}){const{card:c,geometry:s,scale:u,selectChoice:h}=Tt(),{value:g,placement:m,width:b,readOnly:v,activeId:w,uploadImage:C,onUnits:y,onActiveFragment:S,onChange:E}=l,R=r?.id||n.id,N=r?.label||n.label,T=r?.score??n.score,O=w===R||w===n.id,D=x.useRef(null),[M,z]=x.useState(0),[H,G]=x.useState(()=>window.devicePixelRatio||1);x.useEffect(()=>{if(n.type!=="CCOMPOSITION")return;const K=()=>G(window.devicePixelRatio||1);return window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[n.type]);const X=r?.document||n.document,U=K=>E({...g,questions:g.questions.map(ee=>ee.id===n.id?{...ee,...K}:ee)}),F=K=>U(r?{parts:n.parts.map(ee=>ee.id===r.id?{...ee,document:K}:ee)}:{document:K}),J=a?g.optionalHeight:r?.height||n.height;x.useLayoutEffect(()=>{const K=D.current.querySelector(".reference-answer-body"),ee=()=>z(K.offsetHeight);ee();const le=new ResizeObserver(ee);return le.observe(K),()=>le.disconnect()},[]);const I=(K="")=>`exercise-flow-unit ${K}${O?" is-current":""}`,Y=Math.max(0,J-M-(!c.scanMarking&&T!==null?18:0)),k=nC(b),$=k*31+1,L=Math.max(1,Math.round(H))/(H*u),Z=`M.5 .5H${$-.5}V32.5H.5Z`+Array.from({length:k-1},(K,ee)=>`M${(ee+1)*31+.5} .5V32.5`).join(""),A=n.type==="CCOMPOSITION"?Math.ceil(n.characters/k):Math.ceil(Y/40),V=K=>a?E({...g,optionalHeight:K}):U(r?{parts:n.parts.map(ee=>ee.id===r.id?{...ee,height:K}:ee)}:{height:K});return f.jsx("div",{ref:D,className:"reference-answer","data-exercise-item":R,children:f.jsxs(zd,{placement:m,className:n.type==="CCOMPOSITION"?"reference-composition":"",children:[f.jsx(pN,{score:T,halfPoint:n.halfPoint,active:O,id:R}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:I("reference-optional-head"),style:{minHeight:s.columns===3?104:82},"data-exercise-id":R,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"}),"  请考生从给出的第",g.questions.map(K=>K.label).join("、"),kd(g.questions.length),"题中任选",kd(g.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",g.choose===1?"第一题":`前${kd(g.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",g.questions.map(K=>f.jsx("span",{"data-exercise-id":K.id,children:K.label},K.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:n.type==="CCOMPOSITION"?n.contentHeight:void 0},children:(a?g.questions:[n]).map(K=>{const ee=a?K.parts[0]?.id||K.id:R,le=a?K.label:N,ce=a||!r||K.parts[0]?.id===r.id,ie=g.textVersion===1&&g.type!=="MIXED"&&ce,ge=ie&&l.showQuestion&&K.text,je=a?K.parts[0]?.document||K.document:X,be=ge?_r([..._l(K.text,K.id,K.label),...K.type==="ECOMPOSITION"?(je.content.content||[]).slice(1):[]]):je;return f.jsx("div",{"data-exercise-id":ee,className:"reference-answer-entry",children:f.jsx(Os,{id:`reference/${ee}`,label:`第 ${le} 题作答内容`,value:be,editorKeys:ie?[K.id,ee]:[ee],contentTargets:ge?[{id:K.id,label:`第 ${K.label} 题题干`,kind:"question"}]:void 0,onContentSelect:de=>h(l.blockId,de),visible:!0,readOnly:v,placement:m,uploadImage:C,onUnits:y,onActiveFragment:S,onChange:ge?de=>E({...g,questions:g.questions.map(Se=>Se.id===K.id?{...Se,text:um(Se.text,(de.content.content||[]).filter(_e=>Se.type!=="ECOMPOSITION"||_e.attrs?.contentId===Se.id)),...Se.type==="ECOMPOSITION"?{document:_r([Se.document.content.content[0],...(de.content.content||[]).filter(_e=>_e.attrs?.contentId!==Se.id)])}:{}}:Se)}):a?de=>E({...g,questions:g.questions.map(Se=>Se.id===K.id?{...Se,document:de,parts:Se.parts.map((_e,Ce)=>Ce===0?{..._e,document:de}:_e)}:Se)}):F})},ee)})})]}),Array.from({length:A},(K,ee)=>f.jsx("div",{className:I(`reference-answer-row ${n.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":R,style:{height:n.type==="CCOMPOSITION"?39.5:Math.min(40,Y-ee*40)},children:n.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:$,height:"33",viewBox:`0 0 ${$} 33`,children:f.jsx("path",{d:Z,fill:"none",stroke:"#000",strokeWidth:L,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:k},(le,ce)=>{const ie=ee*k+ce+1;return f.jsx("span",{className:"reference-character","data-character":ie<=n.characters?ie:void 0,"data-padding":ie>n.characters||void 0,children:ie<=n.characters&&ie%100===0&&f.jsxs("small",{children:[ie,"字"]})},ce)})]})},ee)),!v&&n.type!=="CCOMPOSITION"&&f.jsx(mN,{height:J,min:30,label:`调整第 ${N} 题作答高度`,onChange:V})]})})}function kd(n){const r="零一二三四五六七八九";return n<10?r[n]:n<100?`${n<20?"":r[Math.floor(n/10)]}十${n%10?r[n%10]:""}`:n===100?"一百":String(n)}function gN(n){const{value:r,placement:l,activeId:a,concentrated:c}=n,{card:s}=Tt(),u=new Set(c.questions.map(g=>g.id)),h=x.useMemo(()=>{const g=[];return r.questions.forEach(m=>{const b=Ct(m.type)?"choice":si(m.type)?"fill":"answer",v=g.at(-1);b!=="answer"&&v?.category===b?v.questions.push(m):g.push({category:b,questions:[m]})}),g},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(Ld,{question:r.questions[0],props:n,optional:!0})}):f.jsx("div",{className:"reference-content",children:h.map((g,m)=>f.jsxs(x.Fragment,{children:[g.category==="choice"&&Jo({...r,questions:g.questions}).some(b=>u.has(b.id))&&f.jsx(zd,{placement:l,className:"reference-choice-frame",children:f.jsx(Rv,{activeQuestionId:g.questions.find(b=>b.id===a&&ke(b.type))?.parts[0]?.id||a,settings:{...c,questions:Jo({...r,questions:g.questions}).filter(b=>u.has(b.id))}})}),g.category==="fill"&&f.jsx(zd,{placement:l,className:"reference-fill-frame",children:f.jsx("div",{className:"reference-fill-grid",children:g.questions.map(b=>f.jsxs(x.Fragment,{children:[b.parts.map(v=>f.jsxs(x.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${s.scanMarking?" is-online":""}${a===b.id||a===v.id?" is-current":""}`,style:{width:`${v.width}%`},"data-exercise-id":v.id,"data-answer-id":v.id,children:[f.jsxs("span",{className:"reference-blank-number",children:[v.label,"."]}),f.jsx("span",{className:"reference-blank-line"}),!s.scanMarking&&f.jsx("span",{className:"reference-blank-score"})]}),v.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&ke(b.type)&&f.jsx("span",{className:"exercise-line-break"})]},v.id)),r.fillNewLine&&!ke(b.type)&&f.jsx("span",{className:"exercise-line-break"})]},b.id))})}),g.category==="answer"&&g.questions.map(b=>b.type==="SHORTANSWER"?b.parts.map(v=>f.jsx(Ld,{question:b,part:v,props:n},v.id)):f.jsx(Ld,{question:b,props:n},b.id)),m<h.length-1&&f.jsx("div",{className:"reference-section-gap"})]},g.questions[0].id))})}function yN({hidden:n=!1,block:r,index:l,placement:a,width:c,scale:s,selected:u,readOnly:h,showQuestion:g,activeChoiceId:m,uploadImage:b,registerEditor:v,onSelect:w,onActiveFragment:C,onSettings:y,onMeasure:S,onDocument:E,onHeight:R,onExercise:N,onReference:T}){const{card:O,geometry:D,selectChoice:M}=Tt(),z=x.useMemo(()=>r.reference?Sv(r):void 0,[r.id,r.reference]),H=x.useMemo(()=>r.reference?Ko({...r.reference.layout,questions:Jo(r.reference)},r.document,g):r.kind==="choice"&&r.choices?Ko(r.choices,r.document,g):void 0,[r.reference,r.kind,r.choices,r.document,g]),X=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!n&&r.id!==fr&&g&&(!h||!(r.exercise||r.reference)||!pn(r.document)||!!H?.bindings.length),U=x.useRef(null),F=x.useCallback(pe=>{U.current=pe,v(r.id,pe)},[r.id,v]),J=x.useMemo(()=>r.reference?BR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);x.useEffect(()=>{U.current?.syncDocument(J)},[J]);const I=x.useRef(null),Y=x.useRef(S);Y.current=S;const k=x.useRef([]),$=x.useRef(new Map),[L,Z]=x.useState(0),[A,V]=x.useState(0),K=x.useRef(()=>{}),ee=pe=>{const ct=a.fragments.find(ut=>pe>=ut.from-.5&&pe<ut.to-.5);return ct?{x:ct.x-a.x,y:ct.y-a.y-ct.from+(ct.topPadding||0)}:{x:0,y:0}};K.current=()=>{const pe=I.current,ct=pe?.querySelector(".card-question-document .rt-content");if(n||!pe||!ct)return;const ut=Nv(pe.parentElement),an=X?ut(ct).top:0;Z(ve=>Math.abs(ve-an)<.5?ve:an);const hr=X?k.current.map(ve=>({top:an+ve.top,bottom:an+ve.bottom})):[];$.current.forEach(ve=>hr.push(...ve)),pe.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(ve=>{if(ve.offsetParent===null)return;const{top:Ke,height:Ne}=ut(ve);hr.push({top:Ke,bottom:Ke+Ne});const Fe=ee(Ke);ve.style.translate=`${Fe.x}px ${Fe.y}px`}),pe.querySelectorAll("[data-exercise-resize]").forEach(ve=>{const Ke=ee(ut(ve).top);ve.style.translate=`${Ke.x}px ${Ke.y}px`});const pa=pe.querySelector(".card-answer-space:not(.card-answer-fragment)");if(pa){const{top:ve,height:Ke}=ut(pa);V(Fe=>Math.abs(Fe-ve)<.5?Fe:ve);const Ne=r.kind==="fill"?40:28;for(let Fe=ve;Fe<ve+Ke;Fe+=Ne)hr.push({top:Fe,bottom:Math.min(Fe+Ne,ve+Ke)})}const ga=ut(pe),Pr=pe.querySelectorAll(".reference-character-row"),mr=Pr.length?ut(Pr[0]).top:void 0,se=Pr.length?ut(Pr[Pr.length-1]).top:void 0,Re=Math.min(...hr.map(ve=>ve.bottom)),ye=[...new Set(hr.flatMap(ve=>[ve.top,ve.bottom]))].filter(ve=>ve>=Re&&ve<ga.height&&!hr.some(Ke=>ve>Ke.top+.5&&ve<Ke.bottom-.5)).filter(ve=>se===void 0||ve<=se).sort((ve,Ke)=>ve-Ke);Y.current({width:ga.width,height:ga.height,breaks:ye,...mr!==void 0?{compositionStart:mr}:{}})};const le=x.useCallback(pe=>{k.current=pe,K.current()},[]),ce=x.useCallback((pe,ct)=>{$.current.set(pe,ct),K.current()},[]),ie=x.useMemo(()=>a.fragments.map(pe=>({from:pe.from-L,to:pe.to-L,x:pe.x-a.x,y:pe.y-a.y-pe.from+(pe.topPadding||0)})),[a.fragments,a.x,a.y,L]);x.useLayoutEffect(()=>{K.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,g,X,n]);const ge=x.useRef(null),je=pe=>{pe.preventDefault(),pe.stopPropagation(),pe.currentTarget.focus(),ge.current={y:pe.clientY,height:r.answerHeight},pe.currentTarget.setPointerCapture(pe.pointerId)},be=pe=>{ge.current&&R(Math.max(0,Math.min(800,Math.round(ge.current.height+(pe.clientY-ge.current.y)/s))))},de=pe=>{ge.current=null,pe.currentTarget.releasePointerCapture(pe.pointerId)},Se=()=>{ge.current&&R(ge.current.height),ge.current=null},_e=pe=>{pe.key==="Escape"&&ge.current&&Se(),(pe.key==="ArrowUp"||pe.key==="ArrowDown")&&(pe.preventDefault(),R(Math.max(0,Math.min(800,r.answerHeight+(pe.key==="ArrowDown"?10:-10)))))};x.useEffect(()=>{const pe=I.current;let ct=0;const ut=new ResizeObserver(()=>{cancelAnimationFrame(ct),ct=requestAnimationFrame(()=>K.current())});return ut.observe(pe),()=>{ut.disconnect(),cancelAnimationFrame(ct)}},[]);const Ce=ee(A+r.answerHeight-1),Ae=`${Ce.x}px ${Ce.y}px`,$e=a.fragments.length>1,Dn=r.reference&&H&&f.jsx(gN,{blockId:r.id,showQuestion:g,value:r.reference,concentrated:O.mergeObjective&&r.id!==fr?{...H.concentrated,questions:[]}:H.concentrated,placement:a,width:c,readOnly:h,activeId:m,onUnits:ce,onChange:T,onActiveFragment:C,uploadImage:b}),jt=r.reference&&(Ct(r.reference.type)||r.id===fr);return f.jsx("article",{hidden:n,className:`card-question${u&&!h?" is-selected":""}${a.overflowing?" is-overflowing":""}${$e?" is-fragmented":""}${r.reference?.type==="CCOMPOSITION"?" is-composition":""}`,"data-block-id":r.id,"data-page":a.page+1,"data-column":a.column+1,style:{left:a.x,top:a.y,width:c,minHeight:!$e&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{h||w()},onFocusCapture:()=>{h||w()},"aria-label":r.title||`题块 ${l+1}`,children:f.jsxs("div",{className:"card-question-content",ref:I,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:h?r.title||`题块 ${l+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${l+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:y,children:r.title||`题块 ${l+1}`})}),f.jsx("span",{children:String(l+1).padStart(2,"0")})]}),H&&!r.reference&&f.jsx(Rv,{settings:H.concentrated,activeQuestionId:m}),jt&&Dn,f.jsx("div",{className:"card-question-document",hidden:!X,children:f.jsx(Dd,{ref:F,initialValue:r.document,readOnly:h||!X,uploadImage:b,ariaLabel:`题块 ${l+1} 正文`,onChange:E,pagination:{slices:ie,maxUnitHeight:D.contentHeight-80,onMeasure:le,onActiveSliceChange:C},choiceFillPosition:H?.position,choiceFillBindings:H?.bindings,activeChoiceQuestionId:m,contentTargets:z,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:pe=>{pe!==r.id&&M(r.id,pe)}})}),!jt&&Dn,!r.reference&&r.exercise&&r.kind!=="choice"&&f.jsx(hN,{value:r.exercise,kind:r.kind,placement:a,showQuestion:g,readOnly:h,activeId:m,onUnits:ce,onChange:N,onActiveFragment:C,uploadImage:b}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${$e?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!h&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:Ae},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${l+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:Ae},onPointerDown:je,onPointerMove:be,onPointerUp:de,onPointerCancel:Se,onLostPointerCapture:()=>{ge.current=null},onKeyDown:_e,children:f.jsx("span",{})})]})}),$e&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((pe,ct)=>{const ut=Math.max(pe.from,A),an=Math.min(pe.to,A+r.answerHeight);return an>ut&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:pe.x-a.x,top:ut+pe.y-a.y-pe.from,width:c,height:an-ut,backgroundPositionY:`${A-ut-1}px`}},ct)})]})})}function _v({seat:n=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...n?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function Dv(){return f.jsxs("div",{className:"card-barcode-area",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Rs(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{children:["缺考标记:",f.jsx("i",{})]})]})}function Iv({marks:n,focusText:r}){return f.jsxs("div",{className:"card-attentions",children:[r&&f.jsxs("div",{className:"card-attention-box",children:[f.jsx("div",{children:"注意事项"}),f.jsxs("section",{children:[f.jsx("p",{children:"1.答题前请将姓名、班级和准考证号(或学号)填写清楚并填涂完整。"}),f.jsx("p",{children:"2.客观题答题必须使用2B铅笔填涂,修改时用橡皮擦干净。主观题答题必须使用黑色签字笔书写。"}),f.jsx("p",{children:"3.请在规定区域内答题,超出答题区域书写无效。"})]})]}),n&&f.jsx(Rs,{})]})}function vN({settings:n,columns:r}){const l=n.kaohao==="school"&&n.weishu>9,a=!n.mifeng&&r===3||l,c=r!==3&&n.focusText&&n.missExam&&!n.mifeng&&n.kaohao==="code",s=r===3&&n.missExam&&!n.mifeng&&n.kaohao==="code",u=r===3&&n.missExam&&!n.mifeng&&n.kaohao==="school"&&[8,9].includes(n.weishu),h=r===3&&n.focusText&&n.missExam&&n.mifeng&&n.kaohao==="school"&&[8,9].includes(n.weishu),g=r!==3&&n.missExam&&!n.mifeng&&l,m=n.missExam&&!c&&!s&&!u&&!h&&!g,b=n.focusText||m;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${n.mifeng&&(n.kaohao==="code"||l)?" full-width":""}`,children:[!n.mifeng&&f.jsx(_v,{seat:n.writeKaohao}),(u||g)&&f.jsx(Rs,{}),!a&&b&&f.jsx(Iv,{focusText:n.focusText,marks:m})]}),f.jsxs("div",{className:"card-header-number",children:[n.kaohao==="school"&&f.jsxs("div",{className:"card-exam-number","aria-label":`${n.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:n.weishu},(v,w)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(C,y)=>f.jsxs("div",{className:"card-exam-number-digit",children:["[",f.jsx("span",{children:y}),"]"]},y))]},w))})]}),n.kaohao==="code"&&!n.mifeng&&f.jsx(Dv,{}),(c||s)&&f.jsx(Rs,{})]}),h&&f.jsx(Rs,{}),a&&b&&f.jsx(Iv,{focusText:n.focusText,marks:m})]})}function bN({settings:n,back:r}){return f.jsxs("div",{className:`card-seal-line${r?" back":""}`,children:[f.jsx("span",{className:"card-seal-label",children:"密封线"}),!r&&f.jsxs("div",{className:`card-seal-details${n.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(_v,{seat:n.writeKaohao}),n.kaohao==="code"&&f.jsx(Dv,{})]})]})}function xN({title:n,page:r=0}){const{card:l,setCard:a,readOnly:c,geometry:s,scale:u,setTitleMeasurement:h,uploadImage:g,registerEditor:m}=Tt(),b=x.useRef(null),v=x.useRef(null),w=x.useRef(null);x.useEffect(()=>{const E=`title/${n.id}/${r}`;return m(E,w.current),()=>m(E,null)},[n.id,r,m]);const C=x.useRef(null),y=x.useCallback(()=>{const E=b.current,R=v.current;if(!E||!R||r!==0)return;const N={id:n.id,width:E.offsetWidth,height:E.offsetHeight,overflowing:E.scrollHeight>E.clientHeight+1||R.scrollHeight>R.clientHeight+1};h(T=>T?.id===N.id&&T.width===N.width&&T.height===N.height&&T.overflowing===N.overflowing?T:N)},[n.id,r,h]);x.useLayoutEffect(()=>{const E=new ResizeObserver(y);return E.observe(b.current),E.observe(v.current),y(),()=>E.disconnect()},[y]),x.useEffect(()=>{w.current?.getDocument()&&JSON.stringify(w.current.getDocument())!==JSON.stringify(n.document)&&w.current.setDocument(n.document)},[n.document]);const S=E=>a(R=>R.paperTitle?.id===n.id?{...R,paperTitle:{...R.paperTitle,height:Math.max(24,Math.min(90,Math.round(E)))}}:R);return f.jsxs("div",{ref:b,className:"card-paper-header","data-header-page":r+1,style:{top:r*(s.height+mo)+s.margin,left:s.columnX(r,0),width:s.titleWidth,maxHeight:s.contentHeight,paddingBottom:l.header?10:ai},children:[f.jsxs("div",{className:"card-paper-title",style:{height:n.height},children:[f.jsx("div",{ref:v,className:"card-paper-title-body",children:f.jsx(Dd,{ref:w,initialValue:n.document,readOnly:c,uploadImage:g,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:y,onChange:E=>a(R=>R.paperTitle?.id===n.id&&JSON.stringify(R.paperTitle.document)!==JSON.stringify(E)?{...R,paperTitle:{...R.paperTitle,document:E}}:R)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:E=>{E.button===0&&(E.preventDefault(),E.stopPropagation(),C.current={y:E.clientY,height:n.height},E.currentTarget.setPointerCapture(E.pointerId))},onPointerMove:E=>{C.current&&S(C.current.height+(E.clientY-C.current.y)/u)},onPointerUp:E=>{C.current=null,E.currentTarget.hasPointerCapture(E.pointerId)&&E.currentTarget.releasePointerCapture(E.pointerId)},onPointerCancel:()=>{C.current&&S(C.current.height),C.current=null},onLostPointerCapture:()=>{C.current=null},onKeyDown:E=>{E.key==="Escape"&&C.current&&(S(C.current.height),C.current=null),(E.key==="ArrowUp"||E.key==="ArrowDown")&&(E.preventDefault(),S(n.height+(E.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),l.header&&f.jsx(vN,{settings:l.header,columns:s.columns})]})}function SN(){const{card:n,paperBlocks:r,selectedId:l,setSelectedId:a,selectedChoiceId:c,selectChoice:s,settingsId:u,openSettings:h,registerEditor:g,editingQuestionId:m,setMeasurements:b,readOnly:v,scale:w,geometry:C,pageCount:y,totalHeight:S,placementById:E,updateBlock:R,uploadImage:N}=Tt(),T=x.useRef(null),[O,D]=x.useState(null),M=(I,Y)=>D(k=>k?.id===I&&k.index===Y?k:{id:I,index:Y}),z=I=>{const Y=I instanceof Element?I.closest("[data-block-id], [data-block-fragment]"):null;return Y?.dataset.blockId||Y?.dataset.blockFragment},H=n.blocks.find(I=>I.id===u),G=H&&c(H),X=r.find(I=>I.id===fr),U=X?.reference&&G&&Il(X.reference).some(I=>I.id===G)?H:n.blocks.find(I=>I.reference?.questions.some(Y=>Ct(Y.type))),F=X?[X,...n.blocks.map(I=>r.find(Y=>Y.id===I.id)||I)]:r,J=I=>I===fr&&U?.id||I;return f.jsxs("div",{className:"card-sheet-stack",style:{width:C.width,height:S},onPointerDownCapture:I=>{const Y=z(I.target);T.current=!v&&I.button===0&&Y?{id:Y,x:I.clientX,y:I.clientY}:null},onPointerCancelCapture:()=>{T.current=null},onClickCapture:I=>{const Y=T.current;if(T.current=null,!v&&I.button===0&&Y&&z(I.target)===Y.id&&Math.hypot(I.clientX-Y.x,I.clientY-Y.y)<5){const k=I.target instanceof Element?I.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,$=k?.dataset.answerId||k?.dataset.questionId||k?.dataset.fillQuestionId||k?.dataset.exerciseId||k?.dataset.exerciseItem||k?.dataset.contentId,L=n.blocks.find(Z=>$&&Z.reference&&Il(Z.reference).some(A=>A.id===$))||n.blocks.find(Z=>Z.id===J(Y.id));$&&(L?.reference?Il(L.reference):L?.choices?.questions||L?.exercise?.items)?.some(Z=>Z.id===$)&&s(L.id,$),h(L?.id||J(Y.id),!1)}},children:[Array.from({length:y},(I,Y)=>f.jsxs("div",{className:"card-sheet","data-paper-page":Y+1,style:{top:Y*(C.height+mo),width:C.width,height:C.height},children:[n.header&&!v&&Array.from({length:C.columns},(k,$)=>f.jsx("div",{className:"card-column-guide",style:{left:C.columnX(Y,$),width:C.columnWidth,top:C.margin,bottom:C.margin}},$)),n.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:Y%2===0?C.margin:C.width-C.margin-C.sealWidth,width:C.sealWidth},children:f.jsx(bN,{settings:n.header,back:Y%2!==0})}),n.header&&Array.from({length:C.columns},(k,$)=>f.jsxs("div",{className:"card-paper-footer",style:{left:C.columnX(Y,$),width:C.columnWidth,bottom:20},children:["第",Y*C.columns+$+1,"页   共",y*C.columns,"页"]},$))]},Y)),n.paperTitle&&Array.from({length:y},(I,Y)=>C.hasHeader(Y)&&f.jsx(xN,{title:n.paperTitle,page:Y},`${n.paperTitle.id}/${Y}`)),r.flatMap(I=>{const Y=E.get(I.id).fragments,k=O?.id===I.id?Math.min(O.index,Y.length-1):0;return Y.length>1?Y.map(($,L)=>f.jsx("div",{className:`card-fragment-frame${l===J(I.id)&&!v&&L===k?" is-selected":""}`,"data-block-fragment":I.id,"data-page":$.page+1,"data-column":$.column+1,style:{left:$.x,top:$.y,width:C.columnWidth,height:$.to-$.from+($.topPadding||0)+($.bottomPadding||0)},onPointerDown:()=>{v||(M(I.id,L),a(J(I.id)))}},`${I.id}/${L}`)):[]}),F.map((I,Y)=>f.jsx(yN,{hidden:!r.some(k=>k.id===I.id),block:I,index:Y,placement:E.get(I.id),width:C.columnWidth,scale:w,selected:l===J(I.id),readOnly:v,activeChoiceId:!v&&u===J(I.id)?c(n.blocks.find(k=>k.id===J(I.id))||I):void 0,showQuestion:n.questionCard!==!1||!v&&m===I.id,registerEditor:g,uploadImage:N,onSelect:()=>a(J(I.id)),onActiveFragment:k=>M(I.id,k),onSettings:()=>{M(I.id,0),h(J(I.id))},onDocument:k=>R(I.id,{document:k}),onHeight:k=>R(I.id,{answerHeight:k}),onExercise:k=>R(I.id,{exercise:k}),onReference:k=>{I.id!==fr&&R(I.id,{reference:k})},onMeasure:k=>b($=>{const L=$[I.id];return L&&L.compositionStart===k.compositionStart&&Math.abs(L.width-k.width)<.5&&Math.abs(L.height-k.height)<.5&&JSON.stringify(L.breaks)===JSON.stringify(k.breaks)?$:{...$,[I.id]:k}})},I.id))]})}const CN=()=>{const{navigatorVisible:n}=jo(),{geometry:r,totalHeight:l,readOnly:a,pageCount:c,card:s,setSelectedId:u}=Tt();return f.jsxs("div",{className:`${AO["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(zR,{width:r.width,height:l,onBackgroundClick:()=>u(null),children:f.jsx(SN,{})}),f.jsx(cN,{}),f.jsx(_R,{summary:`${c} 页 · ${s.blocks.length} 个题块`}),n&&f.jsx(LR,{})]})},Ro=n=>structuredClone(n);function zv(){return new Promise(n=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(l),n()},l=requestAnimationFrame(r),a=setTimeout(r,50)})}function wN(n,r,l,a,c){l.initialValue&&au(l.initialValue,r);let s=l,u=l.initialValue&&Ro(l.initialValue),h=0,g,m,b=!1,v;const w=yC.createRoot(n,{onUncaughtError:c});function C({readOnly:M}){const z=Tt();return x.useLayoutEffect(()=>{g=z,a()}),x.useEffect(()=>{z.setReadOnly(!!M)},[M]),x.useEffect(()=>{if(m===z.card)return;const H=!m;m=z.card,H||s.onChange?.(Ro(z.card))},[z.card]),null}const y=()=>{if(b||!g)throw new Error("制卡实例尚未就绪或已经销毁");return g},S=(M,z,H)=>({code:M,path:"",message:z,...H}),E=async()=>{const M=Date.now()+8e3;let z="",H=0,G="LAYOUT_PENDING";for(;Date.now()<M;){await zv();const X=y();if(!n.isConnected||n.clientWidth<100||n.clientHeight<100)return{value:X,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const U=[...new Set(X.editors.current.values())].map($=>$.getStatus());G=U.some($=>$.composing||$.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const F=U.every($=>$.ready&&!$.composing&&!$.uploading&&!$.layoutPending),J=X.paperBlocks.every($=>{const L=X.measurements[$.id];return L&&Math.abs(L.width-X.geometry.columnWidth)<1&&L.height>0})&&(!X.card.paperTitle||X.titleMeasurement?.id===X.card.paperTitle.id&&Math.abs(X.titleMeasurement.width-X.geometry.titleWidth)<1),I=Array.from(n.querySelectorAll("img[src], img[srcset]")).filter($=>$.getClientRects().length),Y=I.every($=>$.complete),k=JSON.stringify([X.card,X.measurements,X.titleMeasurement,X.placements]);if(F&&J&&Y&&document.fonts.status==="loaded"&&k===z?H++:H=0,z=k,H>=4){const $=[];return U.forEach(L=>{L.uploadError&&$.push(S("IMAGE_UPLOAD_FAILED",L.uploadError))}),I.some(L=>!L.naturalWidth)&&$.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),X.titleOverflow&&$.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),X.overflow.forEach(L=>$.push(S("CONTENT_OVERFLOW","题块中存在无法放入一栏的内容,请调整尺寸或版式",{path:"blocks",blockId:L.id}))),n.querySelectorAll(".rt-content").forEach(L=>{if(!L.getClientRects().length||L.closest("[hidden]"))return;const Z=L.closest("[data-block-id]")?.dataset.blockId,A=Z&&X.placementById.get(Z);(!A||A.fragments.length===1)&&L.scrollWidth>L.clientWidth+2&&$.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...Z?{blockId:Z}:{}}))}),{value:X,issues:$}}}return{value:y(),issues:[S(G,G==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},R=async()=>{try{const{issues:M,value:z}=await E(),G=[...iC(z.card,r).issues,...M];return{value:z,result:{valid:G.length===0,issues:G}}}catch(M){if(b)throw M;return{value:y(),result:{valid:!1,issues:[S("EDITOR_ERROR",M instanceof Error?M.message:"编辑器或数据校验失败")]}}}},N=async()=>(await R()).result,T=()=>v||(v=(async()=>{const{result:M,value:z}=await R();if(y(),!M.valid)return{ok:!1,issues:M.issues};try{return{ok:!0,data:Ro({...z.card,...z.getReferenceData()})}}catch(H){return{ok:!1,issues:[S("EXPORT_FAILED",H instanceof Error?H.message:"题卡数据转换失败")]}}})().finally(()=>{v=void 0})),O=()=>w.render(f.jsx(NO,{children:f.jsxs(YR,{editorPlugin:r,uploadImage:s.uploadImage,dictionaries:s.dictionaries,initialValue:u,onSave:()=>{y().setSaveMessage("正在校验…"),T().then(M=>{y().setSaveMessage(M.ok?"已生成保存数据":M.issues[0].message),s.onSave?.(M)}).catch(M=>{b||y().setSaveMessage("保存失败"),s.onError?.(M)})},children:[f.jsx(C,{readOnly:s.readOnly}),f.jsx(CN,{})]},h)}));O();const D=async M=>{au(M,r);const z=Ro(M);y(),u=z;const H=++h;Dr.flushSync(O);const G=Date.now()+8e3;do{await zv();const X=y();if(H!==h)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...X.editors.current.values()].every(U=>U.getStatus().ready))return}while(Date.now()<G);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!g&&!b,getDocument:()=>Ro(y().card),setDocument:D,newDocument:M=>D(Wc(M)),getReferenceData:()=>Ro(y().getReferenceData()),setReferenceData:M=>D({...y().card,blocks:wv(Ro(M),r.html)}),validate:N,save:T,focusIssue:M=>{M.blockId&&(y().selectBlock(M.blockId,!0),y().openSettings(M.blockId,!1))},update(M){s=M,O()},destroy(){b||(b=!0,w.unmount(),g=void 0)}}}const EN=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:wN},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=di,nt.createAnswerSheet=sC,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});