import{d as Yn}from"./teacherIcon-b8e3946d.js";import{m as Jn,f as Qn}from"./maleIcon-3fe0e51e.js";import{co as me,cp as eo,d as xe,cq as to,bq as Ie,r as Z,aQ as no,as as U,T as wt,cr as oo,cs as ao,ct as ro,cu as so,cv as io,cw as lo,cx as co,cy as uo,ay as yt,$ as X,cz as at,cA as fo,cB as Vt,cC as ho,cD as go,l as po,cE as Dt,cF as it,cG as vo,cH as mo,cI as bo,bR as dn,cJ as fn,cK as hn,cn as wo,cL as yo,cM as Co,cN as gn,cO as xo,cP as ko,cQ as rt,cR as Gt,cS as dt,cT as Me,cU as Ao,cV as pn,ci as So,cW as Wt,cX as To,cY as mt,aB as Po,w as Xt,b0 as Io,cZ as Ro,c_ as Bo,c$ as Eo,d0 as Mo,d1 as Do,d2 as _o,d3 as Zt,d4 as Fo,d5 as Lo,d6 as No,d7 as Ve,aK as Oo,u as Ko,b as Ct,P as jo,c as ct,e as Ke,f as m,N as xt,g as Ce,h as je,i as Uo,j as de,B as Te,k as ae,F as vn,cc as nt,q as mn,o as bt,ca as zo,cb as It,C as qo,z as _t,d8 as Ho,a3 as $o,a_ as Vo,a4 as bn,y as Yt,d9 as Go,bW as Wo,x as Xo,A as Zo,m as Yo,n as Jt}from"./index-702a142a.js";import{U as wn}from"./index-8b6a127c.js";import{u as Jo,s as Qo}from"./api-bce42013.js";const ea=me("base-menu-mask",` position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; overflow: hidden; `,[eo()]),ta=xe({name:"BaseMenuMask",props:{clsPrefix:{type:String,required:!0}},setup(o){to("-base-menu-mask",ea,Ie(o,"clsPrefix"));const e=Z(null);let t=null;const n=Z(!1);return no(()=>{t!==null&&window.clearTimeout(t)}),Object.assign({message:e,show:n},{showOnce(r,s=1500){t&&window.clearTimeout(t),n.value=!0,e.value=r,t=window.setTimeout(()=>{n.value=!1,e.value=null},s)}})},render(){return U(wt,{name:"fade-in-transition"},{default:()=>this.show?U("div",{class:`${this.clsPrefix}-base-menu-mask`},this.message):null})}}),na=o=>{const{borderRadius:e,boxShadow2:t,popoverColor:n,textColor2:a,textColor3:r,primaryColor:s,textColorDisabled:i,dividerColor:l,hoverColor:c,fontSizeMedium:u,heightMedium:h}=o;return{menuBorderRadius:e,menuColor:n,menuBoxShadow:t,menuDividerColor:l,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:r,optionHeight:h,optionFontSize:u,optionColorHover:c,optionTextColor:a,optionTextColorActive:s,optionTextColorDisabled:i,optionCheckMarkColor:s,loadingColor:s,columnWidth:"180px"}},oa=oo({name:"Cascader",common:ao,peers:{InternalSelectMenu:ro,InternalSelection:so,Scrollbar:io,Checkbox:lo,Empty:co},self:na}),aa=oa;function ft(o){return o?o.map(e=>e.rawNode):null}function ra(o,e,t,n){const a=[],r=[];function s(i){for(const l of i){if(l.disabled)continue;const{rawNode:c}=l;r.push(c),(l.isLeaf||!e)&&a.push({label:Ft(l,n,t),value:l.key,rawNode:l.rawNode,path:Array.from(r)}),!l.isLeaf&&l.children&&s(l.children),r.pop()}}return s(o),a}function Ft(o,e,t){const n=[];for(;o;)n.push(o.rawNode[t]),o=o.parent;return n.reverse().join(e)}const ut=uo("n-cascader"),Qt=xe({name:"NCascaderOption",props:{tmNode:{type:Object,required:!0}},setup(o){const{expandTriggerRef:e,remoteRef:t,multipleRef:n,mergedValueRef:a,checkedKeysRef:r,indeterminateKeysRef:s,hoverKeyPathRef:i,keyboardKeyRef:l,loadingKeySetRef:c,cascadeRef:u,mergedCheckStrategyRef:h,onLoadRef:b,mergedClsPrefixRef:k,mergedThemeRef:S,labelFieldRef:M,showCheckboxRef:_,updateHoverKey:p,updateKeyboardKey:w,addLoadingKey:P,deleteLoadingKey:v,closeMenu:x,doCheck:y,doUncheck:g,renderLabelRef:R}=yt(ut),E=X(()=>o.tmNode.key),T=X(()=>{const{value:ce}=e,{value:Se}=t;return!Se&&ce==="hover"}),f=X(()=>{if(T.value)return ie}),L=X(()=>{if(T.value)return Ue}),C=at(()=>{const{value:ce}=n;return ce?r.value.includes(E.value):a.value===E.value}),O=at(()=>n.value?s.value.includes(E.value):!1),A=at(()=>i.value.includes(E.value)),ge=at(()=>{const{value:ce}=l;return ce===null?!1:ce===E.value}),J=at(()=>t.value?c.value.has(E.value):!1),he=X(()=>o.tmNode.isLeaf),ue=X(()=>o.tmNode.disabled),Q=X(()=>o.tmNode.rawNode[M.value]),se=X(()=>o.tmNode.shallowLoaded);function Ae(ce){if(ue.value)return;const{value:Se}=t,{value:ze}=c,{value:Ze}=b,{value:B}=E,{value:F}=he,{value:D}=se;Dt(ce,"checkbox")||(Se&&!D&&!ze.has(B)&&Ze&&(P(B),Ze(o.tmNode.rawNode).then(()=>{v(B)}).catch(()=>{v(B)})),p(B),w(B)),F&&Ee()}function ie(){if(!T.value||ue.value)return;const{value:ce}=E;p(ce),w(ce)}function Ue(){T.value&&ie()}function Le(){const{value:ce}=he;ce||Ee()}function Ee(){const{value:ce}=n,{value:Se}=E;ce?O.value||C.value?g(Se):y(Se):(y(Se),x(!0))}return{checkStrategy:h,multiple:n,cascade:u,checked:C,indeterminate:O,hoverPending:A,keyboardPending:ge,isLoading:J,showCheckbox:_,isLeaf:he,disabled:ue,label:Q,mergedClsPrefix:k,mergedTheme:S,handleClick:Ae,handleCheckboxUpdateValue:Le,mergedHandleMouseEnter:f,mergedHandleMouseMove:L,renderLabel:R}},render(){const{mergedClsPrefix:o,renderLabel:e}=this;return U("div",{class:[`${o}-cascader-option`,{[`${o}-cascader-option--pending`]:this.keyboardPending||this.hoverPending,[`${o}-cascader-option--disabled`]:this.disabled,[`${o}-cascader-option--show-prefix`]:this.showCheckbox}],onMouseenter:this.mergedHandleMouseEnter,onMousemove:this.mergedHandleMouseMove,onClick:this.handleClick},this.showCheckbox?U("div",{class:`${o}-cascader-option__prefix`},U(po,{focusable:!1,"data-checkbox":!0,disabled:this.disabled,checked:this.checked,indeterminate:this.indeterminate,theme:this.mergedTheme.peers.Checkbox,themeOverrides:this.mergedTheme.peerOverrides.Checkbox,onUpdateChecked:this.handleCheckboxUpdateValue})):null,U("span",{class:`${o}-cascader-option__label`},e?e(this.tmNode.rawNode,this.checked):this.label),U("div",{class:`${o}-cascader-option__suffix`},U("div",{class:`${o}-cascader-option-icon-placeholder`},this.isLeaf?this.checkStrategy==="child"&&!(this.multiple&&this.cascade)?U(wt,{name:"fade-in-scale-up-transition"},{default:()=>this.checked?U(Vt,{clsPrefix:o,class:`${o}-cascader-option-icon ${o}-cascader-option-icon--checkmark`},{default:()=>U(go,null)}):null}):null:U(fo,{clsPrefix:o,scale:.85,strokeWidth:24,show:this.isLoading,class:`${o}-cascader-option-icon`},{default:()=>U(Vt,{clsPrefix:o,key:"arrow",class:`${o}-cascader-option-icon ${o}-cascader-option-icon--arrow`},{default:()=>U(ho,null)})}))))}}),sa=xe({name:"CascaderSubmenu",props:{depth:{type:Number,required:!0},tmNodes:{type:Array,required:!0}},setup(){const{virtualScrollRef:o,mergedClsPrefixRef:e,mergedThemeRef:t,optionHeightRef:n}=yt(ut),a=Z(null),r=Z(null),s={scroll(i,l){var c,u;o.value?(c=r.value)===null||c===void 0||c.scrollTo({index:i}):(u=a.value)===null||u===void 0||u.scrollTo({index:i,elSize:l})}};return Object.assign({mergedClsPrefix:e,mergedTheme:t,scrollbarInstRef:a,vlInstRef:r,virtualScroll:o,itemSize:X(()=>it(n.value)),handleVlScroll:()=>{var i;(i=a.value)===null||i===void 0||i.sync()},getVlContainer:()=>{var i;return(i=r.value)===null||i===void 0?void 0:i.listElRef},getVlContent:()=>{var i;return(i=r.value)===null||i===void 0?void 0:i.itemsElRef}},s)},render(){const{mergedClsPrefix:o,mergedTheme:e,virtualScroll:t}=this;return U("div",{class:[t&&`${o}-cascader-submenu--virtual`,`${o}-cascader-submenu`]},U(vo,{ref:"scrollbarInstRef",theme:e.peers.Scrollbar,themeOverrides:e.peerOverrides.Scrollbar,container:t?this.getVlContainer:void 0,content:t?this.getVlContent:void 0},{default:()=>t?U(mo,{items:this.tmNodes,itemSize:this.itemSize,onScroll:this.handleVlScroll,showScrollbar:!1,ref:"vlInstRef"},{default:({item:n})=>U(Qt,{key:n.key,tmNode:n})}):this.tmNodes.map(n=>U(Qt,{key:n.key,tmNode:n}))}))}}),ia=xe({name:"NCascaderMenu",props:{value:[String,Number,Array],placement:{type:String,default:"bottom-start"},show:Boolean,menuModel:{type:Array,required:!0},loading:Boolean,onFocus:{type:Function,required:!0},onBlur:{type:Function,required:!0},onKeydown:{type:Function,required:!0},onMousedown:{type:Function,required:!0},onTabout:{type:Function,required:!0}},setup(o){const{localeRef:e,isMountedRef:t,mergedClsPrefixRef:n,syncCascaderMenuPosition:a,handleCascaderMenuClickOutside:r,mergedThemeRef:s}=yt(ut),i=[],l=Z(null),c=Z(null);function u(){a()}bo(c,u);function h(_){var p;const{value:{loadingRequiredMessage:w}}=e;(p=l.value)===null||p===void 0||p.showOnce(w(_))}function b(_){r(_)}function k(_){const{value:p}=c;p&&(p.contains(_.relatedTarget)||o.onFocus(_))}function S(_){const{value:p}=c;p&&(p.contains(_.relatedTarget)||o.onBlur(_))}return Object.assign({isMounted:t,mergedClsPrefix:n,selfElRef:c,submenuInstRefs:i,maskInstRef:l,mergedTheme:s,handleFocusin:k,handleFocusout:S,handleClickOutside:b},{scroll(_,p,w){const P=i[_];P&&P.scroll(p,w)},showErrorMessage:h})},render(){const{submenuInstRefs:o,mergedClsPrefix:e,mergedTheme:t}=this;return U(wt,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.show?dn(U("div",{tabindex:"0",ref:"selfElRef",class:`${e}-cascader-menu`,onMousedown:this.onMousedown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeydown:this.onKeydown},this.menuModel[0].length?U("div",{class:`${e}-cascader-submenu-wrapper`},this.menuModel.map((n,a)=>U(sa,{ref:r=>{r&&(o[a]=r)},key:a,tmNodes:n,depth:a+1})),U(ta,{clsPrefix:e,ref:"maskInstRef"})):U("div",{class:`${e}-cascader-menu__empty`},hn(this.$slots.empty,()=>[U(wo,{theme:t.peers.Empty,themeOverrides:t.peerOverrides.Empty})])),yo(this.$slots.action,n=>n&&U("div",{class:`${e}-cascader-menu-action`,"data-action":!0},n)),U(Co,{onFocus:this.onTabout})),[[fn,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),la=xe({name:"NCascaderSelectMenu",props:{value:{type:[String,Number,Array],default:null},show:Boolean,pattern:{type:String,default:""},multiple:Boolean,tmNodes:{type:Array,default:()=>[]},filter:Function,labelField:{type:String,required:!0},separator:{type:String,required:!0}},setup(o){const{isMountedRef:e,mergedValueRef:t,mergedClsPrefixRef:n,mergedThemeRef:a,mergedCheckStrategyRef:r,slots:s,syncSelectMenuPosition:i,closeMenu:l,handleSelectMenuClickOutside:c,doUncheck:u,doCheck:h,clearPattern:b}=yt(ut),k=Z(null),S=X(()=>ra(o.tmNodes,r.value==="child",o.labelField,o.separator)),M=X(()=>{const{filter:T}=o;if(T)return T;const{labelField:f}=o;return(L,C,O)=>O.some(A=>A[f]&&~A[f].indexOf(L))}),_=X(()=>{const{pattern:T}=o,{value:f}=M;return(T?S.value.filter(L=>f(T,L.rawNode,L.path)):S.value).map(L=>({value:L.value,label:L.label}))}),p=X(()=>gn(_.value,xo("value","children")));function w(){i()}function P(T){v(T)}function v(T){if(o.multiple){const{value:f}=t;Array.isArray(f)?f.includes(T.key)?u(T.key):h(T.key):f===null&&h(T.key),b()}else h(T.key),l(!0)}function x(){var T;(T=k.value)===null||T===void 0||T.prev()}function y(){var T;(T=k.value)===null||T===void 0||T.next()}function g(){var T;if(k){const f=(T=k.value)===null||T===void 0?void 0:T.getPendingTmNode();return f&&v(f),!0}return!1}function R(T){c(T)}return Object.assign({isMounted:e,mergedTheme:a,mergedClsPrefix:n,menuInstRef:k,selectTreeMate:p,handleResize:w,handleToggle:P,handleClickOutside:R,cascaderSlots:s},{prev:x,next:y,enter:g})},render(){const{mergedClsPrefix:o,isMounted:e,mergedTheme:t,cascaderSlots:n}=this;return U(wt,{name:"fade-in-scale-up-transition",appear:e},{default:()=>this.show?dn(U(ko,{ref:"menuInstRef",onResize:this.handleResize,clsPrefix:o,class:`${o}-cascader-menu`,autoPending:!0,themeOverrides:t.peerOverrides.InternalSelectMenu,theme:t.peers.InternalSelectMenu,treeMate:this.selectTreeMate,multiple:this.multiple,value:this.value,onToggle:this.handleToggle},{empty:()=>hn(n["not-found"],()=>[])}),[[fn,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),ca=rt([me("cascader-menu",` outline: none; position: relative; margin: 4px 0; display: flex; flex-flow: column nowrap; border-radius: var(--n-menu-border-radius); overflow: hidden; box-shadow: var(--n-menu-box-shadow); color: var(--n-option-text-color); background-color: var(--n-menu-color); `,[Gt({transformOrigin:"inherit",duration:"0.2s"}),dt("empty",` display: flex; padding: 12px 32px; flex: 1; justify-content: center; `),me("scrollbar",{width:"100%"}),me("base-menu-mask",{backgroundColor:"var(--n-menu-mask-color)"}),me("base-loading",{color:"var(--n-loading-color)"}),me("cascader-submenu-wrapper",` position: relative; display: flex; flex-wrap: nowrap; `),me("cascader-submenu",` height: var(--n-menu-height); min-width: var(--n-column-width); position: relative; `,[Me("virtual",` width: var(--n-column-width); `),me("scrollbar-content",{position:"relative"}),rt("&:first-child",` border-top-left-radius: var(--n-menu-border-radius); border-bottom-left-radius: var(--n-menu-border-radius); `),rt("&:last-child",` border-top-right-radius: var(--n-menu-border-radius); border-bottom-right-radius: var(--n-menu-border-radius); `),rt("&:not(:first-child)",` border-left: 1px solid var(--n-menu-divider-color); `)]),me("cascader-menu-action",` box-sizing: border-box; padding: 8px; border-top: 1px solid var(--n-menu-divider-color); `),me("cascader-option",` height: var(--n-option-height); line-height: var(--n-option-height); font-size: var(--n-option-font-size); padding: 0 0 0 18px; box-sizing: border-box; min-width: 182px; background-color: #0000; display: flex; align-items: center; white-space: nowrap; position: relative; cursor: pointer; transition: background-color .2s var(--n-bezier), color 0.2s var(--n-bezier); `,[Me("show-prefix",{paddingLeft:0}),dt("label",` flex: 1 0 0; overflow: hidden; text-overflow: ellipsis; `),dt("prefix",{width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}),dt("suffix",{width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}),me("cascader-option-icon-placeholder",{lineHeight:0,position:"relative",width:"16px",height:"16px",fontSize:"16px"},[me("cascader-option-icon",[Me("checkmark",{color:"var(--n-option-check-mark-color)"},[Gt({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})]),Me("arrow",{color:"var(--n-option-arrow-color)"})])]),Me("selected",{color:"var(--n-option-text-color-active)"}),Me("active",{color:"var(--n-option-text-color-active)",backgroundColor:"var(--n-option-color-hover)"}),Me("pending",{backgroundColor:"var(--n-option-color-hover)"}),rt("&:hover",{backgroundColor:"var(--n-option-color-hover)"}),Me("disabled",` color: var(--n-option-text-color-disabled); background-color: #0000; cursor: not-allowed; `,[me("cascader-option-icon",[Me("arrow",{color:"var(--n-option-text-color-disabled)"})])])])]),me("cascader",` z-index: auto; position: relative; width: 100%; `)]),ua=Object.assign(Object.assign({},pn.props),{allowCheckingNotLoaded:Boolean,to:mt.propTo,bordered:{type:Boolean,default:void 0},options:{type:Array,default:()=>[]},value:[String,Number,Array],defaultValue:{type:[String,Number,Array],default:null},placeholder:String,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},disabledField:{type:String,default:"disabled"},expandTrigger:{type:String,default:"click"},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},remote:Boolean,onLoad:Function,separator:{type:String,default:" / "},filter:Function,placement:{type:String,default:"bottom-start"},cascade:{type:Boolean,default:!0},leafOnly:Boolean,showPath:{type:Boolean,default:!0},show:{type:Boolean,default:void 0},maxTagCount:[String,Number],menuProps:Object,filterMenuProps:Object,virtualScroll:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},valueField:{type:String,default:"value"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},renderLabel:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onBlur:Function,onFocus:Function,onChange:[Function,Array]}),yn=xe({name:"Cascader",props:ua,setup(o,{slots:e}){const{mergedBorderedRef:t,mergedClsPrefixRef:n,namespaceRef:a,inlineThemeDisabled:r}=Ao(o),s=pn("Cascader","-cascader",ca,aa,o,n),{localeRef:i}=So("Cascader"),l=Z(o.defaultValue),c=X(()=>o.value),u=Wt(c,l),h=X(()=>o.leafOnly?"child":o.checkStrategy),b=Z(""),k=To(o),{mergedSizeRef:S,mergedDisabledRef:M,mergedStatusRef:_}=k,p=Z(null),w=Z(null),P=Z(null),v=Z(null),x=Z(null),y=Z(new Set),g=Z(null),R=Z(null),E=mt(o),T=Z(!1),f=d=>{y.value.add(d)},L=d=>{y.value.delete(d)},C=X(()=>{const{valueField:d,childrenField:I,disabledField:N}=o;return gn(o.options,{getDisabled(q){return q[N]},getKey(q){return q[d]},getChildren(q){return q[I]}})}),O=X(()=>{const{cascade:d,multiple:I}=o;return I&&Array.isArray(u.value)?C.value.getCheckedKeys(u.value,{cascade:d,allowNotLoaded:o.allowCheckingNotLoaded}):{checkedKeys:[],indeterminateKeys:[]}}),A=X(()=>O.value.checkedKeys),ge=X(()=>O.value.indeterminateKeys),J=X(()=>{const{treeNodePath:d,treeNode:I}=C.value.getPath(x.value);let N;return I===null?N=[C.value.treeNodes]:(N=d.map(q=>q.siblings),!I.isLeaf&&!y.value.has(I.key)&&I.children&&N.push(I.children)),N}),he=X(()=>{const{keyPath:d}=C.value.getPath(x.value);return d}),ue=X(()=>s.value.self.optionHeight);Po(o.options)&&Xt(o.options,(d,I)=>{d!==I&&(x.value=null,v.value=null)});function Q(d){const{onUpdateShow:I,"onUpdate:show":N}=o;I&&Ve(I,d),N&&Ve(N,d),ze.value=d}function se(d,I,N){const{onUpdateValue:q,"onUpdate:value":K,onChange:ne}=o,{nTriggerFormInput:j,nTriggerFormChange:oe}=k;q&&Ve(q,d,I,N),K&&Ve(K,d,I,N),ne&&Ve(ne,d,I,N),l.value=d,j(),oe()}function Ae(d){v.value=d}function ie(d){x.value=d}function Ue(d){const{value:{getNode:I}}=C;return d.map(N=>{var q;return((q=I(N))===null||q===void 0?void 0:q.rawNode)||null})}function Le(d){var I;const{cascade:N,multiple:q,filterable:K}=o,{value:{check:ne,getNode:j,getPath:oe}}=C;if(q)try{const{checkedKeys:H}=ne(d,O.value.checkedKeys,{cascade:N,checkStrategy:h.value,allowNotLoaded:o.allowCheckingNotLoaded});se(H,Ue(H),H.map(Qe=>{var ot;return ft((ot=oe(Qe))===null||ot===void 0?void 0:ot.treeNodePath)})),K&&W(),v.value=d,x.value=d}catch(H){if(H instanceof Fo){if(p.value){const Qe=j(d);Qe!==null&&p.value.showErrorMessage(Qe.rawNode[o.labelField])}}else throw H}else if(h.value==="child"){const H=j(d);if(H!=null&&H.isLeaf)se(d,H.rawNode,ft(oe(d).treeNodePath));else return!1}else{const H=j(d);se(d,(H==null?void 0:H.rawNode)||null,ft((I=oe(d))===null||I===void 0?void 0:I.treeNodePath))}return!0}function Ee(d){const{cascade:I,multiple:N}=o;if(N){const{value:{uncheck:q,getNode:K,getPath:ne}}=C,{checkedKeys:j}=q(d,O.value.checkedKeys,{cascade:I,checkStrategy:h.value,allowNotLoaded:o.allowCheckingNotLoaded});se(j,j.map(oe=>{var H;return((H=K(oe))===null||H===void 0?void 0:H.rawNode)||null}),j.map(oe=>{var H;return ft((H=ne(oe))===null||H===void 0?void 0:H.treeNodePath)})),v.value=d,x.value=d}}const ce=X(()=>{if(o.multiple){const{showPath:d,separator:I,labelField:N,cascade:q}=o,{getCheckedKeys:K,getNode:ne}=C.value;return K(A.value,{cascade:q,checkStrategy:h.value,allowNotLoaded:o.allowCheckingNotLoaded}).checkedKeys.map(oe=>{const H=ne(oe);return H===null?{label:String(oe),value:oe}:{label:d?Ft(H,I,N):H.rawNode[N],value:H.key}})}else return[]}),Se=X(()=>{const{multiple:d,showPath:I,separator:N,labelField:q}=o,{value:K}=u;if(!d&&!Array.isArray(K)){const{getNode:ne}=C.value;if(K===null)return null;const j=ne(K);return j===null?{label:String(K),value:K}:{label:I?Ft(j,N,q):j.rawNode[q],value:j.key}}else return null}),ze=Z(!1),Ze=Ie(o,"show"),B=Wt(Ze,ze),F=X(()=>{const{placeholder:d}=o;return d!==void 0?d:i.value.placeholder}),D=X(()=>!!(o.filterable&&b.value));Xt(B,d=>{if(!d||o.multiple)return;const{value:I}=u;!Array.isArray(I)&&I!==null?(v.value=I,x.value=I,Oo(()=>{var N;if(!B.value)return;const{value:q}=x;if(u.value!==null){const K=C.value.getNode(q);K&&((N=p.value)===null||N===void 0||N.scroll(K.level,K.index,it(ue.value)))}})):(v.value=null,x.value=null)},{immediate:!0});function z(d){const{onBlur:I}=o,{nTriggerFormBlur:N}=k;I&&Ve(I,d),N()}function le(d){const{onFocus:I}=o,{nTriggerFormFocus:N}=k;I&&Ve(I,d),N()}function W(){var d;(d=P.value)===null||d===void 0||d.focusInput()}function ee(){var d;(d=P.value)===null||d===void 0||d.focus()}function pe(){M.value||(b.value="",Q(!0),o.filterable&&W())}function te(d=!1){d&&ee(),Q(!1),b.value=""}function qe(d){var I;D.value||B.value&&(!((I=P.value)===null||I===void 0)&&I.$el.contains(Lo(d))||te())}function He(d){D.value&&qe(d)}function Ye(){o.clearFilterAfterSelect&&(b.value="")}function $e(d){var I,N,q;const{value:K}=v,{value:ne}=C;switch(d){case"prev":if(K!==null){const j=ne.getPrev(K,{loop:!0});j!==null&&(Ae(j.key),(I=p.value)===null||I===void 0||I.scroll(j.level,j.index,it(ue.value)))}break;case"next":if(K===null){const j=ne.getFirstAvailableNode();j!==null&&(Ae(j.key),(N=p.value)===null||N===void 0||N.scroll(j.level,j.index,it(ue.value)))}else{const j=ne.getNext(K,{loop:!0});j!==null&&(Ae(j.key),(q=p.value)===null||q===void 0||q.scroll(j.level,j.index,it(ue.value)))}break;case"child":if(K!==null){const j=ne.getNode(K);if(j!==null)if(j.shallowLoaded){const oe=ne.getChild(K);oe!==null&&(ie(K),Ae(oe.key))}else{const{value:oe}=y;if(!oe.has(K)){f(K),ie(K);const{onLoad:H}=o;H&&H(j.rawNode).then(()=>{L(K)}).catch(()=>{L(K)})}}}break;case"parent":if(K!==null){const j=ne.getParent(K);if(j!==null){Ae(j.key);const oe=j.getParent();ie(oe===null?null:oe.key)}}break}}function zt(d){var I,N;switch(d.key){case" ":case"ArrowDown":case"ArrowUp":if(o.filterable&&B.value)break;d.preventDefault();break}if(!Dt(d,"action"))switch(d.key){case" ":if(o.filterable)return;case"Enter":if(!B.value)pe();else{const{value:q}=D,{value:K}=v;if(q)w.value&&w.value.enter()&&Ye();else if(K!==null)if(A.value.includes(K)||ge.value.includes(K))Ee(K);else{const ne=Le(K);!o.multiple&&ne&&te(!0)}}break;case"ArrowUp":d.preventDefault(),B.value&&(D.value?(I=w.value)===null||I===void 0||I.prev():$e("prev"));break;case"ArrowDown":d.preventDefault(),B.value?D.value?(N=w.value)===null||N===void 0||N.next():$e("next"):pe();break;case"ArrowLeft":d.preventDefault(),B.value&&!D.value&&$e("parent");break;case"ArrowRight":d.preventDefault(),B.value&&!D.value&&$e("child");break;case"Escape":B.value&&(No(d),te(!0))}}function Dn(d){zt(d)}function _n(d){d.stopPropagation(),o.multiple?se([],[],[]):se(null,null,null)}function Fn(d){var I;!((I=p.value)===null||I===void 0)&&I.$el.contains(d.relatedTarget)||(T.value=!0,le(d))}function Ln(d){var I;!((I=p.value)===null||I===void 0)&&I.$el.contains(d.relatedTarget)||(T.value=!1,z(d),te())}function Nn(d){var I;!((I=P.value)===null||I===void 0)&&I.$el.contains(d.relatedTarget)||(T.value=!0,le(d))}function On(d){var I;!((I=P.value)===null||I===void 0)&&I.$el.contains(d.relatedTarget)||(T.value=!1,z(d))}function Kn(d){Dt(d,"action")||o.multiple&&o.filter&&(d.preventDefault(),W())}function jn(){te(!0)}function Un(){o.filterable?pe():B.value?te(!0):pe()}function zn(d){b.value=d.target.value}function qn(d){const{multiple:I}=o,{value:N}=u;I&&Array.isArray(N)&&d.value!==void 0?Ee(d.value):se(null,null,null)}function qt(){var d;(d=g.value)===null||d===void 0||d.syncPosition()}function Ht(){var d;(d=R.value)===null||d===void 0||d.syncPosition()}function Hn(){B.value&&(D.value?qt():Ht())}const Pt=X(()=>!!(o.multiple&&o.cascade||h.value!=="child"));Io(ut,{slots:e,mergedClsPrefixRef:n,mergedThemeRef:s,mergedValueRef:u,checkedKeysRef:A,indeterminateKeysRef:ge,hoverKeyPathRef:he,mergedCheckStrategyRef:h,showCheckboxRef:Pt,cascadeRef:Ie(o,"cascade"),multipleRef:Ie(o,"multiple"),keyboardKeyRef:v,hoverKeyRef:x,remoteRef:Ie(o,"remote"),loadingKeySetRef:y,expandTriggerRef:Ie(o,"expandTrigger"),isMountedRef:Ro(),onLoadRef:Ie(o,"onLoad"),virtualScrollRef:Ie(o,"virtualScroll"),optionHeightRef:ue,localeRef:i,labelFieldRef:Ie(o,"labelField"),renderLabelRef:Ie(o,"renderLabel"),syncCascaderMenuPosition:Ht,syncSelectMenuPosition:qt,updateKeyboardKey:Ae,updateHoverKey:ie,addLoadingKey:f,deleteLoadingKey:L,doCheck:Le,doUncheck:Ee,closeMenu:te,handleSelectMenuClickOutside:He,handleCascaderMenuClickOutside:qe,clearPattern:Ye});const $n={focus:()=>{var d;(d=P.value)===null||d===void 0||d.focus()},blur:()=>{var d;(d=P.value)===null||d===void 0||d.blur()},getCheckedData:()=>{if(Pt.value){const d=A.value;return{keys:d,options:Ue(d)}}return{keys:[],options:[]}},getIndeterminateData:()=>{if(Pt.value){const d=ge.value;return{keys:d,options:Ue(d)}}return{keys:[],options:[]}}},$t=X(()=>{const{self:{optionArrowColor:d,optionTextColor:I,optionTextColorActive:N,optionTextColorDisabled:q,optionCheckMarkColor:K,menuColor:ne,menuBoxShadow:j,menuDividerColor:oe,menuBorderRadius:H,menuHeight:Qe,optionColorHover:ot,optionHeight:Vn,optionFontSize:Gn,loadingColor:Wn,columnWidth:Xn},common:{cubicBezierEaseInOut:Zn}}=s.value;return{"--n-bezier":Zn,"--n-menu-border-radius":H,"--n-menu-box-shadow":j,"--n-menu-height":Qe,"--n-column-width":Xn,"--n-menu-color":ne,"--n-menu-divider-color":oe,"--n-option-height":Vn,"--n-option-font-size":Gn,"--n-option-text-color":I,"--n-option-text-color-disabled":q,"--n-option-text-color-active":N,"--n-option-color-hover":ot,"--n-option-check-mark-color":K,"--n-option-arrow-color":d,"--n-menu-mask-color":Bo(ne,{alpha:.75}),"--n-loading-color":Wn}}),Je=r?Eo("cascader",void 0,$t,o):void 0;return Object.assign(Object.assign({},$n),{handleTriggerResize:Hn,mergedStatus:_,selectMenuFollowerRef:g,cascaderMenuFollowerRef:R,triggerInstRef:P,selectMenuInstRef:w,cascaderMenuInstRef:p,mergedBordered:t,mergedClsPrefix:n,namespace:a,mergedValue:u,mergedShow:B,showSelectMenu:D,pattern:b,treeMate:C,mergedSize:S,mergedDisabled:M,localizedPlaceholder:F,selectedOption:Se,selectedOptions:ce,adjustedTo:E,menuModel:J,handleMenuTabout:jn,handleMenuFocus:Nn,handleMenuBlur:On,handleMenuKeydown:Dn,handleMenuMousedown:Kn,handleTriggerFocus:Fn,handleTriggerBlur:Ln,handleTriggerClick:Un,handleClear:_n,handleDeleteOption:qn,handlePatternInput:zn,handleKeydown:zt,focused:T,optionHeight:ue,mergedTheme:s,cssVars:r?void 0:$t,themeClass:Je==null?void 0:Je.themeClass,onRender:Je==null?void 0:Je.onRender})},render(){const{mergedClsPrefix:o}=this;return U("div",{class:`${o}-cascader`},U(Mo,null,{default:()=>[U(Do,null,{default:()=>U(_o,{onResize:this.handleTriggerResize,ref:"triggerInstRef",status:this.mergedStatus,clsPrefix:o,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,active:this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,focused:this.focused,onFocus:this.handleTriggerFocus,onBlur:this.handleTriggerBlur,onClick:this.handleTriggerClick,onClear:this.handleClear,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onKeydown:this.handleKeydown},{arrow:()=>{var e,t;return(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)}})}),U(Zt,{key:"cascaderMenu",ref:"cascaderMenuFollowerRef",show:this.mergedShow&&!this.showSelectMenu,containerClass:this.namespace,placement:this.placement,width:this.options.length?void 0:"target",teleportDisabled:this.adjustedTo===mt.tdkey,to:this.adjustedTo},{default:()=>{var e;(e=this.onRender)===null||e===void 0||e.call(this);const{menuProps:t}=this;return U(ia,Object.assign({},t,{ref:"cascaderMenuInstRef",class:[this.themeClass,t==null?void 0:t.class],value:this.mergedValue,show:this.mergedShow&&!this.showSelectMenu,menuModel:this.menuModel,style:[this.cssVars,t==null?void 0:t.style],onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onMousedown:this.handleMenuMousedown,onTabout:this.handleMenuTabout}),{action:()=>{var n,a;return(a=(n=this.$slots).action)===null||a===void 0?void 0:a.call(n)},empty:()=>{var n,a;return(a=(n=this.$slots).empty)===null||a===void 0?void 0:a.call(n)}})}}),U(Zt,{key:"selectMenu",ref:"selectMenuFollowerRef",show:this.mergedShow&&this.showSelectMenu,containerClass:this.namespace,width:"target",placement:this.placement,to:this.adjustedTo,teleportDisabled:this.adjustedTo===mt.tdkey},{default:()=>{var e;(e=this.onRender)===null||e===void 0||e.call(this);const{filterMenuProps:t}=this;return U(la,Object.assign({},t,{ref:"selectMenuInstRef",class:[this.themeClass,t==null?void 0:t.class],value:this.mergedValue,show:this.mergedShow&&this.showSelectMenu,pattern:this.pattern,multiple:this.multiple,tmNodes:this.treeMate.treeNodes,filter:this.filter,labelField:this.labelField,separator:this.separator,style:[this.cssVars,t==null?void 0:t.style]}))}})]}))}}),da="_listWrap_jqusf_1",fa="_customTabs_jqusf_7",ha="_infoWrap_jqusf_28",ga="_teacherInfoWrap_jqusf_35",pa="_teacherHeadWrap_jqusf_40",va="_headerD_jqusf_45",ma="_defultHeade_jqusf_49",ba="_changeHead_jqusf_58",wa="_uploadFile_jqusf_69",ya="_headerInfo_jqusf_77",Ca="_headerTitle_jqusf_77",xa="_sexIcon_jqusf_90",ka="_headerSubTitle_jqusf_95",Aa="_setInfo_jqusf_101",Sa="_btnList_jqusf_125",Ta="_btn_jqusf_125",Pa="_select_jqusf_148",Ia="_changePwdModal_jqusf_151",Ra="_wrap_jqusf_154",Ba="_sendMsg_jqusf_166",Ea="_pwdIcon_jqusf_170",Ma="_submitBtm_jqusf_175",$={listWrap:da,customTabs:fa,infoWrap:ha,teacherInfoWrap:ga,teacherHeadWrap:pa,headerD:va,defultHeade:ma,changeHead:ba,uploadFile:wa,headerInfo:ya,headerTitle:Ca,sexIcon:xa,headerSubTitle:ka,setInfo:Aa,btnList:Sa,btn:Ta,select:Pa,"n-base-selection":"_n-base-selection_jqusf_122",changePwdModal:Ia,wrap:Ra,sendMsg:Ba,pwdIcon:Ea,submitBtm:Ma},Da=""+new URL("headerD-220e6507.png",import.meta.url).href,_a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABPZJREFUaEPtWN1vG0UQn7kYny1hFQgEqASRQYhS4GnPMbFTxaCmkJC0UAiipPwDPECfykcr4QcKqE8pD/wDhBY1fLQkbVBA4EDsxL67J0pbhEhUkAoKFVDZKD7ncoM2nKPrcT5/Nq0l7+Puzuz8ZmZ/M7sITT6wye2HFoBrHcFWBFoRqNMDrRSq04F1izcsApFIpEPTtGcQMQIADxHRZgDYZFp4GREvAsAZIkqJovhJKpVaqtt6gPrqQHd39y0rKyvDRPQcIvYSUVslRiHiKhHNIOJxn893fHZ29q9K5Jz21BSBWCzmy2az+wDgNYuXa7XhMgC8GwgERhOJRL5aJVUBiMfjwuTk5F4AeIuI7qr2MLf9iPgrABwcHBwci8fjRqW6KwYQjUY35/P5jwBgWynliCgDwMeIeE4QhAu6rl/gez0eT6dhGJ1E9AAAPEtEIRcd34qiuCeZTPI7U3ZUBECSpD4i+hAAbnPQeAkA3gOAo6qq/lz2RABgjN0LAC8AwMsAcKuDzB+IOKIoypfl9LkC4CkzMTERB4ADACDYlGmIeISI3lZVledx1YMxtgkR3yCiVwBAtCngaXRoaGgo7pZSJQH09/eLS0tLxwDgabtliHja6/W+lEql1lLEPoaHh9sWFxcfAYB7zLWFYDA4Pz4+vuq0PxKJdBYKhfeJaMBh/bOOjo49U1NTWsUsFI1GA/l8/gQAPGYVMunvgKIohxGR7AoZYzcg4j4i2u+QGpcQ8TARjaqqumKXJSKUJOlVROQEYafjr30+31PJZDL7P2faJ7jxmqZ9RURdtrWLbW1tz2cyme+cPGGmw0ki6nXLJUScIaJdpdKuq6tr2+rqKicLXgitI+3z+frsIK5IIZPfTwPAozbP/yCK4o5SzGDS6ykieqKSi4CIX8iyPOAURS7PGU/TtGkietCm75tAIDBgrRfrAMy8/ZSIdtqE5r1e75Nzc3N/ljKOMcYZhbOUdfD2IcEniCjmUPBGVFU9Wkonr/KFQuEUAPC7tD4Q8fNgMLi7eJ/WATDGjpi0Zt0/HwgE+hKJRM7Ns5IkyUQkFffwemCmyW98jjF2JyLy9Frnf0RUFEUpWQ+4XCwWuzGbzXIqvQIEp21VVTlz/dcLhUKhvYZhfGAz8nu/399brk9hjHEe541Z0RmGx+PZkk6nf7LqC4fD9+m6ft5Cx5wEOlRV5XWk5Ojp6bl5eXl5BgAetm4SBOFFWZbH1g5ljJ0FAF4l1wYv64jYJcvy727K+Vo4HGa6risW2R8VRdniJCdJ0nkiur+45vF4pHQ6rZY7w4xg2ta+nFNVdWtTAAiFQncQUaYkgKZPITONHC9xe3v79unp6X+qvMQZRNxVTEEzBU5Ya0tDLzE3zo1G/X7/gNtlDoVCI4ZhjNlA/s2LFp/bEBo1acuXy+WmzAPX7UHEM6IoPn5dF7KitbW2ErFY7KZcLsfT5Kq0EoiYEUVxu2srYQWRz+dPOrQUOhEdvIrN3H5EPFRXM1cE0dTtdBEEv9gLCwtvujxoRononTofNK8TEf8gaOyDxsoojLEdAMBZptSTklPwsevuSWkFUc2jXhCEs4j4i/VRT0R3G4ax9Zo86otAmvpbxRqNpv3YsrcTTfu16NQXhcPh23Vd391Un7vl+viNWK/oZ24jDKn1jBaAWj3XKLlWBBrlyVr1tCJQq+caJdf0EfgXo04MXg/L95wAAAAASUVORK5CYII=",Fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABT5JREFUaEPtV3+IVFUU/s59M+5Es0G/SKLUTAtCi+beGdddNrE/FoqECC0Lgqgg0FSChPrDUmIpSCqiH5AUSf4TFFG7QQTVlK068+7dIk0qcw2MsiSUjdbdnZ134gxvlrfj7K7zYwthLizszHvnnO875zvn3CGc54fOc/xoEfi/K9iqQKsCDWagJaEGE9iweasCDaewQQetCjSYwIbNWxVoOIUNOpisQE9Pz4XDw8MLEonEkWw2O9Gg3zkx11rHiWiZ53lHc7ncsAQpEchkMqZYLH4OoJ2IjsXj8Z79+/f/PCco6nRqjFnMzIJxIYARIlptrc2XCBhj3mPmNQDmASgAOE1E3dbaH+uM11Szjo6ORYVCYR+AywDEBSMRfWStXVsioLXexcz3E1FbGFlI/KOUutP3/S+biqZGZ8aYm5n5EwAXh+DFwzgRfWCtXV8msICIvmHmiwDEwhhFAAxgs3Pu9RrjNuV1Y8zaIAj2KKU8Zi7jkuSeAtDpnDs62cQrVqy4oVgs7mXm9ghTASIGbwPY6JyT/+f8MDNlMpltQRBsA6DCvzKWv4ioy1o7NNnEZURa62sBfAZgPoCynEBEowAOAlhfNpwrFitXrrxkfHz8TQC3RTEAGAPwRzweX3XgwIFfyvHPWmRaa2mUj5n5pkhPlHTHzKyUeiqZTL4wF6NWa30fgFcBXFAJnoi+SiaTd2ez2dPR5FXdxOvWrZs3NDR0mIgWMbMXNWDmMSKS8omkvmhGJYwxywC8xMy3VMgXzBwQ0an29vYlleDPklBEStK0D4Zj9SyMRFRklv4uyWqHtfZDIip9UcsxxnQxs+i8B4AsTxmR1Y7I5/tYLLa6vMBmktBrAB6qAB+EzTzZF6ED+V7InFRKvcvMfQC+nq7Zt2/frvr6+tIAbieie5h5CQDxUQlchoVMnahChMShRCKxemBg4O+qBLTW1cDLON1ERDLKniWiGDMnqqRpPJwWsmSOM/OvAI5KZZj5GgBXA7hK9M3MExX9VXInw4KZh4loi3xk5ncATEpY5KuUOtjW1nZrmcQkQ631JgA7KzJfJKIN1to3JEAmk7l0YmKiVyn1MDNLlqoRmdIy4S6RUTjtCYHL8+cBPOecG5EPxpj1zLwnSgKATMRXnHNbp/RAKpXKEtGqSJQp4KPRu7q6rhwdHX2EiB4NgiBJRHIFqfkQ0QQzHwfwYiwW212p7xlI5JxzHVMIaK2fBPB0KANSSm3wfX/XTKjkdgjgt/COUn5VtCqyk+rOIyKZJCIvJiLFzEK2XJGT1torZhsAxph7QzkJYbmRPuace3kKAWmw/v7+x2X+A9jtnPt0tpQaY65n5h8i750horcADIbLUBaigD5BRL8DWApgS6SHhNSN1tpDs8XSWi8nojVKqe/y+Xz/tFNoNkfR58aYrcy8I1w8pUee5y3O5/PHqvmRLVsoFP4s7xYiOgOg11rbW0vc6LsN/aRMpVI+EZmyQ2Y+Mjg4eN1MYFKp1AARdUbeOeScW/6fE+ju7r58ZGTkRETPo0qpnb7vy2Ka9mitN8ukiVSNY7HYglwuJ2O35lN3BTKZzB3FYvH9yNgNlFIdvu/7M6Ho7OxcODY2NnkZkwXped5dUV3XwqJuAtJUAL4NKyBT57C1Vi6As14pjDH7giBIhff8olJqqe/7Mk5rPnUTkEjpdPqBIAiekM2rlNqYz+d/OhcE6XR6fhAEz8h29jyvN5/P7z0Xu2rvNESg3qDNtGsRaGY26/HVqkA9WWumTasCzcxmPb5aFagna820aVWgmdmsx9e/6msHT1UYKgkAAAAASUVORK5CYII=",La=xe({name:"forgotPassword",emits:["close"],setup(o,{emit:e}){Ko();const t=Z(),n=Ct(),a=Z(!1);jo.BASE_LOGIN_NAME;const r=Z(!1),s=ct(),i=Ke({mobile:"",password:"",code:"",isCaptcha:!0}),l=Z(!1),c=Z(60),u="发送短信",h=async()=>(t.value.validate(async S=>{if(!S){n.loading("修改中..."),a.value=!0;try{return await Jo({...i,clientType:"TEACHER"}),n.success("修改成功"),a.value=!1,e("close"),setTimeout(()=>{s.logout(),history.go(0)},500),!1}catch(M){return a.value=!1,n.error(M.msg),!1}}}),!1),b=()=>{var S;(S=t.value)==null||S.validate(M=>{M||(k(),Qo({clientId:"cooleshow-teacher",mobile:i.mobile,type:"PASSWORD"}))},M=>M.key==="a")},k=()=>{if(l.value)return;l.value=!0;const S=setInterval(()=>{c.value--,console.log(c.value),c.value<=0&&(l.value=!1,clearInterval(S))},1e3)};return()=>m(vn,null,[m("div",{class:$.wrap},[m(xt,{ref:t,"label-placement":"left",size:"large",model:i},{default:()=>[m(Ce,{path:"mobile",rule:[{key:"a",required:!0,message:"请输入手机号",trigger:"blur"},{key:"a",pattern:/^1[3456789]\d{9}$/,message:"手机号格式不正确",trigger:"blur"}]},{default:()=>[m(je,{maxlength:11,value:i.mobile,"onUpdate:value":S=>i.mobile=S,placeholder:"请输入手机号"},null)]}),m(Ce,{path:"code",rule:[{required:!0,message:"请输入验证码",trigger:"blur"}]},{default:()=>[m(Uo,null,{default:()=>[m(je,{value:i.code,"onUpdate:value":S=>i.code=S,type:"text",maxlength:6,placeholder:"请输入验证码",inputProps:{autocomplete:"off"},class:$.sendInput},null),m(de,{type:"primary",class:$.sendMsg,disabled:l.value,bordered:!1,onClick:()=>b()},{default:()=>[l.value?c.value:u]})]})]}),m(Ce,{path:"password",rule:[{required:!0,message:"请输入密码",trigger:"blur"},{pattern:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/,message:"密码为6-20位数字和字母组合",trigger:"blur"}]},{default:()=>[m(je,{value:i.password,"onUpdate:value":S=>i.password=S,type:"password",showPasswordOn:"click",placeholder:"请输入密码",inputProps:{autocomplete:"off"},class:[r.value?"":$["no-pwd"]]},{"password-visible-icon":()=>m("img",{src:_a,class:$.pwdIcon},null),"password-invisible-icon":()=>m("img",{src:Fa,class:$.pwdIcon},null)})]})]})]),m(Te,{justify:"space-around",style:{width:"100%"},wrap:!1,wrapItem:!1},{default:()=>[m(de,{class:[$.submitBtm,$.submitForgoBtm],onClick:()=>e("close"),size:"large",round:!0,disabled:a.value},{default:()=>[ae("取消")]}),m(de,{class:[$.submitBtm,$.submitForgoBtm],type:"primary",onClick:h,size:"large",round:!0,disabled:a.value},{default:()=>[ae("确认修改")]})]})])}}),Na=o=>nt.post("/edu-app/teacher/page",{data:o}),Oa=o=>nt.post("/edu-app/teacher/add",{data:o}),Ka=o=>nt.post("/edu-app/teacher/updateStatus",{data:o}),ja=o=>nt.post("/edu-app/user/resetPassword",{data:o,requestType:"form"}),Ua=o=>nt.post("/edu-app/school/update",{data:o}),Cn=()=>nt.get("/edu-app/open/sysArea/queryAllProvince"),za=xe({name:"setting-personInfo",setup(){var l,c,u,h;const o=Ct(),e=ct(),t=Ke({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),n=Z(),a=Ke({provinceCode:"",cityCode:"",regionCode:"",nickname:e.info.nickname,phone:e.info.phone,gender:e.info.gender,schoolId:(c=(l=e.info.schoolInfos)==null?void 0:l[0])==null?void 0:c.id,tenantId:(h=(u=e.info.schoolInfos)==null?void 0:u[0])==null?void 0:h.tenantId,id:e.info.id,avatar:e.info.avatar}),r=Ke({disabled:!0,openChangePwd:!1,uploadShow:!0}),s=async()=>{const b=await Cn();(b==null?void 0:b.code)===200&&(t.areaList=b.data)};mn(()=>{s()});const i=()=>{n.value.validate(async b=>{b||(await Ho(a),console.log(a),e.getInfo(),r.disabled=!0,o.success("修改成功"))})};return()=>{var b,k;return m("div",{class:$.infoWrap},[m("div",{class:$.teacherInfoWrap},[m("div",{class:$.teacherHeadWrap},[m(bt,{previewDisabled:!0,class:$.headerD,src:Da},null),m(bt,{previewDisabled:!0,class:$.defultHeade,src:a.avatar||Yn},null),m("div",{style:{display:r.disabled?"none":""},class:[$.defultHeade,$.changeHead]},[ae("修改头像"),r.uploadShow&&m(wn,{class:[$.uploadFile],cropper:!0,"onUpdate:fileList":S=>{a.avatar=S,r.uploadShow=!1,setTimeout(()=>{r.uploadShow=!0},100)}},null)])]),m("div",{class:$.headerInfo},[m("p",{class:$.headerTitle},[e.info.nickname,m(bt,{previewDisabled:!0,class:$.sexIcon,src:e.info.gender?Jn:Qn},null)]),m("p",{class:$.headerSubTitle},[(k=(b=e.info.schoolInfos)==null?void 0:b[0])==null?void 0:k.name,ae(" | 音乐老师")])])]),m("div",{class:$.setInfo},[m(xt,{ref:n,model:a,disabled:r.disabled},{default:()=>[m(zo,{cols:3,"x-gap":"100"},{default:()=>[m(It,null,{default:()=>[m(Ce,{label:"姓名",path:"nickname",rule:{required:!0,message:"请填写老师姓名",trigger:"blur"}},{default:()=>[m(je,{placeholder:"请填写老师姓名",value:a.nickname,"onUpdate:value":S=>a.nickname=S},null)]})]}),m(It,null,{default:()=>[m(Ce,{label:"手机号",path:"phone",rule:[{required:!0,message:"请填写老师手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"手机号格式不正确",trigger:"blur"}]},{default:()=>[m(je,{placeholder:"请填写老师手机号",value:a.phone,"onUpdate:value":S=>a.phone=S},null)]})]}),m(It,null,{default:()=>[m(Ce,{label:"性别",path:"sex"},{default:()=>[m(qo,{class:$.select,showArrow:!r.disabled,placeholder:"请选择性别",options:t.sexs,value:a.gender,"onUpdate:value":S=>a.gender=S},null)]})]})]}),m(Ce,{label:"城区",style:{maxWidth:"30%"}},{default:()=>[m(yn,{options:t.areaList,labelField:"name",valueField:"code",childrenField:"areas",checkStrategy:"child",expandTrigger:"hover",defaultValue:e.info.regionCode||e.info.cityCode,"onUpdate:value":(S,M,_)=>{var p,w,P;a.provinceCode=(p=_[0])==null?void 0:p.code,a.cityCode=(w=_[1])==null?void 0:w.code,a.regionCode=(P=_[2])==null?void 0:P.code}},null)]})]})]),r.disabled?m(Te,{class:$.btnList,align:"center",justify:"end"},{default:()=>[m(de,{class:$.btn,color:"#198cfe",onClick:()=>r.openChangePwd=!0},{default:()=>[ae("修改密码")]}),m(de,{class:$.btn,color:"#f24433",onClick:()=>r.disabled=!1},{default:()=>[ae("修改信息")]})]}):m(Te,{class:$.btnList,align:"center",justify:"end"},{default:()=>[m(de,{class:$.btn,onClick:()=>r.disabled=!0},{default:()=>[ae("取消")]}),m(de,{class:$.btn,type:"primary",onClick:()=>i()},{default:()=>[ae("完成")]})]}),m(_t,{class:$.changePwdModal,show:r.openChangePwd,"onUpdate:show":S=>r.openChangePwd=S,preset:"dialog",showIcon:!1,title:"修改密码"},{default:()=>[m(La,{onClose:()=>{r.openChangePwd=!1}},null)]})])}}}),qa="_logo_yosr2_1",Ha="_changeHead_yosr2_8",$a="_uploadFile_yosr2_29",Va="_input_yosr2_37",Ga="_schoolInfo_yosr2_42",Wa="_errorBtn_yosr2_63",Xa="_addTeacher_yosr2_66",Za="_btnList_yosr2_125",Ya="_btn_yosr2_125",we={logo:qa,changeHead:Ha,uploadFile:$a,input:Va,schoolInfo:Ga,errorBtn:Wa,addTeacher:Xa,btnList:Za,btn:Ya},Ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Qa=bn("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288"},null,-1),er=bn("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M400 256H112"},null,-1),tr=[Qa,er],nr=xe({name:"Add",render:function(e,t){return Vo(),$o("svg",Ja,tr)}}),or=xe({name:"teacher-operation",emits:["close"],setup(o,{emit:e}){var l,c,u,h;const t=ct(),n=Ke({tenantId:(c=(l=t.info.schoolInfos)==null?void 0:l[0])==null?void 0:c.tenantId,phone:null,schoolId:(h=(u=t.info.schoolInfos)==null?void 0:u[0])==null?void 0:h.id,nickname:null,gender:0}),a=Z(!1),r=Z(),s=Ct(),i=async()=>{r.value.validate(async b=>{if(!b){try{a.value=!0,await Oa({...n}),s.success("添加成功")}catch(k){console.log(k)}setTimeout(()=>{a.value=!1,e("close")},100)}})};return()=>m("div",null,[m(xt,{model:n,ref:r,showRequireMark:!1,"label-placement":"left","label-width":"126"},{default:()=>[m(Ce,{label:"老师姓名",path:"nickname",rule:[{required:!0,message:"请输入老师姓名"}]},{default:()=>[m(je,{value:n.nickname,"onUpdate:value":b=>n.nickname=b,placeholder:"请输入老师姓名",clearable:!0,maxlength:14},null)]}),m(Ce,{label:"老师性别",path:"gender",rule:[{required:!0,message:"请选择老师性别"}]},{default:()=>[m(Te,null,{default:()=>[m(Yt("n-button"),{class:"genderBtn",type:n.gender?"info":void 0,tertiary:!n.gender,onClick:()=>{n.gender=1}},{default:()=>[ae("男")]}),m(Yt("n-button"),{class:"genderBtn",type:n.gender?void 0:"info",tertiary:!!n.gender,onClick:()=>{n.gender=0}},{default:()=>[ae("女")]})]})]}),m(Ce,{label:"手机号",path:"phone",rule:[{required:!0,message:"手机号码",trigger:"blur"},{pattern:/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/,message:"请输入正确的手机号",trigger:"blur"}]},{default:()=>[m(je,{maxlength:11,value:n.phone,"onUpdate:value":b=>n.phone=b,placeholder:"请输入手机号",clearable:!0},null)]}),m("div",{class:"nalert"},[m(Go,{type:"error",showIcon:!1,bordered:!1},{default:()=>[ae("默认密码为ktyq+手机号后四位")]})])]}),m(Te,{style:{padding:"20px 0 32px 0"},justify:"center"},{default:()=>[m(de,{class:"actionBtn",round:!0,type:"default",onClick:()=>e("close")},{default:()=>[ae("取消")]}),m(de,{class:"actionBtn",round:!0,type:"primary",onClick:()=>i(),loading:a.value},{default:()=>[ae("确定")]})]})])}});function Pe(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function en(o,e){for(var t="",n=0,a=-1,r=0,s,i=0;i<=o.length;++i){if(i2){var l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),a=i,r=0;continue}}else if(t.length===2||t.length===1){t="",n=0,a=i,r=0;continue}}e&&(t.length>0?t+="/..":t="..",n=2)}else t.length>0?t+="/"+o.slice(a+1,i):t=o.slice(a+1,i),n=i-a-1;a=i,r=0}else s===46&&r!==-1?++r:r=-1}return t}function ar(o,e){var t=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+n:t+o+n:n}var We={resolve:function(){for(var e="",t=!1,n,a=arguments.length-1;a>=-1&&!t;a--){var r;a>=0?r=arguments[a]:(n===void 0&&(n=process.cwd()),r=n),Pe(r),r.length!==0&&(e=r+"/"+e,t=r.charCodeAt(0)===47)}return e=en(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(Pe(e),e.length===0)return".";var t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=en(e,!t),e.length===0&&!t&&(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return Pe(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":We.normalize(e)},relative:function(e,t){if(Pe(e),Pe(t),e===t||(e=We.resolve(e),t=We.resolve(t),e===t))return"";for(var n=1;nc){if(t.charCodeAt(s+h)===47)return t.slice(s+h+1);if(h===0)return t.slice(s+h)}else r>c&&(e.charCodeAt(n+h)===47?u=h:h===0&&(u=0));break}var b=e.charCodeAt(n+h),k=t.charCodeAt(s+h);if(b!==k)break;b===47&&(u=h)}var S="";for(h=n+u+1;h<=a;++h)(h===a||e.charCodeAt(h)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(Pe(e),e.length===0)return".";for(var t=e.charCodeAt(0),n=t===47,a=-1,r=!0,s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!r){a=s;break}}else r=!1;return a===-1?n?"/":".":n&&a===1?"//":e.slice(0,a)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pe(e);var n=0,a=-1,r=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var i=t.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!r){n=s+1;break}}else l===-1&&(r=!1,l=s+1),i>=0&&(c===t.charCodeAt(i)?--i===-1&&(a=s):(i=-1,a=l))}return n===a?a=l:a===-1&&(a=e.length),e.slice(n,a)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!r){n=s+1;break}}else a===-1&&(r=!1,a=s+1);return a===-1?"":e.slice(n,a)}},extname:function(e){Pe(e);for(var t=-1,n=0,a=-1,r=!0,s=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(l===47){if(!r){n=i+1;break}continue}a===-1&&(r=!1,a=i+1),l===46?t===-1?t=i:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||a===-1||s===0||s===1&&t===a-1&&t===n+1?"":e.slice(t,a)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return ar("/",e)},parse:function(e){Pe(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var n=e.charCodeAt(0),a=n===47,r;a?(t.root="/",r=1):r=0;for(var s=-1,i=0,l=-1,c=!0,u=e.length-1,h=0;u>=r;--u){if(n=e.charCodeAt(u),n===47){if(!c){i=u+1;break}continue}l===-1&&(c=!1,l=u+1),n===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||l===-1||h===0||h===1&&s===l-1&&s===i+1?l!==-1&&(i===0&&a?t.base=t.name=e.slice(1,l):t.base=t.name=e.slice(i,l)):(i===0&&a?(t.name=e.slice(1,s),t.base=e.slice(1,l)):(t.name=e.slice(i,s),t.base=e.slice(i,l)),t.ext=e.slice(s,l)),i>0?t.dir=e.slice(0,i-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};We.posix=We;const rr=We.extname,xn=We.basename;class sr{constructor(){let e=(()=>typeof global>"u")(),t="image/png",n="image/jpeg",a="image/jpeg",r="image/webp",s="application/pdf",i="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:e?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:e?{png:t,jpg:n,jpeg:a,webp:r}:{png:t,jpg:n,jpeg:a,pdf:s,svg:i},mimes:e?{[t]:"png",[n]:"jpg",[r]:"webp"}:{[t]:"png",[n]:"jpg",[s]:"pdf",[i]:"svg"}})}toMime(e){return this.formats[(e||"").replace(/^\./,"").toLowerCase()]}fromMime(e){return this.mimes[e]}}function ir(o,{filename:e="",extension:t="",format:M,page:a,quality:r,matte:s,density:i,outline:l,archive:k}={}){var{fromMime:u,toMime:h,expected:b}=new sr,k=k||"canvas",S=M||t.replace(/@\d+x$/i,"")||rr(e),M=u(h(S)||S),_=h(M),p=o.length;if(!S)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!M)throw new Error(`Unsupported file format "${S}" (expected ${b})`);if(!p)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let w,P,v=e.replace(/{(\d*)}/g,(y,g)=>(P=!0,g=parseInt(g,10),w=isFinite(g)?g:isFinite(w)?w:-1,"{}")),x=a>0?a-1:a<0?p+a:void 0;if(isFinite(x)&&x<0||x>=p)throw new RangeError(p==1?`Canvas only has a ‘page 1’ (${x} is out of bounds)`:`Canvas has pages 1–${p} (${x} is out of bounds)`);if(o=isFinite(x)?[o[x]]:P||M=="pdf"?o:o.slice(-1),r===void 0)r=.92;else if(typeof r!="number"||!isFinite(r)||r<0||r>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(i===void 0){let y=(t||xn(e,S)).match(/@(\d+)x$/i);i=y?parseInt(y[1],10):1}else if(typeof i!="number"||!Number.isInteger(i)||i<1)throw new TypeError("The density option must be a non-negative integer");return l===void 0?l=!0:M=="svg"&&(l=!!l),{filename:e,pattern:v,format:M,mime:_,pages:o,padding:w,quality:r,matte:s,density:i,outline:l,archive:k}}class kt{static for(e){return new kt().append(e).get()}constructor(){this.crc=-1}get(){return~this.crc}append(e){for(var t=this.crc|0,n=this.table,a=0,r=e.length|0;a>>8^n[(t^e[a])&255];return this.crc=t,this}}kt.prototype.table=(()=>{var o,e,t,n=[];for(o=0;o<256;o++){for(t=o,e=0;e<8;e++)t=t&1?t>>>1^3988292384:t>>>1;n[o]=t}return n})();function Rt(o){let e=new Uint8Array(o),t=new DataView(e.buffer),n={array:e,view:t,size:o,set8(a,r){return t.setUint8(a,r),n},set16(a,r){return t.setUint16(a,r,!0),n},set32(a,r){return t.setUint32(a,r,!0),n},bytes(a,r){return e.set(r,a),n}};return n}class At{constructor(e){let t=new Date;Object.assign(this,{directory:e,offset:0,files:[],time:(t.getHours()<<6|t.getMinutes())<<5|t.getSeconds()/2,date:(t.getFullYear()-1980<<4|t.getMonth()+1)<<5|t.getDate()}),this.add(e)}async add(e,t){let n=!t,a=At.encoder.encode(`${this.directory}/${n?"":e}`),r=new Uint8Array(n?0:await t.arrayBuffer()),s=30+a.length,i=s+r.length,l=16,{offset:c}=this,u=Rt(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,kt.for(r)).set32(14,r.length).set32(18,r.length).set16(22,a.length);c+=s;let h=Rt(s+r.length+l).set32(0,67324752).bytes(4,u.array).bytes(30,a).bytes(s,r);c+=r.length,h.set32(i,134695760).bytes(i+4,u.array.slice(10,22)),c+=l,this.files.push({offset:c,folder:n,name:a,header:u,payload:h}),this.offset=c}toBuffer(){let e=this.files.reduce((h,{name:b})=>46+b.length+h,0),t=Rt(e+22),n=0;for(var{offset:a,name:r,header:s,folder:i}of this.files)t.set32(n,33639248).set16(n+4,20).bytes(n+6,s.array).set8(n+38,i?16:0).set32(n+42,a).bytes(n+46,r),n+=46+r.length;t.set32(n,101010256).set16(n+8,this.files.length).set16(n+10,this.files.length).set32(n+12,e).set32(n+16,this.offset);let l=new Uint8Array(this.offset+t.size),c=0;for(var{payload:u}of this.files)l.set(u.array,c),c+=u.size;return l.set(t.array,c),l}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}}At.encoder=new TextEncoder;const Ot=(o,e,t,n)=>{if(n){let{width:a,height:r}=o,s=Object.assign(document.createElement("canvas"),{width:a,height:r}),i=s.getContext("2d");i.fillStyle=n,i.fillRect(0,0,a,r),i.drawImage(o,0,0),o=s}return new Promise((a,r)=>o.toBlob(a,e,t))},lr=(...o)=>Ot(...o).then(e=>e.arrayBuffer()),cr=async(o,e,t,n,a)=>{kn(a,await Ot(o,e,t,n))},ur=async(o,e,t,n,a,r,s)=>{let i=u=>r.replace("{}",String(u+1).padStart(s,"0")),l=xn(a,".zip")||"archive",c=new At(l);await Promise.all(o.map(async(u,h)=>{let b=i(h);await c.add(b,await Ot(u,e,t,n))})),kn(`${l}.zip`,c.blob)},kn=(o,e)=>{const t=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=t,n.setAttribute("download",o),typeof n.download>"u"&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout(()=>window.URL.revokeObjectURL(t),100)},dr=(o,e,t)=>o.map(n=>{if(e==1&&!t)return n.canvas;let a=document.createElement("canvas"),r=a.getContext("2d"),s=n.canvas?n.canvas:n;return a.width=s.width*e,a.height=s.height*e,t&&(r.fillStyle=t,r.fillRect(0,0,a.width,a.height)),r.scale(e,e),r.drawImage(s,0,0),a}),fr={asBuffer:lr,asDownload:cr,asZipDownload:ur,atScale:dr,options:ir},{asBuffer:Bt,asDownload:hr,asZipDownload:gr,atScale:Et,options:Mt}=fr,tn=Symbol.for("toDataURL"),pr=o=>new Promise((e,t)=>Object.assign(new An,{crossOrigin:"Anonymous",onload:e,onerror:t,src:o}));let vr=class{constructor(e,t){let n=document.createElement("canvas"),a=[];Object.defineProperty(n,"async",{value:!0,writable:!1,enumerable:!0});for(var[r,s]of Object.entries({png:()=>Bt(n,"image/png"),jpg:()=>Bt(n,"image/jpeg"),pages:()=>a.concat(n).map(i=>i.getContext("2d"))}))Object.defineProperty(n,r,{get:s});return Object.assign(n,{width:e,height:t,newPage(...i){var{width:c,height:u}=n,l=Object.assign(document.createElement("canvas"),{width:c,height:u});l.getContext("2d").drawImage(n,0,0),a.push(l);var[c,u]=i.length?i:[c,u];return Object.assign(n,{width:c,height:u}).getContext("2d")},saveAs(i,l){l=typeof l=="number"?{quality:l}:l;let c=Mt(this.pages,{filename:i,...l}),{pattern:u,padding:h,mime:b,quality:k,matte:S,density:M,archive:_}=c,p=Et(c.pages,M);return h==null?hr(p[0],b,k,S,i):gr(p,b,k,S,_,u,h)},toBuffer(i="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Mt(this.pages,{extension:i,...l}),{mime:u,quality:h,matte:b,pages:k,density:S}=c,M=Et(k,S,b)[0];return Bt(M,u,h,b)},[tn]:n.toDataURL.bind(n),toDataURL(i="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Mt(this.pages,{extension:i,...l}),{mime:u,quality:h,matte:b,pages:k,density:S}=c,M=Et(k,S,b)[0],_=M[M===n?tn:"toDataURL"](u,h);return Promise.resolve(_)}})}};const{CanvasRenderingContext2D:mr,CanvasGradient:br,CanvasPattern:wr,Image:An,ImageData:yr,Path2D:Cr,DOMMatrix:xr,DOMRect:kr,DOMPoint:Ar}=window,Sr={Canvas:vr,loadImage:pr,CanvasRenderingContext2D:mr,CanvasGradient:br,CanvasPattern:wr,Image:An,ImageData:yr,Path2D:Cr,DOMMatrix:xr,DOMRect:kr,DOMPoint:Ar},lt=(o,e,t={},n=t)=>{if(Array.isArray(e))e.forEach(a=>lt(o,a,t,n));else if(typeof e=="function")e(o,t,n,lt);else{const a=Object.keys(e)[0];Array.isArray(e[a])?(n[a]={},lt(o,e[a],t,n[a])):n[a]=e[a](o,t,n,lt)}return t},Xe=(o,e)=>(t,n,a,r)=>{e(t,n,a)&&r(t,o,n,a)},Tr=(o,e)=>(t,n,a,r)=>{const s=[];let i=t.pos;for(;e(t,n,a);){const l={};if(r(t,o,n,l),t.pos===i)break;i=t.pos,s.push(l)}return s},Pr=o=>({data:o,pos:0}),ke=()=>o=>o.data[o.pos++],Sn=(o=0)=>e=>e.data[e.pos+o],Be=o=>e=>e.data.subarray(e.pos,e.pos+=o),St=o=>e=>e.data.subarray(e.pos,e.pos+o),Lt=o=>e=>Array.from(Be(o)(e)).map(t=>String.fromCharCode(t)).join(""),Ge=o=>e=>{const t=Be(2)(e);return o?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]},Tn=(o,e)=>(t,n,a)=>{const r=typeof e=="function"?e(t,n,a):e,s=Be(o),i=new Array(r);for(var l=0;l{for(var n=0,a=0;ae=>{const t=ke()(e),n=new Array(8);for(var a=0;a<8;a++)n[7-a]=!!(t&1<{const i=o[s];return i.length?r[s]=Ir(n,i.index,i.length):r[s]=n[i.index],r},{})};var Tt={blocks:o=>{const t=[],n=o.data.length;for(var a=0,r=ke()(o);r!==0&&r;r=ke()(o)){if(o.pos+r>=n){const c=n-o.pos;t.push(Be(c)(o)),a+=c;break}t.push(Be(r)(o)),a+=r}const s=new Uint8Array(a);for(var i=0,l=0;l{var e=St(2)(o);return e[0]===33&&e[1]===249}),Br=Xe({image:[{code:ke()},{descriptor:[{left:Ge(!0)},{top:Ge(!0)},{width:Ge(!0)},{height:Ge(!0)},{lct:Kt({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},Xe({lct:Tn(3,(o,e,t)=>Math.pow(2,t.descriptor.lct.size+1))},(o,e,t)=>t.descriptor.lct.exists),{data:[{minCodeSize:ke()},Tt]}]},o=>Sn()(o)===44),Er=Xe({text:[{codes:Be(2)},{blockSize:ke()},{preData:(o,e,t)=>Be(t.text.blockSize)(o)},Tt]},o=>{var e=St(2)(o);return e[0]===33&&e[1]===1}),Mr=Xe({application:[{codes:Be(2)},{blockSize:ke()},{id:(o,e,t)=>Lt(t.blockSize)(o)},Tt]},o=>{var e=St(2)(o);return e[0]===33&&e[1]===255}),Dr=Xe({comment:[{codes:Be(2)},Tt]},o=>{var e=St(2)(o);return e[0]===33&&e[1]===254}),_r=[{header:[{signature:Lt(3)},{version:Lt(3)}]},{lsd:[{width:Ge(!0)},{height:Ge(!0)},{gct:Kt({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:ke()},{pixelAspectRatio:ke()}]},Xe({gct:Tn(3,(o,e)=>Math.pow(2,e.lsd.gct.size+1))},(o,e)=>e.lsd.gct.exists),{frames:Tr([Rr,Mr,Dr,Br,Er],o=>{var e=Sn()(o);return e===33||e===44})}],Fr=(o,e)=>{const t=new Array(o.length),n=o.length/e,a=function(u,h){const b=o.slice(h*e,(h+1)*e);t.splice.apply(t,[u*e,e].concat(b))},r=[0,4,2,1],s=[8,8,4,2];for(var i=0,l=0;l<4;l++)for(var c=r[l];c{const r=t;var s,i,l,c,u,h,b,x,k,S,v,M,y,g,E,R;const _=new Array(t),p=new Array(4096),w=new Array(4096),P=new Array(4096+1);for(M=o,i=1<>=c,x-=c,k>s||k==u)break;if(k==i){c=M+1,l=(1<i;)P[g++]=w[k],k=p[k];y=w[k]&255,P[g++]=y,s<4096&&(p[s]=b,w[s]=y,s++,!(s&l)&&s<4096&&(c++,l+=s)),b=h}g--,_[R++]=P[g],S++}for(S=R;S{const e=new Uint8Array(o);return lt(Pr(e),_r)},Or=o=>{const e=o.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n{if(!o.image){console.warn("gif frame does not have associated image.");return}const{image:n}=o,a=n.descriptor.width*n.descriptor.height;var r=Lr(n.data.minCodeSize,n.data.blocks,a);n.descriptor.lct.interlaced&&(r=Fr(r,n.descriptor.width));const s={pixels:r,dims:{top:o.image.descriptor.top,left:o.image.descriptor.left,width:o.image.descriptor.width,height:o.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?s.colorTable=n.lct:s.colorTable=e,o.gce&&(s.delay=(o.gce.delay||10)*10,s.disposalType=o.gce.extras.disposal,o.gce.extras.transparentColorGiven&&(s.transparentIndex=o.gce.transparentColorIndex)),t&&(s.patch=Or(s)),s},jr=(o,e)=>o.frames.filter(t=>t.image).map(t=>Kr(t,o.gct,e));function Ur(o,e,t){const n=Pn(e),a=o-1;let r=0;switch(t){case ve.L:r=Re[a][0];break;case ve.M:r=Re[a][1];break;case ve.Q:r=Re[a][2];break;case ve.H:r=Re[a][3];break}return n<=r}function zr(o,e){for(var t=1,n=Pn(o),a=0,r=Re.length;aRe.length)throw new Error("Too long data");return t}function Pn(o){var e=encodeURI(o).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=Number(o)?3:0)}class qr{constructor(e){this.mode=ye.MODE_8BIT_BYTE,this.parsedData=[],this.data=e;const t=[];for(let n=0,a=this.data.length;n65536?(r[0]=240|(s&1835008)>>>18,r[1]=128|(s&258048)>>>12,r[2]=128|(s&4032)>>>6,r[3]=128|s&63):s>2048?(r[0]=224|(s&61440)>>>12,r[1]=128|(s&4032)>>>6,r[2]=128|s&63):s>128?(r[0]=192|(s&1984)>>>6,r[1]=128|s&63):r[0]=s,t.push(r)}this.parsedData=Array.prototype.concat.apply([],t),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}getLength(){return this.parsedData.length}write(e){for(let t=0,n=this.parsedData.length;t40)throw new Error(`Invalid QR version: ${this.typeNumber}`);if(!Ur(this.typeNumber,e,this.errorCorrectLevel))throw new Error(`Data is too long for QR version: ${this.typeNumber}`)}const t=new qr(e);this.dataList.push(t),this.dataCache=void 0}isDark(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(`${e},${t}`);return this.modules[e][t]}getModuleCount(){return this.moduleCount}make(){this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Oe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)}setupPositionProbePattern(e,t){for(let n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(let a=-1;a<=7;a++)t+a<=-1||this.moduleCount<=t+a||(0<=n&&n<=6&&(a==0||a==6)||0<=a&&a<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=a&&a<=4?this.modules[e+n][t+a]=!0:this.modules[e+n][t+a]=!1)}getBestMaskPattern(){if(Number.isInteger(this.maskPattern)&&Object.values(_e).includes(this.maskPattern))return this.maskPattern;let e=0,t=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const a=G.getLostPoint(this);(n==0||e>a)&&(e=a,t=n)}return t}setupTimingPattern(){for(let e=8;e>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=a}for(var n=0;n<18;n++){var a=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=a}}setupTypeInfo(e,t){const n=this.errorCorrectLevel<<3|t,a=G.getBCHTypeInfo(n);for(var r=0;r<15;r++){var s=!e&&(a>>r&1)==1;r<6?this.modules[r][8]=s:r<8?this.modules[r+1][8]=s:this.modules[this.moduleCount-15+r][8]=s}for(var r=0;r<15;r++){var s=!e&&(a>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=s:r<9?this.modules[8][15-r-1+1]=s:this.modules[8][15-r-1]=s}this.modules[this.moduleCount-8][8]=!e}mapData(e,t){let n=-1,a=this.moduleCount-1,r=7,s=0;for(let i=this.moduleCount-1;i>0;i-=2)for(i==6&&i--;;){for(let l=0;l<2;l++)if(this.modules[a][i-l]==null){let c=!1;s>>r&1)==1),G.getMask(t,a,i-l)&&(c=!c),this.modules[a][i-l]=c,r--,r==-1&&(s++,r=7)}if(a+=n,a<0||this.moduleCount<=a){a-=n,n=-n;break}}}static createData(e,t,n){const a=Fe.getRSBlocks(e,t),r=new Hr;for(var s=0;si*8)throw new Error(`code length overflow. (${r.getLengthInBits()}>${i*8})`);for(r.getLengthInBits()+4<=i*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=i*8||(r.put(Oe.PAD0,8),r.getLengthInBits()>=i*8));)r.put(Oe.PAD1,8);return Oe.createBytes(r,a)}static createBytes(e,t){let n=0,a=0,r=0;const s=new Array(t.length),i=new Array(t.length);for(var l=0;l=0?p.get(P):0}}let u=0;for(var c=0;c=0;)t^=G.G15<=0;)t^=G.G18<>>=1;return t}static getPatternPosition(e){return G.PATTERN_POSITION_TABLE[e-1]}static getMask(e,t,n){switch(e){case _e.PATTERN000:return(t+n)%2==0;case _e.PATTERN001:return t%2==0;case _e.PATTERN010:return n%3==0;case _e.PATTERN011:return(t+n)%3==0;case _e.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case _e.PATTERN101:return t*n%2+t*n%3==0;case _e.PATTERN110:return(t*n%2+t*n%3)%2==0;case _e.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error(`bad maskPattern:${e}`)}}static getErrorCorrectPolynomial(e){let t=new tt([1],0);for(let n=0;n5&&(n+=3+l-5)}for(var a=0;a=256;)e-=255;return re.EXP_TABLE[e]}}re.EXP_TABLE=new Array(256);re.LOG_TABLE=new Array(256);re._constructor=function(){for(var o=0;o<8;o++)re.EXP_TABLE[o]=1<>>7-e%8&1)==1}put(e,t){for(let n=0;n>>t-n-1&1)==1)}getLengthInBits(){return this.length}putBit(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}}const Re=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];var $r=100,fe=256,nn=fe-1,Ne=4,In=16,jt=1<>Ut,Gr=jt<>3,Nt=6,Xr=1<>3);var p,w;for(p=0;p>=Ne,t[p][1]>>=Ne,t[p][2]>>=Ne,t[p][3]=p}function c(p,w,P,v,x){t[w][0]-=p*(t[w][0]-P)/ht,t[w][1]-=p*(t[w][1]-v)/ht,t[w][2]-=p*(t[w][2]-x)/ht}function u(p,w,P,v,x){for(var y=Math.abs(w-p),g=Math.min(w+p,fe),R=w+1,E=w-1,T=1,f,L;Ry;)L=s[T++],Ry&&(f=t[E--],f[0]-=L*(f[0]-P)/et,f[1]-=L*(f[1]-v)/et,f[2]-=L*(f[2]-x)/et)}function h(p,w,P){var v=2147483647,x=v,y=-1,g=y,R,E,T,f,L;for(R=0;R>In-Ne),f>Ut,r[R]-=L,a[R]+=L<>1,w=g+1;w>1,w=g+1;w<256;w++)n[w]=nn}function k(p,w,P){for(var v,x,y,g=1e3,R=-1,E=n[w],T=E-1;E=0;)E=g?E=fe:(E++,y<0&&(y=-y),v=x[0]-p,v<0&&(v=-v),y+=v,y=0&&(x=t[T],y=w-x[1],y>=g?T=-1:(T--,y<0&&(y=-y),v=x[0]-p,v<0&&(v=-v),y+=v,y>Nt;for(R<=1&&(R=0),p=0;p=w&&(O-=w),p++,x===0&&(x=1),p%x===0)for(y-=y/P,g-=g/Yr,R=g>>Nt,R<=1&&(R=0),C=0;C=254&&E(O)}function x(C){y(st),h=M+2,k=!0,L(M,C)}function y(C){for(var O=0;O=0){ue=Q-J,J===0&&(ue=1);do if((J-=ue)<0&&(J+=Q),s[J]===A){he=i[J];continue e}while(s[J]>=0)}L(he,O),he=ge,h<1<0&&(C.writeByte(u),C.writeBytes(r,0,u),u=0)}function T(C){return(1<0?l|=C<=8;)v(l&255,O),l>>=8,c-=8;if((h>b||k)&&(k?(b=T(P=S),k=!1):(++P,P==gt?b=1<0;)v(l&255,O),l>>=8,c-=8;E(O)}}this.encode=R}function be(){this.page=-1,this.pages=[],this.newPage()}be.pageSize=4096;be.charMap={};for(var pt=0;pt<256;pt++)be.charMap[pt]=String.fromCharCode(pt);be.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(be.pageSize),this.cursor=0};be.prototype.getData=function(){for(var o="",e=0;en+a.length,0));return o.reduce((n,a)=>(t.set(a,n),n+a.length),0),t};be.prototype.writeByte=function(o){this.cursor>=be.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=o};be.prototype.writeUTFBytes=function(o){for(var e=o.length,t=0;t=0&&(this.dispose=o)};Y.prototype.setRepeat=function(o){this.repeat=o};Y.prototype.setTransparent=function(o){this.transparent=o};Y.prototype.addFrame=function(o){this.image=o,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),this.globalPalette===!0&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),!this.firstFrame&&!this.globalPalette&&this.writePalette(),this.writePixels(),this.firstFrame=!1};Y.prototype.finish=function(){this.out.writeByte(59)};Y.prototype.setQuality=function(o){o<1&&(o=1),this.sample=o};Y.prototype.setDither=function(o){o===!0&&(o="FloydSteinberg"),this.dither=o};Y.prototype.setGlobalPalette=function(o){this.globalPalette=o};Y.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};Y.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};Y.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new es(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,this.transparent!==null&&(this.transIndex=this.findClosest(this.transparent,!0))};Y.prototype.indexPixels=function(o){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);for(var t=0,n=0;n=0&&R+u=0&&E+c>16,(o&65280)>>8,o&255,e)};Y.prototype.findClosestRGB=function(o,e,t,n){if(this.colorTab===null)return-1;if(this.neuQuant&&!n)return this.neuQuant.lookupRGB(o,e,t);for(var a=0,r=256*256*256,s=this.colorTab.length,i=0,l=0;i=0&&(e=this.dispose&7),e<<=2,this.out.writeByte(0|e|0|o),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};Y.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)};Y.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)};Y.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)};Y.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var o=3*256-this.colorTab.length,e=0;e>8&255)};Y.prototype.writePixels=function(){var o=new ns(this.width,this.height,this.indexedPixels,this.colorDepth);o.encode(this.out)};Y.prototype.stream=function(){return this.out};var os=globalThis&&globalThis.__awaiter||function(o,e,t,n){function a(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function i(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?r(u.value):a(u.value).then(i,l)}c((n=n.apply(o,e||[])).next())})};const{Canvas:De}=Sr,vt=.4;function cn(o){if(!o)return;function e(t){t.onload=null,t.onerror=null}return new Promise(function(t,n){if(o.slice(0,4)=="data"){let r=new Image;r.onload=function(){t(r),e(r)},r.onerror=function(){n("Image load error"),e(r)},r.src=o;return}let a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.onload=function(){t(a)},a.onerror=function(){n("Image load error")},a.src=o})}class V{constructor(e){const t=Object.assign({},e);if(Object.keys(V.defaultOptions).forEach(n=>{n in t||Object.defineProperty(t,n,{value:V.defaultOptions[n],enumerable:!0,writable:!0})}),t.components?typeof t.components=="object"&&Object.keys(V.defaultComponentOptions).forEach(n=>{n in t.components?Object.defineProperty(t.components,n,{value:Object.assign(Object.assign({},V.defaultComponentOptions[n]),t.components[n]),enumerable:!0,writable:!0}):Object.defineProperty(t.components,n,{value:V.defaultComponentOptions[n],enumerable:!0,writable:!0})}):t.components=V.defaultComponentOptions,t.dotScale!==null&&t.dotScale!==void 0){if(t.dotScale<=0||t.dotScale>1)throw new Error("dotScale should be in range (0, 1].");t.components.data.scale=t.dotScale,t.components.timing.scale=t.dotScale,t.components.alignment.scale=t.dotScale}this.options=t,this.canvas=new De(e.size,e.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new Oe(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}draw(){return new Promise(e=>this._draw().then(e))}_clear(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}static _prepareRoundedCornerClip(e,t,n,a,r,s){e.beginPath(),e.moveTo(t,n),e.arcTo(t+a,n,t+a,n+r,s),e.arcTo(t+a,n+r,t,n+r,s),e.arcTo(t,n+r,t,n,s),e.arcTo(t,n,t+a,n,s),e.closePath()}static _getAverageRGB(e){const n={r:0,g:0,b:0};let a,r,s=-4;const i={r:0,g:0,b:0};let l=0;r=e.naturalHeight||e.height,a=e.naturalWidth||e.width;const u=new De(a,r).getContext("2d");if(!u)return n;u.drawImage(e,0,0);let h;try{h=u.getImageData(0,0,a,r)}catch(b){return n}for(;(s+=5*4)200||h.data[s+1]>200||h.data[s+2]>200||(++l,i.r+=h.data[s],i.g+=h.data[s+1],i.b+=h.data[s+2]);return i.r=~~(i.r/l),i.g=~~(i.g/l),i.b=~~(i.b/l),i}static _drawDot(e,t,n,a,r=0,s=1){e.fillRect((t+r)*a,(n+r)*a,s*a,s*a)}static _drawAlignProtector(e,t,n,a){e.clearRect((t-2)*a,(n-2)*a,5*a,5*a),e.fillRect((t-2)*a,(n-2)*a,5*a,5*a)}static _drawAlign(e,t,n,a,r=0,s=1,i,l){const c=e.fillStyle;e.fillStyle=i,new Array(4).fill(0).map((u,h)=>{V._drawDot(e,t-2+h,n-2,a,r,s),V._drawDot(e,t+2,n-2+h,a,r,s),V._drawDot(e,t+2-h,n+2,a,r,s),V._drawDot(e,t-2,n+2-h,a,r,s)}),V._drawDot(e,t,n,a,r,s),l||(e.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((u,h)=>{V._drawDot(e,t-1+h,n-1,a,r,s),V._drawDot(e,t+1,n-1+h,a,r,s),V._drawDot(e,t+1-h,n+1,a,r,s),V._drawDot(e,t-1,n+1-h,a,r,s)})),e.fillStyle=c}_draw(){var e,t,n,a,r,s,i,l,c,u,h,b,k,S,M,_,p,w,P;return os(this,void 0,void 0,function*(){const v=(e=this.qrCode)===null||e===void 0?void 0:e.moduleCount,x=this.options.size;let y=this.options.margin;(y<0||y*2>=x)&&(y=0);const g=Math.ceil(y),R=x-2*y,E=this.options.whiteMargin,T=this.options.backgroundDimming,f=Math.ceil(R/v),L=f*v,C=L+2*g,O=new De(C,C),A=O.getContext("2d");this._clear(),A.save(),A.translate(g,g);const ge=new De(C,C),J=ge.getContext("2d");let he=null,ue=[];if(this.options.gifBackground){const B=Nr(this.options.gifBackground);if(he=B,ue=jr(B,!0),this.options.autoColor){let F=0,D=0,z=0,le=0;for(let W=0;W200||ee[1]>200||ee[2]>200||ee[0]===0&&ee[1]===0&&ee[2]===0||(le++,F+=ee[0],D+=ee[1],z+=ee[2])}F=~~(F/le),D=~~(D/le),z=~~(z/le),this.options.colorDark=`rgb(${F},${D},${z})`}}else if(this.options.backgroundImage){const B=yield cn(this.options.backgroundImage);if(this.options.autoColor){const F=V._getAverageRGB(B);this.options.colorDark=`rgb(${F.r},${F.g},${F.b})`}J.drawImage(B,0,0,B.width,B.height,0,0,C,C),J.rect(0,0,C,C),J.fillStyle=T,J.fill()}else J.rect(0,0,C,C),J.fillStyle=this.options.colorLight,J.fill();const Q=G.getPatternPosition(this.qrCode.typeNumber),se=((n=(t=this.options.components)===null||t===void 0?void 0:t.data)===null||n===void 0?void 0:n.scale)||vt,Ae=(1-se)*.5;for(let B=0;B=v-8)||F>=v-8&&B<8,le=B==6&&F>=8&&F<=v-8||F==6&&B>=8&&B<=v-8;let W=z||le;for(let te=1;te=Q[te]-2&&B<=Q[te]+2&&F>=Q[te]-2&&F<=Q[te]+2;const ee=F*f+(W?0:Ae*f),pe=B*f+(W?0:Ae*f);if(A.strokeStyle=D?this.options.colorDark:this.options.colorLight,A.lineWidth=.5,A.fillStyle=D?this.options.colorDark:this.options.colorLight,Q.length===0)W||A.fillRect(ee,pe,(W?1:se)*f,(W?1:se)*f);else{const te=F=v-4-5&&B=v-4-5;!W&&!te&&A.fillRect(ee,pe,(W?1:se)*f,(W?1:se)*f)}}const ie=Q[Q.length-1],Ue=this.options.colorLight;if(A.fillStyle=Ue,A.fillRect(0,0,8*f,8*f),A.fillRect(0,(v-8)*f,8*f,8*f),A.fillRect((v-8)*f,0,8*f,8*f),!((r=(a=this.options.components)===null||a===void 0?void 0:a.timing)===null||r===void 0)&&r.protectors&&(A.fillRect(8*f,6*f,(v-8-8)*f,f),A.fillRect(6*f,8*f,f,(v-8-8)*f)),!((i=(s=this.options.components)===null||s===void 0?void 0:s.cornerAlignment)===null||i===void 0)&&i.protectors&&V._drawAlignProtector(A,ie,ie,f),!((c=(l=this.options.components)===null||l===void 0?void 0:l.alignment)===null||c===void 0)&&c.protectors)for(let B=0;B=1)&&(F=.2),D<0&&(D=0),z<0&&(z=0);const le=L*F,W=.5*(C-le),ee=W;A.restore(),A.fillStyle=this.options.logoBackgroundColor,A.save(),V._prepareRoundedCornerClip(A,W-D,ee-D,le+2*D,le+2*D,z+D),A.clip();const pe=A.globalCompositeOperation;A.globalCompositeOperation="destination-out",A.fill(),A.globalCompositeOperation=pe,A.restore(),A.save(),V._prepareRoundedCornerClip(A,W,ee,le,le,z),A.clip(),A.drawImage(B,W,ee,le,le),A.restore(),A.save(),A.translate(g,g)}if(he){let B,F,D,z,le,W;if(ue.forEach(function(ee){B||(B=new Y(x,x),B.setDelay(ee.delay),B.setRepeat(0));const{width:pe,height:te}=ee.dims;F||(F=new De(pe,te),D=F.getContext("2d"),D.rect(0,0,F.width,F.height),D.fillStyle="#ffffff",D.fill()),(!z||!W||pe!==z.width||te!==z.height)&&(z=new De(pe,te),le=z.getContext("2d"),W=le.createImageData(pe,te)),W.data.set(ee.patch),le.putImageData(W,0,0),D.drawImage(z.getContext("2d").canvas,ee.dims.left,ee.dims.top);const qe=new De(C,C),He=qe.getContext("2d");He.drawImage(F.getContext("2d").canvas,0,0,C,C),He.rect(0,0,C,C),He.fillStyle=T,He.fill(),He.drawImage(O.getContext("2d").canvas,0,0,C,C);const Ye=new De(x,x),$e=Ye.getContext("2d");$e.drawImage(qe.getContext("2d").canvas,0,0,x,x),B.addFrame($e.getImageData(0,0,Ye.width,Ye.height).data)}),!B)throw new Error("No frames.");if(B.finish(),un(this.canvas)){const pe=B.stream().toFlattenUint8Array().reduce((te,qe)=>te+String.fromCharCode(qe),"");return Promise.resolve(`data:image/gif;base64,${window.btoa(pe)}`)}return Promise.resolve(Buffer.from(B.stream().toFlattenUint8Array()))}else{J.drawImage(O.getContext("2d").canvas,0,0,C,C),A.drawImage(ge.getContext("2d").canvas,-g,-g,C,C);const B=new De(x,x);B.getContext("2d").drawImage(O.getContext("2d").canvas,0,0,x,x),this.canvas=B;const D=this.options.gifBackground?"gif":"png";return un(this.canvas)?Promise.resolve(this.canvas.toDataURL(D)):Promise.resolve(this.canvas.toBuffer(D))}})}}V.CorrectLevel=ve;V.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}};V.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:ve.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:V.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"};function un(o){try{return o instanceof HTMLElement}catch(e){return typeof o=="object"&&o.nodeType===1&&typeof o.style=="object"&&typeof o.ownerDocument=="object"}}function as(o){return new Promise(e=>{const t=new XMLHttpRequest;t.responseType="blob",t.onload=function(){const n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsArrayBuffer(t.response)},t.open("GET",o),t.send()})}const rs=xe({name:"TheQrCode",props:{text:{type:String,required:!0},qid:{type:String},correctLevel:{type:Number,default:0},size:{type:Number,default:220},margin:{type:Number,default:20},colorDark:{type:String,default:"#000000"},colorLight:{type:String,default:"#FFFFFF"},bgSrc:{type:String,default:void 0},background:{type:String,default:"rgba(0,0,0,0)"},backgroundDimming:{type:String,default:"rgba(0,0,0,0)"},logoSrc:{type:String,default:void 0},logoBackgroundColor:{type:String,default:"rgba(255,255,255,1)"},gifBgSrc:{type:String,default:void 0},logoScale:{type:Number,default:.2},logoMargin:{type:Number,default:0},logoCornerRadius:{type:Number,default:8},whiteMargin:{type:[Boolean,String],default:!0},dotScale:{type:Number,default:1},autoColor:{type:[Boolean,String],default:!0},binarize:{type:[Boolean,String],default:!1},binarizeThreshold:{type:Number,default:128},callback:{type:Function,default:function(){}},bindElement:{type:Boolean,default:!0},backgroundColor:{type:String,default:"#FFFFFF"},components:{default:function(){return{data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}}}}},data(){return{imgUrl:""}},watch:{$props:{deep:!0,handler(){this.main()}}},mounted(){this.main()},methods:{async main(){if(this.gifBgSrc){const t=await as(this.gifBgSrc),n=this.logoSrc;this.render(void 0,n,t);return}const o=this.bgSrc,e=this.logoSrc;this.render(o,e)},async render(o,e,t){console.log(o,e,t),new V({gifBackground:t,text:this.text,size:this.size}).draw().then(n=>{console.log("🚀 ~ dataUri:",n),this.imgUrl=n,this.callback&&this.callback(n,this.qid)})}},render(){return m(vn,null,[this.bindElement&&this.imgUrl&&m("img",{style:"display: inline-block",src:this.imgUrl},null)])}}),ss=xe({name:"school-info",setup(){var k,S,M,_,p,w,P,v,x,y;const o=ct(),e=Ke({areaList:[]}),t=Ke({name:(S=(k=o.info.schoolInfos)==null?void 0:k[0])==null?void 0:S.name,logo:((_=(M=o.info.schoolInfos)==null?void 0:M[0])==null?void 0:_.logo)||o.info.avatar,provinceCode:((w=(p=o.info.schoolInfos)==null?void 0:p[0])==null?void 0:w.provinceCode)||"",cityCode:((v=(P=o.info.schoolInfos)==null?void 0:P[0])==null?void 0:v.cityCode)||"",regionCode:((y=(x=o.info.schoolInfos)==null?void 0:x[0])==null?void 0:y.regionCode)||""}),n=Ke({loading:!1,schoolLoading:!0,dataList:[],disabled:!0,modal:!1,qrModal:!1}),a=()=>[{title:"老师姓名",key:"nickname"},{title:"手机号码",key:"phone"},{title:"性别",key:"questionTypeCode",render:g=>m("div",null,[g.gender?"男":"女"])},{title:"状态",key:"statusName",render:g=>m("div",null,[g.status==="ACTIVATION"?m(de,{text:!0},{default:()=>[g.statusName]}):m(de,{class:we.errorBtn,text:!0},{default:()=>[g.statusName]})])},{title:"操作",key:"titleImg",render:g=>m(Te,null,{default:()=>[m(de,{type:"primary",quaternary:!0,size:"small",onClick:()=>u(g)},{default:()=>[ae("重置密码")]}),g.status==="ACTIVATION"?m(de,{type:"primary",quaternary:!0,size:"small",onClick:()=>c(g)},{default:()=>[ae("冻结")]}):m(de,{class:we.errorBtn,quaternary:!0,size:"small",onClick:()=>c(g)},{default:()=>[ae("解冻")]})]})}],r=async()=>{const g=await Cn();(g==null?void 0:g.code)===200&&(e.areaList=g.data)},s=async()=>{var R,E,T;n.loading=!0;const g=await Na({schoolId:(E=(R=o.info.schoolInfos)==null?void 0:R[0])==null?void 0:E.id,page:1,rows:1e3});n.loading=!1,(g==null?void 0:g.code)===200&&Array.isArray((T=g==null?void 0:g.data)==null?void 0:T.rows)&&(n.dataList=g.data.rows)};mn(()=>{r(),s()});const i=Wo(),l=Ct(),c=g=>{const R=g.status==="LOCKED"?"解冻":"冻结";i.warning({title:"温馨提示",content:`是否${R}"${g.nickname}"?`,positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{await Ka({ids:[g.id],status:g.status==="LOCKED"?"ACTIVATION":"LOCKED"}),s(),l.success(R+"成功")}})},u=g=>{i.warning({title:"警告",content:`重置"${g.nickname}"的密码,是否继续?`,positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{await ja({userId:g.id,password:"ktyq"+g.phone.substr(7),clientType:"TEACHER"}),l.success("重置成功")}})},h=async()=>{var g;n.schoolLoading=!1,await Ua({...(g=o.info.schoolInfos)==null?void 0:g[0],...t}),n.schoolLoading=!0,l.success("修改成功"),n.disabled=!0},b=()=>{var E,T,f,L,C,O;const g=`tenantId=${(T=(E=o.info.schoolInfos)==null?void 0:E[0])==null?void 0:T.tenantId}&schoolId=${(L=(f=o.info.schoolInfos)==null?void 0:f[0])==null?void 0:L.id}&schoolName=${(O=(C=o.info.schoolInfos)==null?void 0:C[0])==null?void 0:O.name}`,R=`${location.origin}/classroom-app/#/teaher-register?`+g;return console.log(R),R};return()=>m("div",{class:we.schoolInfo},[m(Te,{wrapItem:!1,align:"center"},{default:()=>[m("div",{class:we.logo},[m(bt,{previewDisabled:!1,width:100,height:100,src:t.logo},null),m("div",{style:{display:n.disabled?"none":""},class:we.changeHead},[ae("修改头像"),n.schoolLoading&&m(wn,{class:[we.uploadFile],cropper:!0,"onUpdate:fileList":g=>{t.logo=g}},null)])]),m(xt,{model:t,style:{paddingTop:"30px"},disabled:n.disabled},{default:()=>[m(Te,null,{default:()=>[m(Ce,{label:"学校名称",path:"name",showRequireMark:!1,rule:[{required:!0,message:"请填写学习名称",trigger:"blur"}]},{default:()=>[m(je,{class:we.input,maxlength:20,value:t.name,"onUpdate:value":g=>t.name=g},null)]}),m(Ce,{label:"城区",style:{width:"300px"}},{default:()=>{var g,R,E,T;return[m(yn,{options:e.areaList,labelField:"name",valueField:"code",childrenField:"areas",checkStrategy:"child",expandTrigger:"hover",defaultValue:((R=(g=o.info.schoolInfos)==null?void 0:g[0])==null?void 0:R.regionCode)||((T=(E=o.info.schoolInfos)==null?void 0:E[0])==null?void 0:T.cityCode),"onUpdate:value":(f,L,C)=>{var O,A,ge;t.provinceCode=(O=C[0])==null?void 0:O.code,t.cityCode=(A=C[1])==null?void 0:A.code,t.regionCode=(ge=C[2])==null?void 0:ge.code}},null)]}}),m(Ce,null,{default:()=>[n.disabled?m(Te,{class:we.btnList,align:"center",justify:"end"},{default:()=>[m(de,{class:we.btn,color:"#f24433",onClick:()=>n.disabled=!1},{default:()=>[ae("修改信息")]})]}):m(Te,{class:we.btnList,align:"center",justify:"end"},{default:()=>[m(de,{class:we.btn,onClick:()=>n.disabled=!0},{default:()=>[ae("取消")]}),m(de,{class:we.btn,loading:!n.schoolLoading,type:"primary",onClick:()=>h()},{default:()=>[ae("完成")]})]})]})]})]})]}),m(Te,{style:{padding:"32px 0"}},{default:()=>[m(de,{type:"primary",renderIcon:()=>m(Xo,{component:m(nr,null,null)},null),onClick:()=>n.modal=!0},{default:()=>[ae("添加老师")]}),m(de,{type:"primary",onClick:()=>n.qrModal=!0},{default:()=>[ae("老师注册二维码")]})]}),m(Zo,{loading:n.loading,columns:a(),data:n.dataList},null),m(_t,{class:we.addTeacher,show:n.modal,"onUpdate:show":g=>n.modal=g,title:"添加老师",preset:"dialog",showIcon:!1},{default:()=>[m(or,{onClose:()=>{n.modal=!1,s()}},null)]}),m(_t,{show:n.qrModal,"onUpdate:show":g=>n.qrModal=g,title:"二维码",preset:"dialog",showIcon:!1},{default:()=>[m("div",{style:{textAlign:"center"}},[m(rs,{text:b(),size:300},null)])]})])}}),hs=xe({name:"base-setting",setup(o,{emit:e,attrs:t}){const n=Z("person"),a=ct();return()=>m("div",{class:$.listWrap},[m(Yo,{class:$.customTabs,value:n.value,"onUpdate:value":r=>n.value=r,size:"large",animated:!0,"pane-wrapper-style":"margin: 0 -4px","pane-style":"padding-left: 4px; padding-right: 4px; box-sizing: border-box;"},{default:()=>[m(Jt,{name:"person",tab:"个人信息"},{default:()=>[m(za,null,null)]}),a.info.isSuperAdmin&&m(Jt,{name:"school",tab:"学校设置"},{default:()=>[m(ss,null,null)]})]})])}});export{hs as default};