From 01d01534e24b0292f0428438e299b7faa1ac3119 Mon Sep 17 00:00:00 2001 From: Harry-zklcdc Date: Sat, 11 May 2024 06:48:49 +0000 Subject: [PATCH] =?UTF-8?q?[Upgrade]=20=F0=9F=9A=80=20Upload=20latest=20we?= =?UTF-8?q?bFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-9e3b8a3c.js => index-15721328.js} | 20 +++++++++---------- .../{index-e269ea96.js => index-955202b1.js} | 2 +- web/index.html | 2 +- web/js/bing/chat/config.js | 2 +- web/sw.js | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename web/assets/{index-9e3b8a3c.js => index-15721328.js} (82%) rename web/assets/{index-e269ea96.js => index-955202b1.js} (99%) diff --git a/web/assets/index-9e3b8a3c.js b/web/assets/index-15721328.js similarity index 82% rename from web/assets/index-9e3b8a3c.js rename to web/assets/index-15721328.js index 08dfd30f48..aa2f09ac7a 100644 --- a/web/assets/index-9e3b8a3c.js +++ b/web/assets/index-15721328.js @@ -1,4 +1,4 @@ -import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUnmount,r as ref,a as onMounted,b as isBrowser,c as computed,d as reactive,h as hasInstance,e as onBeforeMount,f as off,j as readonly,k as on,l as createInjectionKey,m as modalBodyInjectionKey,n as drawerBodyInjectionKey,p as popoverBodyInjectionKey,u as useMemo,q as defineComponent,s as provide,t as getSlot$1,x as withDirectives,y as getFirstVNode,C as CssRender,z as useSsrAdapter,A as toRef,B as isMounted,D as h,L as LazyTeleport,E as zindexable,F as nextTick,G as onActivated,H as onDeactivated,I as depx,V as VResizeObserver,J as mergeProps,K as pxfy,M as renderSlot,N as resizeObserverManager,O as getNative,P as root,Q as overArg,R as isPrototype,S as isArrayLike,T as arrayLikeKeys,U as isArray,W as isSymbol,X as MapCache,Y as toString,Z as toSource,_ as baseGetTag,$ as Map$1,a0 as Symbol$1,a1 as eq,a2 as Uint8Array,a3 as isBuffer,a4 as Stack,a5 as isTypedArray,a6 as isObjectLike,a7 as isObject,a8 as isLength,a9 as isIndex,aa as isArguments,ab as identity,ac as baseFor,ad as arrayMap,ae as configProviderInjectionKey,af as replaceable,ag as cB,ah as cE,ai as c$1,aj as useConfig,ak as useTheme,al as useThemeClass,am as NBaseIcon,an as emptyLight,ao as createKey,ap as render,aq as Transition,ar as cM,as as cNotM,at as fadeInScaleUpTransition,au as useRtl,av as internalSelectMenuLight,aw as resolveWrappedSlot,ax as NBaseLoading,ay as NScrollbar,az as resolveSlot,aA as getMargin,aB as cCB,aC as watchEffect,aD as popoverLight,aE as clickoutside,aF as getPreciseEventTarget,aG as isSlotEmpty,aH as FocusTrap,aI as Fragment,aJ as XScrollbar,aK as getFirstSlotVNode,aL as cloneVNode,aM as Text,aN as keep,aO as call,aP as NBaseClose,aQ as tagLight,aR as color2Class,aS as iconSwitchTransition,aT as useStyle,aU as NIconSwitchTransition,aV as internalSelectionLight,aW as Wrapper,aX as fadeInHeightExpandTransition,aY as NFadeInExpandTransition,aZ as ErrorIcon,a_ as WarningIcon,a$ as InfoIcon,b0 as SuccessIcon,b1 as alertLight,b2 as resolveSlotWithProps,b3 as isSafari,b4 as useFormItem,b5 as inputLight,b6 as isBrowser$1,b7 as markEventEffectPerformed,b8 as selectLight,b9 as tooltipLight,ba as useMergedClsPrefix,bb as ellipsisLight,bc as radioLight,bd as flatten$1,be as warn,bf as iconLight,bg as dropdownLight,bh as dialogApiInjectionKey,bi as throwError,bj as Comment,bk as spaceLight,bl as getGap,bm as formLight,bn as keysOf,bo as commonVariables,bp as createId,bq as formItemInjectionKey,br as fadeInTransition,bs as imageLight,bt as normalizeStyle,bu as XButton,bv as inputNumberLight,bw as rgba,bx as insideModal,by as insidePopover,bz as listLight,bA as messageApiInjectionKey,bB as progressLight,bC as resultLight,bD as spinLight,bE as switchLight,bF as tableLight,bG as thingLight,bH as typographyLight,bI as NButton,bJ as Teleport,bK as uploadLight,bL as defineStore,bM as openBlock,bN as createElementBlock,bO as toDisplayString,bP as createBlock,bQ as withCtx,bR as createBaseVNode,bS as createVNode,bT as withKeys,bU as unref,bV as createTextVNode,bW as NModal,bX as storeToRefs,bY as useUserStore,bZ as useOsTheme,b_ as isMobile,b$ as renderList,c0 as isRef,c1 as render$1,c2 as NConfigProvider,c3 as lightTheme,c4 as darkTheme,c5 as createCommentVNode,c6 as normalizeClass,c7 as pushScopeId,c8 as popScopeId,c9 as ApiResultCode}from"./index-e269ea96.js";let onceCbs=[];const paramsMap=new WeakMap;function flushOnceCallbacks(){onceCbs.forEach(e=>e(...paramsMap.get(e))),onceCbs=[]}function beforeNextFrameOnce(e,...t){paramsMap.set(e,t),!onceCbs.includes(e)&&onceCbs.push(e)===1&&requestAnimationFrame(flushOnceCallbacks)}function happensIn(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function parseResponsiveProp(e){if(typeof e=="number")return{"":e.toString()};const t={};return e.split(/ +/).forEach(n=>{if(n==="")return;const[o,r]=n.split(":");r===void 0?t[""]=o:t[o]=r}),t}function parseResponsivePropValue(e,t){var n;if(e==null)return;const o=parseResponsiveProp(e);if(t===void 0)return o[""];if(typeof t=="string")return(n=o[t])!==null&&n!==void 0?n:o[""];if(Array.isArray(t)){for(let r=t.length-1;r>=0;--r){const i=t[r];if(i in o)return o[i]}return o[""]}else{let r,i=-1;return Object.keys(o).forEach(a=>{const l=Number(a);!Number.isNaN(l)&&t>=l&&l>=i&&(i=l,r=o[a])}),r}}function getSlot(e,t="default",n=[]){const r=e.$slots[t];return r===void 0?n:r()}function getTitleAttribute(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function createRefSetter(e){return t=>{t?e.value=t.$el:e.value=null}}function mergeEventHandlers(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(o=>{o&&o(n)})}}function isNodeVShowFalse(e){var t;const n=(t=e.dirs)===null||t===void 0?void 0:t.find(({dir:o})=>o===vShow);return!!(n&&n.value===!1)}const pureNumberRegex=/^(\d|\.)+$/,numberRegex=/(\d|\.)+/;function formatLength(e,{c:t=1,offset:n=0,attachPx:o=!0}={}){if(typeof e=="number"){const r=(e+n)*t;return r===0?"0":`${r}px`}else if(typeof e=="string")if(pureNumberRegex.test(e)){const r=(Number(e)+n)*t;return o?r===0?"0":`${r}px`:`${r}`}else{const r=numberRegex.exec(e);return r?e.replace(numberRegex,String((Number(r[0])+n)*t)):e}return e}let _isJsdom;function isJsdom(){return _isJsdom===void 0&&(_isJsdom=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),_isJsdom}function useInjectionInstanceCollection(e,t,n){var o;const r=inject(e,null);if(r===null)return;const i=(o=getCurrentInstance())===null||o===void 0?void 0:o.proxy;watch(n,a),a(n.value),onBeforeUnmount(()=>{a(void 0,n.value)});function a(u,d){if(!r)return;const f=r[t];d!==void 0&&l(f,d),u!==void 0&&s(f,u)}function l(u,d){u[d]||(u[d]=[]),u[d].splice(u[d].findIndex(f=>f===i),1)}function s(u,d){u[d]||(u[d]=[]),~u[d].findIndex(f=>f===i)||u[d].push(i)}}function useDeferredTrue(e,t,n){if(!t)return e;const o=ref(e.value);let r=null;return watch(e,i=>{r!==null&&window.clearTimeout(r),i===!0?n&&!n.value?o.value=!0:r=window.setTimeout(()=>{o.value=!0},t):o.value=!1}),o}let fontsReady,isFontReady;const init=()=>{var e,t;fontsReady=isBrowser?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,isFontReady=!1,fontsReady!==void 0?fontsReady.then(()=>{isFontReady=!0}):isFontReady=!0};init();function onFontsReady(e){if(isFontReady)return;let t=!1;onMounted(()=>{isFontReady||fontsReady==null||fontsReady.then(()=>{t||e()})}),onBeforeUnmount(()=>{t=!0})}function useMergedState(e,t){return watch(e,n=>{n!==void 0&&(t.value=n)}),computed(()=>e.value===void 0?t.value:e.value)}function useCompitable(e,t){return computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const defaultBreakpointOptions={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function createMediaQuery(e){return`(min-width: ${e}px)`}const mqlMap={};function useBreakpoints(e=defaultBreakpointOptions){if(!isBrowser)return computed(()=>[]);if(typeof window.matchMedia!="function")return computed(()=>[]);const t=ref({}),n=Object.keys(e),o=(r,i)=>{r.matches?t.value[i]=!0:t.value[i]=!1};return n.forEach(r=>{const i=e[r];let a,l;mqlMap[i]===void 0?(a=window.matchMedia(createMediaQuery(i)),a.addEventListener?a.addEventListener("change",s=>{l.forEach(u=>{u(s,r)})}):a.addListener&&a.addListener(s=>{l.forEach(u=>{u(s,r)})}),l=new Set,mqlMap[i]={mql:a,cbs:l}):(a=mqlMap[i].mql,l=mqlMap[i].cbs),l.add(o),a.matches&&l.forEach(s=>{s(a,r)})}),onBeforeUnmount(()=>{n.forEach(r=>{const{cbs:i}=mqlMap[e[r]];i.has(o)&&i.delete(o)})}),computed(()=>{const{value:r}=t;return n.filter(i=>r[i])})}function useKeyboard(e={},t){const n=reactive({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:r}=e,i=s=>{switch(s.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}o!==void 0&&Object.keys(o).forEach(u=>{if(u!==s.key)return;const d=o[u];if(typeof d=="function")d(s);else{const{stop:f=!1,prevent:v=!1}=d;f&&s.stopPropagation(),v&&s.preventDefault(),d.handler(s)}})},a=s=>{switch(s.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}r!==void 0&&Object.keys(r).forEach(u=>{if(u!==s.key)return;const d=r[u];if(typeof d=="function")d(s);else{const{stop:f=!1,prevent:v=!1}=d;f&&s.stopPropagation(),v&&s.preventDefault(),d.handler(s)}})},l=()=>{(t===void 0||t.value)&&(on("keydown",document,i),on("keyup",document,a)),t!==void 0&&watch(t,s=>{s?(on("keydown",document,i),on("keyup",document,a)):(off("keydown",document,i),off("keyup",document,a))})};return hasInstance()?(onBeforeMount(l),onBeforeUnmount(()=>{(t===void 0||t.value)&&(off("keydown",document,i),off("keyup",document,a))})):l(),readonly(n)}const internalSelectionMenuInjectionKey=createInjectionKey("n-internal-select-menu"),internalSelectionMenuBodyInjectionKey=createInjectionKey("n-internal-select-menu-body"),teleportDisabled="__disabled__";function useAdjustedTo(e){const t=inject(modalBodyInjectionKey,null),n=inject(drawerBodyInjectionKey,null),o=inject(popoverBodyInjectionKey,null),r=inject(internalSelectionMenuBodyInjectionKey,null),i=ref();if(typeof document<"u"){i.value=document.fullscreenElement;const a=()=>{i.value=document.fullscreenElement};onMounted(()=>{on("fullscreenchange",document,a)}),onBeforeUnmount(()=>{off("fullscreenchange",document,a)})}return useMemo(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?teleportDisabled:l===!0?i.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:o!=null&&o.value?o.value:r!=null&&r.value?r.value:l??(i.value||"body")})}useAdjustedTo.tdkey=teleportDisabled;useAdjustedTo.propTo={type:[String,Object,Boolean],default:void 0};let viewMeasurer=null;function ensureViewBoundingRect(){if(viewMeasurer===null&&(viewMeasurer=document.getElementById("v-binder-view-measurer"),viewMeasurer===null)){viewMeasurer=document.createElement("div"),viewMeasurer.id="v-binder-view-measurer";const{style:e}=viewMeasurer;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(viewMeasurer)}return viewMeasurer.getBoundingClientRect()}function getPointRect(e,t){const n=ensureViewBoundingRect();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function getRect(e){const t=e.getBoundingClientRect(),n=ensureViewBoundingRect();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function getParentNode(e){return e.nodeType===9?null:e.parentNode}function getScrollParent(e){if(e===null)return null;const t=getParentNode(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:o,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+r+o))return t}return getScrollParent(t)}const Binder=defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;provide("VBinder",(t=getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=inject("VBinder",null),o=ref(null),r=b=>{o.value=b,n&&e.syncTargetWithParent&&n.setTargetRef(b)};let i=[];const a=()=>{let b=o.value;for(;b=getScrollParent(b),b!==null;)i.push(b);for(const x of i)on("scroll",x,f,!0)},l=()=>{for(const b of i)off("scroll",b,f,!0);i=[]},s=new Set,u=b=>{s.size===0&&a(),s.has(b)||s.add(b)},d=b=>{s.has(b)&&s.delete(b),s.size===0&&l()},f=()=>{beforeNextFrameOnce(v)},v=()=>{s.forEach(b=>b())},g=new Set,p=b=>{g.size===0&&on("resize",window,C),g.has(b)||g.add(b)},m=b=>{g.has(b)&&g.delete(b),g.size===0&&off("resize",window,C)},C=()=>{g.forEach(b=>b())};return onBeforeUnmount(()=>{off("resize",window,C),l()}),{targetRef:o,setTargetRef:r,addScrollListener:u,removeScrollListener:d,addResizeListener:p,removeResizeListener:m}},render(){return getSlot$1("binder",this.$slots)}}),VBinder=Binder,VTarget=defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?withDirectives(getFirstVNode("follower",this.$slots),[[t]]):getFirstVNode("follower",this.$slots)}}),ctxKey="@@mmoContext",mousemoveoutside={mounted(e,{value:t}){e[ctxKey]={handler:void 0},typeof t=="function"&&(e[ctxKey].handler=t,on("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[ctxKey];typeof t=="function"?n.handler?n.handler!==t&&(off("mousemoveoutside",e,n.handler),n.handler=t,on("mousemoveoutside",e,t)):(e[ctxKey].handler=t,on("mousemoveoutside",e,t)):n.handler&&(off("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[ctxKey];t&&off("mousemoveoutside",e,t),e[ctxKey].handler=void 0}},mousemoveoutside$1=mousemoveoutside,{c}=CssRender(),cssrAnchorMetaName="vueuc-style";function lowBit(e){return e&-e}class FinweckTree{constructor(t,n){this.l=t,this.min=n;const o=new Array(t+1);for(let r=0;rr)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let i=t*o;for(;t>0;)i+=n[t],t-=lowBit(t);return i}getBound(t){let n=0,o=this.l;for(;o>n;){const r=Math.floor((n+o)/2),i=this.sum(r);if(i>t){o=r;continue}else if(i{let C=0,b=0;const x=n[g]-t[p]-t[g];return x>0&&o&&(m?b=keepOffsetDirection[p]?x:-x:C=keepOffsetDirection[p]?x:-x),{left:C,top:b}},f=a==="left"||a==="right";if(s!=="center"){const g=oppositeAlignCssPositionProps[e],p=oppositionPositions[g],m=propToCompare[g];if(n[m]>t[m]){if(t[g]+t[m]t[p]&&(s=oppositeAligns[l])}else{const g=a==="bottom"||a==="top"?"left":"top",p=oppositionPositions[g],m=propToCompare[g],C=(n[m]-t[m])/2;(t[g]t[p]?(s=cssPositionToOppositeAlign[g],u=d(m,g,f)):(s=cssPositionToOppositeAlign[p],u=d(m,p,f)))}let v=a;return t[a] *",{pointerEvents:"all"})])]),VFollower=defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=inject("VBinder"),n=useMemo(()=>e.enabled!==void 0?e.enabled:e.show),o=ref(null),r=ref(null),i=()=>{const{syncTrigger:v}=e;v.includes("scroll")&&t.addScrollListener(s),v.includes("resize")&&t.addResizeListener(s)},a=()=>{t.removeScrollListener(s),t.removeResizeListener(s)};onMounted(()=>{n.value&&(s(),i())});const l=useSsrAdapter();style$t.mount({id:"vueuc/binder",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:l}),onBeforeUnmount(()=>{a()}),onFontsReady(()=>{n.value&&s()});const s=()=>{if(!n.value)return;const v=o.value;if(v===null)return;const g=t.targetRef,{x:p,y:m,overlap:C}=e,b=p!==void 0&&m!==void 0?getPointRect(p,m):getRect(g);v.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),v.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:x,minWidth:S,placement:w,internalShift:y,flip:R}=e;v.setAttribute("v-placement",w),C?v.setAttribute("v-overlap",""):v.removeAttribute("v-overlap");const{style:k}=v;x==="target"?k.width=`${b.width}px`:x!==void 0?k.width=x:k.width="",S==="target"?k.minWidth=`${b.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const B=getRect(v),T=getRect(r.value),{left:M,top:E,placement:$}=getPlacementAndOffsetOfFollower(w,b,B,y,R,C),_=getProperTransformOrigin($,C),{left:O,top:N,transform:D}=getOffset($,T,b,E,M,C);v.setAttribute("v-placement",$),v.style.setProperty("--v-offset-left",`${Math.round(M)}px`),v.style.setProperty("--v-offset-top",`${Math.round(E)}px`),v.style.transform=`translateX(${O}) translateY(${N}) ${D}`,v.style.setProperty("--v-transform-origin",_),v.style.transformOrigin=_};watch(n,v=>{v?(i(),u()):a()});const u=()=>{nextTick().then(s).catch(v=>console.error(v))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(v=>{watch(toRef(e,v),s)}),["teleportDisabled"].forEach(v=>{watch(toRef(e,v),u)}),watch(toRef(e,"syncTrigger"),v=>{v.includes("resize")?t.addResizeListener(s):t.removeResizeListener(s),v.includes("scroll")?t.addScrollListener(s):t.removeScrollListener(s)});const d=isMounted(),f=useMemo(()=>{const{to:v}=e;if(v!==void 0)return v;d.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:r,followerRef:o,mergedTo:f,syncPosition:s}},render(){return h(LazyTeleport,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?withDirectives(n,[[zindexable,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});let maybeTouch;function ensureMaybeTouch(){return typeof document>"u"?!1:(maybeTouch===void 0&&("matchMedia"in window?maybeTouch=window.matchMedia("(pointer:coarse)").matches:maybeTouch=!1),maybeTouch)}let wheelScale;function ensureWheelScale(){return typeof document>"u"?1:(wheelScale===void 0&&(wheelScale="chrome"in window?window.devicePixelRatio:1),wheelScale)}const styles=c(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[c("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[c("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),VVirtualList=defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=useSsrAdapter();styles.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:t}),onMounted(()=>{const{defaultScrollIndex:E,defaultScrollKey:$}=e;E!=null?p({index:E}):$!=null&&p({key:$})});let n=!1,o=!1;onActivated(()=>{if(n=!1,!o){o=!0;return}p({top:f.value,left:d})}),onDeactivated(()=>{n=!0,o||(o=!0)});const r=computed(()=>{const E=new Map,{keyField:$}=e;return e.items.forEach((_,O)=>{E.set(_[$],O)}),E}),i=ref(null),a=ref(void 0),l=new Map,s=computed(()=>{const{items:E,itemSize:$,keyField:_}=e,O=new FinweckTree(E.length,$);return E.forEach((N,D)=>{const F=N[_],j=l.get(F);j!==void 0&&O.add(D,j)}),O}),u=ref(0);let d=0;const f=ref(0),v=useMemo(()=>Math.max(s.value.getBound(f.value-depx(e.paddingTop))-1,0)),g=computed(()=>{const{value:E}=a;if(E===void 0)return[];const{items:$,itemSize:_}=e,O=v.value,N=Math.min(O+Math.ceil(E/_+1),$.length-1),D=[];for(let F=O;F<=N;++F)D.push($[F]);return D}),p=(E,$)=>{if(typeof E=="number"){x(E,$,"auto");return}const{left:_,top:O,index:N,key:D,position:F,behavior:j,debounce:J=!0}=E;if(_!==void 0||O!==void 0)x(_,O,j);else if(N!==void 0)b(N,j,J);else if(D!==void 0){const Q=r.value.get(D);Q!==void 0&&b(Q,j,J)}else F==="bottom"?x(0,Number.MAX_SAFE_INTEGER,j):F==="top"&&x(0,0,j)};let m,C=null;function b(E,$,_){const{value:O}=s,N=O.sum(E)+depx(e.paddingTop);if(!_)i.value.scrollTo({left:0,top:N,behavior:$});else{m=E,C!==null&&window.clearTimeout(C),C=window.setTimeout(()=>{m=void 0,C=null},16);const{scrollTop:D,offsetHeight:F}=i.value;if(N>D){const j=O.get(E);N+j<=D+F||i.value.scrollTo({left:0,top:N+j-F,behavior:$})}else i.value.scrollTo({left:0,top:N,behavior:$})}}function x(E,$,_){i.value.scrollTo({left:E,top:$,behavior:_})}function S(E,$){var _,O,N;if(n||e.ignoreItemResize||M($.target))return;const{value:D}=s,F=r.value.get(E),j=D.get(F),J=(N=(O=(_=$.borderBoxSize)===null||_===void 0?void 0:_[0])===null||O===void 0?void 0:O.blockSize)!==null&&N!==void 0?N:$.contentRect.height;if(J===j)return;J-e.itemSize===0?l.delete(E):l.set(E,J-e.itemSize);const re=J-j;if(re===0)return;D.add(F,re);const L=i.value;if(L!=null){if(m===void 0){const W=D.sum(F);L.scrollTop>W&&L.scrollBy(0,re)}else if(FL.scrollTop+L.offsetHeight&&L.scrollBy(0,re)}T()}u.value++}const w=!ensureMaybeTouch();let y=!1;function R(E){var $;($=e.onScroll)===null||$===void 0||$.call(e,E),(!w||!y)&&T()}function k(E){var $;if(($=e.onWheel)===null||$===void 0||$.call(e,E),w){const _=i.value;if(_!=null){if(E.deltaX===0&&(_.scrollTop===0&&E.deltaY<=0||_.scrollTop+_.offsetHeight>=_.scrollHeight&&E.deltaY>=0))return;E.preventDefault(),_.scrollTop+=E.deltaY/ensureWheelScale(),_.scrollLeft+=E.deltaX/ensureWheelScale(),T(),y=!0,beforeNextFrameOnce(()=>{y=!1})}}}function B(E){if(n||M(E.target)||E.contentRect.height===a.value)return;a.value=E.contentRect.height;const{onResize:$}=e;$!==void 0&&$(E)}function T(){const{value:E}=i;E!=null&&(f.value=E.scrollTop,d=E.scrollLeft)}function M(E){let $=E;for(;$!==null;){if($.style.display==="none")return!0;$=$.parentElement}return!1}return{listHeight:a,listStyle:{overflow:"auto"},keyToIndex:r,itemsStyle:computed(()=>{const{itemResizable:E}=e,$=pxfy(s.value.sum());return u.value,[e.itemsStyle,{boxSizing:"content-box",height:E?"":$,minHeight:E?$:"",paddingTop:pxfy(e.paddingTop),paddingBottom:pxfy(e.paddingBottom)}]}),visibleItemsStyle:computed(()=>(u.value,{transform:`translateY(${pxfy(s.value.sum(v.value))})`})),viewportItems:g,listElRef:i,itemsElRef:ref(null),scrollTo:p,handleListResize:B,handleListScroll:R,handleListWheel:k,handleItemResize:S}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:o}=this;return h(VResizeObserver,{onResize:this.handleListResize},{default:()=>{var r,i;return h("div",mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[h(o,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(a=>{const l=a[t],s=n.get(l),u=this.$slots.default({item:a,index:s})[0];return e?h(VResizeObserver,{key:l,onResize:d=>this.handleItemResize(l,d)},{default:()=>u}):(u.key=l,u)})})]):(i=(r=this.$slots).empty)===null||i===void 0?void 0:i.call(r)])}})}}),hiddenAttr="v-hidden",style$s=c("[v-hidden]",{display:"none!important"}),VOverflow=defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=ref(null),o=ref(null);function r(a){const{value:l}=n,{getCounter:s,getTail:u}=e;let d;if(s!==void 0?d=s():d=o.value,!l||!d)return;d.hasAttribute(hiddenAttr)&&d.removeAttribute(hiddenAttr);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const S of f)S.hasAttribute(hiddenAttr)&&S.removeAttribute(hiddenAttr);const v=l.offsetWidth,g=[],p=t.tail?u==null?void 0:u():null;let m=p?p.offsetWidth:0,C=!1;const b=l.children.length-(t.tail?1:0);for(let S=0;Sv){const{updateCounter:R}=e;for(let k=S;k>=0;--k){const B=b-1-k;R!==void 0?R(B):d.textContent=`${B}`;const T=d.offsetWidth;if(m-=g[k],m+T<=v||k===0){C=!0,S=k-1,p&&(S===-1?(p.style.maxWidth=`${v-T}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:M}=e;M&&M(B);break}}}}const{onUpdateOverflow:x}=e;C?x!==void 0&&x(!0):(x!==void 0&&x(!1),d.setAttribute(hiddenAttr,""))}const i=useSsrAdapter();return style$s.mount({id:"vueuc/overflow",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:i}),onMounted(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:o,sync:r}},render(){const{$slots:e}=this;return nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),h("div",{class:"v-overflow",ref:"selfRef"},[renderSlot(e,"default"),e.counter?e.counter():h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function useOnResize(e,t){t&&(onMounted(()=>{const{value:n}=e;n&&resizeObserverManager.registerHandler(n,t)}),onBeforeUnmount(()=>{const{value:n}=e;n&&resizeObserverManager.unregisterHandler(n)}))}const download=(e,t)=>{if(!e)return;const n=document.createElement("a");n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)};var WeakMap$1=getNative(root,"WeakMap");const WeakMap$2=WeakMap$1;var nativeKeys=overArg(Object.keys,Object);const nativeKeys$1=nativeKeys;var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$1(e);var t=[];for(var n in Object(e))hasOwnProperty$2.call(e,n)&&n!="constructor"&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||isSymbol(e)?!0:reIsPlainProp.test(e)||!reIsDeepProp.test(e)||t!=null&&e in Object(t)}var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(FUNC_ERROR_TEXT);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=e.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(memoize.Cache||MapCache),n}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(o){return n.size===MAX_MEMOIZE_SIZE&&n.clear(),o}),n=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rePropName,function(n,o,r,i){t.push(r?i.replace(reEscapeChar,"$1"):o||n)}),t});const stringToPath$1=stringToPath;function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath$1(toString(e))}var INFINITY=1/0;function toKey(e){if(typeof e=="string"||isSymbol(e))return e;var t=e+"";return t=="0"&&1/e==-INFINITY?"-0":t}function baseGet(e,t){t=castPath(t,e);for(var n=0,o=t.length;e!=null&&nl))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,v=!0,g=n&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(i.set(e,t),i.set(t,e);++f`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"yyyy-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},enUS$1=enUS;function buildFormatLongFn(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,o=e.formats[n]||e.formats[e.defaultWidth];return o}}function buildLocalizeFn(e){return function(t,n){var o=n!=null&&n.context?String(n.context):"standalone",r;if(o==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;r=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}function buildMatchFn(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var a=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?findIndex(l,function(f){return f.test(a)}):findKey(l,function(f){return f.test(a)}),u;u=e.valueCallback?e.valueCallback(s):s,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(a.length);return{value:u,rest:d}}}function findKey(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function findIndex(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},o=t.match(e.matchPattern);if(!o)return null;var r=o[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;var l=t.slice(r.length);return{value:a,rest:l}}}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=function(t,n,o){var r,i=formatDistanceLocale[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};const formatDistance$1=formatDistance;var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})};const formatLong$1=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=function(t,n,o,r){return formatRelativeLocale[t]};const formatRelative$1=formatRelative;var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=function(t,n){var o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};const localize$1=localize;var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(t){return parseInt(t,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})};const match$1=match;var locale={code:"en-US",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:0,firstWeekContainsDate:1}};const defaultLocale=locale,dateEnUs={name:"en-US",locale:defaultLocale},dateEnUS=dateEnUs;function useLocale(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=inject(configProviderInjectionKey,null)||{},o=computed(()=>{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:enUS$1[e]});return{dateLocaleRef:computed(()=>{var i;return(i=n==null?void 0:n.value)!==null&&i!==void 0?i:dateEnUS}),localeRef:o}}const AddIcon=defineComponent({name:"Add",render(){return h("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),AttachIcon=replaceable("attach",h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},h("g",{fill:"currentColor","fill-rule":"nonzero"},h("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),FinishedIcon=defineComponent({name:"Checkmark",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},h("g",{fill:"none"},h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),ChevronRightIcon=defineComponent({name:"ChevronRight",render(){return h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),EyeIcon=defineComponent({name:"Eye",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),h("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),EyeOffIcon=defineComponent({name:"EyeOff",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),h("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),h("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),h("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),h("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),TrashIcon=replaceable("trash",h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),DownloadIcon=replaceable("download",h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},h("g",{fill:"currentColor","fill-rule":"nonzero"},h("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),EmptyIcon=defineComponent({name:"Empty",render(){return h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),RemoveIcon=defineComponent({name:"Remove",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` +import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUnmount,r as ref,a as onMounted,b as isBrowser,c as computed,d as reactive,h as hasInstance,e as onBeforeMount,f as off,j as readonly,k as on,l as createInjectionKey,m as modalBodyInjectionKey,n as drawerBodyInjectionKey,p as popoverBodyInjectionKey,u as useMemo,q as defineComponent,s as provide,t as getSlot$1,x as withDirectives,y as getFirstVNode,C as CssRender,z as useSsrAdapter,A as toRef,B as isMounted,D as h,L as LazyTeleport,E as zindexable,F as nextTick,G as onActivated,H as onDeactivated,I as depx,V as VResizeObserver,J as mergeProps,K as pxfy,M as renderSlot,N as resizeObserverManager,O as getNative,P as root,Q as overArg,R as isPrototype,S as isArrayLike,T as arrayLikeKeys,U as isArray,W as isSymbol,X as MapCache,Y as toString,Z as toSource,_ as baseGetTag,$ as Map$1,a0 as Symbol$1,a1 as eq,a2 as Uint8Array,a3 as isBuffer,a4 as Stack,a5 as isTypedArray,a6 as isObjectLike,a7 as isObject,a8 as isLength,a9 as isIndex,aa as isArguments,ab as identity,ac as baseFor,ad as arrayMap,ae as configProviderInjectionKey,af as replaceable,ag as cB,ah as cE,ai as c$1,aj as useConfig,ak as useTheme,al as useThemeClass,am as NBaseIcon,an as emptyLight,ao as createKey,ap as render,aq as Transition,ar as cM,as as cNotM,at as fadeInScaleUpTransition,au as useRtl,av as internalSelectMenuLight,aw as resolveWrappedSlot,ax as NBaseLoading,ay as NScrollbar,az as resolveSlot,aA as getMargin,aB as cCB,aC as watchEffect,aD as popoverLight,aE as clickoutside,aF as getPreciseEventTarget,aG as isSlotEmpty,aH as FocusTrap,aI as Fragment,aJ as XScrollbar,aK as getFirstSlotVNode,aL as cloneVNode,aM as Text,aN as keep,aO as call,aP as NBaseClose,aQ as tagLight,aR as color2Class,aS as iconSwitchTransition,aT as useStyle,aU as NIconSwitchTransition,aV as internalSelectionLight,aW as Wrapper,aX as fadeInHeightExpandTransition,aY as NFadeInExpandTransition,aZ as ErrorIcon,a_ as WarningIcon,a$ as InfoIcon,b0 as SuccessIcon,b1 as alertLight,b2 as resolveSlotWithProps,b3 as isSafari,b4 as useFormItem,b5 as inputLight,b6 as isBrowser$1,b7 as markEventEffectPerformed,b8 as selectLight,b9 as tooltipLight,ba as useMergedClsPrefix,bb as ellipsisLight,bc as radioLight,bd as flatten$1,be as warn,bf as iconLight,bg as dropdownLight,bh as dialogApiInjectionKey,bi as throwError,bj as Comment,bk as spaceLight,bl as getGap,bm as formLight,bn as keysOf,bo as commonVariables,bp as createId,bq as formItemInjectionKey,br as fadeInTransition,bs as imageLight,bt as normalizeStyle,bu as XButton,bv as inputNumberLight,bw as rgba,bx as insideModal,by as insidePopover,bz as listLight,bA as messageApiInjectionKey,bB as progressLight,bC as resultLight,bD as spinLight,bE as switchLight,bF as tableLight,bG as thingLight,bH as typographyLight,bI as NButton,bJ as Teleport,bK as uploadLight,bL as defineStore,bM as openBlock,bN as createElementBlock,bO as toDisplayString,bP as createBlock,bQ as withCtx,bR as createBaseVNode,bS as createVNode,bT as withKeys,bU as unref,bV as createTextVNode,bW as NModal,bX as storeToRefs,bY as useUserStore,bZ as useOsTheme,b_ as isMobile,b$ as renderList,c0 as isRef,c1 as render$1,c2 as NConfigProvider,c3 as lightTheme,c4 as darkTheme,c5 as createCommentVNode,c6 as normalizeClass,c7 as pushScopeId,c8 as popScopeId,c9 as ApiResultCode,ca as cookies}from"./index-955202b1.js";let onceCbs=[];const paramsMap=new WeakMap;function flushOnceCallbacks(){onceCbs.forEach(e=>e(...paramsMap.get(e))),onceCbs=[]}function beforeNextFrameOnce(e,...t){paramsMap.set(e,t),!onceCbs.includes(e)&&onceCbs.push(e)===1&&requestAnimationFrame(flushOnceCallbacks)}function happensIn(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function parseResponsiveProp(e){if(typeof e=="number")return{"":e.toString()};const t={};return e.split(/ +/).forEach(n=>{if(n==="")return;const[o,r]=n.split(":");r===void 0?t[""]=o:t[o]=r}),t}function parseResponsivePropValue(e,t){var n;if(e==null)return;const o=parseResponsiveProp(e);if(t===void 0)return o[""];if(typeof t=="string")return(n=o[t])!==null&&n!==void 0?n:o[""];if(Array.isArray(t)){for(let r=t.length-1;r>=0;--r){const i=t[r];if(i in o)return o[i]}return o[""]}else{let r,i=-1;return Object.keys(o).forEach(a=>{const l=Number(a);!Number.isNaN(l)&&t>=l&&l>=i&&(i=l,r=o[a])}),r}}function getSlot(e,t="default",n=[]){const r=e.$slots[t];return r===void 0?n:r()}function getTitleAttribute(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function createRefSetter(e){return t=>{t?e.value=t.$el:e.value=null}}function mergeEventHandlers(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(o=>{o&&o(n)})}}function isNodeVShowFalse(e){var t;const n=(t=e.dirs)===null||t===void 0?void 0:t.find(({dir:o})=>o===vShow);return!!(n&&n.value===!1)}const pureNumberRegex=/^(\d|\.)+$/,numberRegex=/(\d|\.)+/;function formatLength(e,{c:t=1,offset:n=0,attachPx:o=!0}={}){if(typeof e=="number"){const r=(e+n)*t;return r===0?"0":`${r}px`}else if(typeof e=="string")if(pureNumberRegex.test(e)){const r=(Number(e)+n)*t;return o?r===0?"0":`${r}px`:`${r}`}else{const r=numberRegex.exec(e);return r?e.replace(numberRegex,String((Number(r[0])+n)*t)):e}return e}let _isJsdom;function isJsdom(){return _isJsdom===void 0&&(_isJsdom=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),_isJsdom}function useInjectionInstanceCollection(e,t,n){var o;const r=inject(e,null);if(r===null)return;const i=(o=getCurrentInstance())===null||o===void 0?void 0:o.proxy;watch(n,a),a(n.value),onBeforeUnmount(()=>{a(void 0,n.value)});function a(u,d){if(!r)return;const f=r[t];d!==void 0&&l(f,d),u!==void 0&&s(f,u)}function l(u,d){u[d]||(u[d]=[]),u[d].splice(u[d].findIndex(f=>f===i),1)}function s(u,d){u[d]||(u[d]=[]),~u[d].findIndex(f=>f===i)||u[d].push(i)}}function useDeferredTrue(e,t,n){if(!t)return e;const o=ref(e.value);let r=null;return watch(e,i=>{r!==null&&window.clearTimeout(r),i===!0?n&&!n.value?o.value=!0:r=window.setTimeout(()=>{o.value=!0},t):o.value=!1}),o}let fontsReady,isFontReady;const init=()=>{var e,t;fontsReady=isBrowser?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,isFontReady=!1,fontsReady!==void 0?fontsReady.then(()=>{isFontReady=!0}):isFontReady=!0};init();function onFontsReady(e){if(isFontReady)return;let t=!1;onMounted(()=>{isFontReady||fontsReady==null||fontsReady.then(()=>{t||e()})}),onBeforeUnmount(()=>{t=!0})}function useMergedState(e,t){return watch(e,n=>{n!==void 0&&(t.value=n)}),computed(()=>e.value===void 0?t.value:e.value)}function useCompitable(e,t){return computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const defaultBreakpointOptions={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function createMediaQuery(e){return`(min-width: ${e}px)`}const mqlMap={};function useBreakpoints(e=defaultBreakpointOptions){if(!isBrowser)return computed(()=>[]);if(typeof window.matchMedia!="function")return computed(()=>[]);const t=ref({}),n=Object.keys(e),o=(r,i)=>{r.matches?t.value[i]=!0:t.value[i]=!1};return n.forEach(r=>{const i=e[r];let a,l;mqlMap[i]===void 0?(a=window.matchMedia(createMediaQuery(i)),a.addEventListener?a.addEventListener("change",s=>{l.forEach(u=>{u(s,r)})}):a.addListener&&a.addListener(s=>{l.forEach(u=>{u(s,r)})}),l=new Set,mqlMap[i]={mql:a,cbs:l}):(a=mqlMap[i].mql,l=mqlMap[i].cbs),l.add(o),a.matches&&l.forEach(s=>{s(a,r)})}),onBeforeUnmount(()=>{n.forEach(r=>{const{cbs:i}=mqlMap[e[r]];i.has(o)&&i.delete(o)})}),computed(()=>{const{value:r}=t;return n.filter(i=>r[i])})}function useKeyboard(e={},t){const n=reactive({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:r}=e,i=s=>{switch(s.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}o!==void 0&&Object.keys(o).forEach(u=>{if(u!==s.key)return;const d=o[u];if(typeof d=="function")d(s);else{const{stop:f=!1,prevent:v=!1}=d;f&&s.stopPropagation(),v&&s.preventDefault(),d.handler(s)}})},a=s=>{switch(s.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}r!==void 0&&Object.keys(r).forEach(u=>{if(u!==s.key)return;const d=r[u];if(typeof d=="function")d(s);else{const{stop:f=!1,prevent:v=!1}=d;f&&s.stopPropagation(),v&&s.preventDefault(),d.handler(s)}})},l=()=>{(t===void 0||t.value)&&(on("keydown",document,i),on("keyup",document,a)),t!==void 0&&watch(t,s=>{s?(on("keydown",document,i),on("keyup",document,a)):(off("keydown",document,i),off("keyup",document,a))})};return hasInstance()?(onBeforeMount(l),onBeforeUnmount(()=>{(t===void 0||t.value)&&(off("keydown",document,i),off("keyup",document,a))})):l(),readonly(n)}const internalSelectionMenuInjectionKey=createInjectionKey("n-internal-select-menu"),internalSelectionMenuBodyInjectionKey=createInjectionKey("n-internal-select-menu-body"),teleportDisabled="__disabled__";function useAdjustedTo(e){const t=inject(modalBodyInjectionKey,null),n=inject(drawerBodyInjectionKey,null),o=inject(popoverBodyInjectionKey,null),r=inject(internalSelectionMenuBodyInjectionKey,null),i=ref();if(typeof document<"u"){i.value=document.fullscreenElement;const a=()=>{i.value=document.fullscreenElement};onMounted(()=>{on("fullscreenchange",document,a)}),onBeforeUnmount(()=>{off("fullscreenchange",document,a)})}return useMemo(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?teleportDisabled:l===!0?i.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:o!=null&&o.value?o.value:r!=null&&r.value?r.value:l??(i.value||"body")})}useAdjustedTo.tdkey=teleportDisabled;useAdjustedTo.propTo={type:[String,Object,Boolean],default:void 0};let viewMeasurer=null;function ensureViewBoundingRect(){if(viewMeasurer===null&&(viewMeasurer=document.getElementById("v-binder-view-measurer"),viewMeasurer===null)){viewMeasurer=document.createElement("div"),viewMeasurer.id="v-binder-view-measurer";const{style:e}=viewMeasurer;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(viewMeasurer)}return viewMeasurer.getBoundingClientRect()}function getPointRect(e,t){const n=ensureViewBoundingRect();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function getRect(e){const t=e.getBoundingClientRect(),n=ensureViewBoundingRect();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function getParentNode(e){return e.nodeType===9?null:e.parentNode}function getScrollParent(e){if(e===null)return null;const t=getParentNode(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:o,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+r+o))return t}return getScrollParent(t)}const Binder=defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;provide("VBinder",(t=getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=inject("VBinder",null),o=ref(null),r=b=>{o.value=b,n&&e.syncTargetWithParent&&n.setTargetRef(b)};let i=[];const a=()=>{let b=o.value;for(;b=getScrollParent(b),b!==null;)i.push(b);for(const x of i)on("scroll",x,f,!0)},l=()=>{for(const b of i)off("scroll",b,f,!0);i=[]},s=new Set,u=b=>{s.size===0&&a(),s.has(b)||s.add(b)},d=b=>{s.has(b)&&s.delete(b),s.size===0&&l()},f=()=>{beforeNextFrameOnce(v)},v=()=>{s.forEach(b=>b())},g=new Set,p=b=>{g.size===0&&on("resize",window,C),g.has(b)||g.add(b)},m=b=>{g.has(b)&&g.delete(b),g.size===0&&off("resize",window,C)},C=()=>{g.forEach(b=>b())};return onBeforeUnmount(()=>{off("resize",window,C),l()}),{targetRef:o,setTargetRef:r,addScrollListener:u,removeScrollListener:d,addResizeListener:p,removeResizeListener:m}},render(){return getSlot$1("binder",this.$slots)}}),VBinder=Binder,VTarget=defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?withDirectives(getFirstVNode("follower",this.$slots),[[t]]):getFirstVNode("follower",this.$slots)}}),ctxKey="@@mmoContext",mousemoveoutside={mounted(e,{value:t}){e[ctxKey]={handler:void 0},typeof t=="function"&&(e[ctxKey].handler=t,on("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[ctxKey];typeof t=="function"?n.handler?n.handler!==t&&(off("mousemoveoutside",e,n.handler),n.handler=t,on("mousemoveoutside",e,t)):(e[ctxKey].handler=t,on("mousemoveoutside",e,t)):n.handler&&(off("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[ctxKey];t&&off("mousemoveoutside",e,t),e[ctxKey].handler=void 0}},mousemoveoutside$1=mousemoveoutside,{c}=CssRender(),cssrAnchorMetaName="vueuc-style";function lowBit(e){return e&-e}class FinweckTree{constructor(t,n){this.l=t,this.min=n;const o=new Array(t+1);for(let r=0;rr)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let i=t*o;for(;t>0;)i+=n[t],t-=lowBit(t);return i}getBound(t){let n=0,o=this.l;for(;o>n;){const r=Math.floor((n+o)/2),i=this.sum(r);if(i>t){o=r;continue}else if(i{let C=0,b=0;const x=n[g]-t[p]-t[g];return x>0&&o&&(m?b=keepOffsetDirection[p]?x:-x:C=keepOffsetDirection[p]?x:-x),{left:C,top:b}},f=a==="left"||a==="right";if(s!=="center"){const g=oppositeAlignCssPositionProps[e],p=oppositionPositions[g],m=propToCompare[g];if(n[m]>t[m]){if(t[g]+t[m]t[p]&&(s=oppositeAligns[l])}else{const g=a==="bottom"||a==="top"?"left":"top",p=oppositionPositions[g],m=propToCompare[g],C=(n[m]-t[m])/2;(t[g]t[p]?(s=cssPositionToOppositeAlign[g],u=d(m,g,f)):(s=cssPositionToOppositeAlign[p],u=d(m,p,f)))}let v=a;return t[a] *",{pointerEvents:"all"})])]),VFollower=defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=inject("VBinder"),n=useMemo(()=>e.enabled!==void 0?e.enabled:e.show),o=ref(null),r=ref(null),i=()=>{const{syncTrigger:v}=e;v.includes("scroll")&&t.addScrollListener(s),v.includes("resize")&&t.addResizeListener(s)},a=()=>{t.removeScrollListener(s),t.removeResizeListener(s)};onMounted(()=>{n.value&&(s(),i())});const l=useSsrAdapter();style$t.mount({id:"vueuc/binder",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:l}),onBeforeUnmount(()=>{a()}),onFontsReady(()=>{n.value&&s()});const s=()=>{if(!n.value)return;const v=o.value;if(v===null)return;const g=t.targetRef,{x:p,y:m,overlap:C}=e,b=p!==void 0&&m!==void 0?getPointRect(p,m):getRect(g);v.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),v.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:x,minWidth:S,placement:w,internalShift:y,flip:R}=e;v.setAttribute("v-placement",w),C?v.setAttribute("v-overlap",""):v.removeAttribute("v-overlap");const{style:k}=v;x==="target"?k.width=`${b.width}px`:x!==void 0?k.width=x:k.width="",S==="target"?k.minWidth=`${b.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const B=getRect(v),T=getRect(r.value),{left:M,top:E,placement:$}=getPlacementAndOffsetOfFollower(w,b,B,y,R,C),_=getProperTransformOrigin($,C),{left:O,top:N,transform:D}=getOffset($,T,b,E,M,C);v.setAttribute("v-placement",$),v.style.setProperty("--v-offset-left",`${Math.round(M)}px`),v.style.setProperty("--v-offset-top",`${Math.round(E)}px`),v.style.transform=`translateX(${O}) translateY(${N}) ${D}`,v.style.setProperty("--v-transform-origin",_),v.style.transformOrigin=_};watch(n,v=>{v?(i(),u()):a()});const u=()=>{nextTick().then(s).catch(v=>console.error(v))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(v=>{watch(toRef(e,v),s)}),["teleportDisabled"].forEach(v=>{watch(toRef(e,v),u)}),watch(toRef(e,"syncTrigger"),v=>{v.includes("resize")?t.addResizeListener(s):t.removeResizeListener(s),v.includes("scroll")?t.addScrollListener(s):t.removeScrollListener(s)});const d=isMounted(),f=useMemo(()=>{const{to:v}=e;if(v!==void 0)return v;d.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:r,followerRef:o,mergedTo:f,syncPosition:s}},render(){return h(LazyTeleport,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?withDirectives(n,[[zindexable,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});let maybeTouch;function ensureMaybeTouch(){return typeof document>"u"?!1:(maybeTouch===void 0&&("matchMedia"in window?maybeTouch=window.matchMedia("(pointer:coarse)").matches:maybeTouch=!1),maybeTouch)}let wheelScale;function ensureWheelScale(){return typeof document>"u"?1:(wheelScale===void 0&&(wheelScale="chrome"in window?window.devicePixelRatio:1),wheelScale)}const styles=c(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[c("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[c("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),VVirtualList=defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=useSsrAdapter();styles.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:t}),onMounted(()=>{const{defaultScrollIndex:E,defaultScrollKey:$}=e;E!=null?p({index:E}):$!=null&&p({key:$})});let n=!1,o=!1;onActivated(()=>{if(n=!1,!o){o=!0;return}p({top:f.value,left:d})}),onDeactivated(()=>{n=!0,o||(o=!0)});const r=computed(()=>{const E=new Map,{keyField:$}=e;return e.items.forEach((_,O)=>{E.set(_[$],O)}),E}),i=ref(null),a=ref(void 0),l=new Map,s=computed(()=>{const{items:E,itemSize:$,keyField:_}=e,O=new FinweckTree(E.length,$);return E.forEach((N,D)=>{const F=N[_],j=l.get(F);j!==void 0&&O.add(D,j)}),O}),u=ref(0);let d=0;const f=ref(0),v=useMemo(()=>Math.max(s.value.getBound(f.value-depx(e.paddingTop))-1,0)),g=computed(()=>{const{value:E}=a;if(E===void 0)return[];const{items:$,itemSize:_}=e,O=v.value,N=Math.min(O+Math.ceil(E/_+1),$.length-1),D=[];for(let F=O;F<=N;++F)D.push($[F]);return D}),p=(E,$)=>{if(typeof E=="number"){x(E,$,"auto");return}const{left:_,top:O,index:N,key:D,position:F,behavior:j,debounce:J=!0}=E;if(_!==void 0||O!==void 0)x(_,O,j);else if(N!==void 0)b(N,j,J);else if(D!==void 0){const Q=r.value.get(D);Q!==void 0&&b(Q,j,J)}else F==="bottom"?x(0,Number.MAX_SAFE_INTEGER,j):F==="top"&&x(0,0,j)};let m,C=null;function b(E,$,_){const{value:O}=s,N=O.sum(E)+depx(e.paddingTop);if(!_)i.value.scrollTo({left:0,top:N,behavior:$});else{m=E,C!==null&&window.clearTimeout(C),C=window.setTimeout(()=>{m=void 0,C=null},16);const{scrollTop:D,offsetHeight:F}=i.value;if(N>D){const j=O.get(E);N+j<=D+F||i.value.scrollTo({left:0,top:N+j-F,behavior:$})}else i.value.scrollTo({left:0,top:N,behavior:$})}}function x(E,$,_){i.value.scrollTo({left:E,top:$,behavior:_})}function S(E,$){var _,O,N;if(n||e.ignoreItemResize||M($.target))return;const{value:D}=s,F=r.value.get(E),j=D.get(F),J=(N=(O=(_=$.borderBoxSize)===null||_===void 0?void 0:_[0])===null||O===void 0?void 0:O.blockSize)!==null&&N!==void 0?N:$.contentRect.height;if(J===j)return;J-e.itemSize===0?l.delete(E):l.set(E,J-e.itemSize);const re=J-j;if(re===0)return;D.add(F,re);const L=i.value;if(L!=null){if(m===void 0){const W=D.sum(F);L.scrollTop>W&&L.scrollBy(0,re)}else if(FL.scrollTop+L.offsetHeight&&L.scrollBy(0,re)}T()}u.value++}const w=!ensureMaybeTouch();let y=!1;function R(E){var $;($=e.onScroll)===null||$===void 0||$.call(e,E),(!w||!y)&&T()}function k(E){var $;if(($=e.onWheel)===null||$===void 0||$.call(e,E),w){const _=i.value;if(_!=null){if(E.deltaX===0&&(_.scrollTop===0&&E.deltaY<=0||_.scrollTop+_.offsetHeight>=_.scrollHeight&&E.deltaY>=0))return;E.preventDefault(),_.scrollTop+=E.deltaY/ensureWheelScale(),_.scrollLeft+=E.deltaX/ensureWheelScale(),T(),y=!0,beforeNextFrameOnce(()=>{y=!1})}}}function B(E){if(n||M(E.target)||E.contentRect.height===a.value)return;a.value=E.contentRect.height;const{onResize:$}=e;$!==void 0&&$(E)}function T(){const{value:E}=i;E!=null&&(f.value=E.scrollTop,d=E.scrollLeft)}function M(E){let $=E;for(;$!==null;){if($.style.display==="none")return!0;$=$.parentElement}return!1}return{listHeight:a,listStyle:{overflow:"auto"},keyToIndex:r,itemsStyle:computed(()=>{const{itemResizable:E}=e,$=pxfy(s.value.sum());return u.value,[e.itemsStyle,{boxSizing:"content-box",height:E?"":$,minHeight:E?$:"",paddingTop:pxfy(e.paddingTop),paddingBottom:pxfy(e.paddingBottom)}]}),visibleItemsStyle:computed(()=>(u.value,{transform:`translateY(${pxfy(s.value.sum(v.value))})`})),viewportItems:g,listElRef:i,itemsElRef:ref(null),scrollTo:p,handleListResize:B,handleListScroll:R,handleListWheel:k,handleItemResize:S}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:o}=this;return h(VResizeObserver,{onResize:this.handleListResize},{default:()=>{var r,i;return h("div",mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[h(o,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(a=>{const l=a[t],s=n.get(l),u=this.$slots.default({item:a,index:s})[0];return e?h(VResizeObserver,{key:l,onResize:d=>this.handleItemResize(l,d)},{default:()=>u}):(u.key=l,u)})})]):(i=(r=this.$slots).empty)===null||i===void 0?void 0:i.call(r)])}})}}),hiddenAttr="v-hidden",style$s=c("[v-hidden]",{display:"none!important"}),VOverflow=defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=ref(null),o=ref(null);function r(a){const{value:l}=n,{getCounter:s,getTail:u}=e;let d;if(s!==void 0?d=s():d=o.value,!l||!d)return;d.hasAttribute(hiddenAttr)&&d.removeAttribute(hiddenAttr);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const S of f)S.hasAttribute(hiddenAttr)&&S.removeAttribute(hiddenAttr);const v=l.offsetWidth,g=[],p=t.tail?u==null?void 0:u():null;let m=p?p.offsetWidth:0,C=!1;const b=l.children.length-(t.tail?1:0);for(let S=0;Sv){const{updateCounter:R}=e;for(let k=S;k>=0;--k){const B=b-1-k;R!==void 0?R(B):d.textContent=`${B}`;const T=d.offsetWidth;if(m-=g[k],m+T<=v||k===0){C=!0,S=k-1,p&&(S===-1?(p.style.maxWidth=`${v-T}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:M}=e;M&&M(B);break}}}}const{onUpdateOverflow:x}=e;C?x!==void 0&&x(!0):(x!==void 0&&x(!1),d.setAttribute(hiddenAttr,""))}const i=useSsrAdapter();return style$s.mount({id:"vueuc/overflow",head:!0,anchorMetaName:cssrAnchorMetaName,ssr:i}),onMounted(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:o,sync:r}},render(){const{$slots:e}=this;return nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),h("div",{class:"v-overflow",ref:"selfRef"},[renderSlot(e,"default"),e.counter?e.counter():h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function useOnResize(e,t){t&&(onMounted(()=>{const{value:n}=e;n&&resizeObserverManager.registerHandler(n,t)}),onBeforeUnmount(()=>{const{value:n}=e;n&&resizeObserverManager.unregisterHandler(n)}))}const download=(e,t)=>{if(!e)return;const n=document.createElement("a");n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)};var WeakMap$1=getNative(root,"WeakMap");const WeakMap$2=WeakMap$1;var nativeKeys=overArg(Object.keys,Object);const nativeKeys$1=nativeKeys;var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$1(e);var t=[];for(var n in Object(e))hasOwnProperty$2.call(e,n)&&n!="constructor"&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||isSymbol(e)?!0:reIsPlainProp.test(e)||!reIsDeepProp.test(e)||t!=null&&e in Object(t)}var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(FUNC_ERROR_TEXT);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=e.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(memoize.Cache||MapCache),n}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(o){return n.size===MAX_MEMOIZE_SIZE&&n.clear(),o}),n=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rePropName,function(n,o,r,i){t.push(r?i.replace(reEscapeChar,"$1"):o||n)}),t});const stringToPath$1=stringToPath;function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath$1(toString(e))}var INFINITY=1/0;function toKey(e){if(typeof e=="string"||isSymbol(e))return e;var t=e+"";return t=="0"&&1/e==-INFINITY?"-0":t}function baseGet(e,t){t=castPath(t,e);for(var n=0,o=t.length;e!=null&&nl))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,v=!0,g=n&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(i.set(e,t),i.set(t,e);++f`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"yyyy-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},enUS$1=enUS;function buildFormatLongFn(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,o=e.formats[n]||e.formats[e.defaultWidth];return o}}function buildLocalizeFn(e){return function(t,n){var o=n!=null&&n.context?String(n.context):"standalone",r;if(o==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;r=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}function buildMatchFn(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var a=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?findIndex(l,function(f){return f.test(a)}):findKey(l,function(f){return f.test(a)}),u;u=e.valueCallback?e.valueCallback(s):s,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(a.length);return{value:u,rest:d}}}function findKey(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function findIndex(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},o=t.match(e.matchPattern);if(!o)return null;var r=o[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;var l=t.slice(r.length);return{value:a,rest:l}}}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=function(t,n,o){var r,i=formatDistanceLocale[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};const formatDistance$1=formatDistance;var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})};const formatLong$1=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=function(t,n,o,r){return formatRelativeLocale[t]};const formatRelative$1=formatRelative;var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=function(t,n){var o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};const localize$1=localize;var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(t){return parseInt(t,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})};const match$1=match;var locale={code:"en-US",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:0,firstWeekContainsDate:1}};const defaultLocale=locale,dateEnUs={name:"en-US",locale:defaultLocale},dateEnUS=dateEnUs;function useLocale(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=inject(configProviderInjectionKey,null)||{},o=computed(()=>{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:enUS$1[e]});return{dateLocaleRef:computed(()=>{var i;return(i=n==null?void 0:n.value)!==null&&i!==void 0?i:dateEnUS}),localeRef:o}}const AddIcon=defineComponent({name:"Add",render(){return h("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),AttachIcon=replaceable("attach",h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},h("g",{fill:"currentColor","fill-rule":"nonzero"},h("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),FinishedIcon=defineComponent({name:"Checkmark",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},h("g",{fill:"none"},h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),ChevronRightIcon=defineComponent({name:"ChevronRight",render(){return h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),EyeIcon=defineComponent({name:"Eye",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),h("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),EyeOffIcon=defineComponent({name:"EyeOff",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),h("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),h("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),h("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),h("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),TrashIcon=replaceable("trash",h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),h("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),DownloadIcon=replaceable("download",h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},h("g",{fill:"currentColor","fill-rule":"nonzero"},h("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),EmptyIcon=defineComponent({name:"Empty",render(){return h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),RemoveIcon=defineComponent({name:"Remove",render(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` fill: none; stroke: currentColor; stroke-linecap: round; @@ -134,7 +134,7 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn top: calc(50% - 7px); color: var(--n-option-check-color); transition: color .3s var(--n-bezier); - `,[fadeInScaleUpTransition({enterScale:"0.5"})])])]),NInternalSelectMenu=defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},useTheme.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=useConfig(e),o=useRtl("InternalSelectMenu",n,t),r=useTheme("InternalSelectMenu","-internal-select-menu",style$q,internalSelectMenuLight,e,toRef(e,"clsPrefix")),i=ref(null),a=ref(null),l=ref(null),s=computed(()=>e.treeMate.getFlattenedNodes()),u=computed(()=>createIndexGetter(s.value)),d=ref(null);function f(){const{treeMate:L}=e;let W=null;const{value:ee}=e;ee===null?W=L.getFirstAvailableNode():(e.multiple?W=L.getNode((ee||[])[(ee||[]).length-1]):W=L.getNode(ee),(!W||W.disabled)&&(W=L.getFirstAvailableNode())),O(W||null)}function v(){const{value:L}=d;L&&!e.treeMate.getNode(L.key)&&(d.value=null)}let g;watch(()=>e.show,L=>{L?g=watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():v(),nextTick(N)):v()},{immediate:!0}):g==null||g()},{immediate:!0}),onBeforeUnmount(()=>{g==null||g()});const p=computed(()=>depx(r.value.self[createKey("optionHeight",e.size)])),m=computed(()=>getMargin(r.value.self[createKey("padding",e.size)])),C=computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),b=computed(()=>{const L=s.value;return L&&L.length===0});function x(L){const{onToggle:W}=e;W&&W(L)}function S(L){const{onScroll:W}=e;W&&W(L)}function w(L){var W;(W=l.value)===null||W===void 0||W.sync(),S(L)}function y(){var L;(L=l.value)===null||L===void 0||L.sync()}function R(){const{value:L}=d;return L||null}function k(L,W){W.disabled||O(W,!1)}function B(L,W){W.disabled||x(W)}function T(L){var W;happensIn(L,"action")||(W=e.onKeyup)===null||W===void 0||W.call(e,L)}function M(L){var W;happensIn(L,"action")||(W=e.onKeydown)===null||W===void 0||W.call(e,L)}function E(L){var W;(W=e.onMousedown)===null||W===void 0||W.call(e,L),!e.focusable&&L.preventDefault()}function $(){const{value:L}=d;L&&O(L.getNext({loop:!0}),!0)}function _(){const{value:L}=d;L&&O(L.getPrev({loop:!0}),!0)}function O(L,W=!1){d.value=L,W&&N()}function N(){var L,W;const ee=d.value;if(!ee)return;const ie=u.value(ee.key);ie!==null&&(e.virtualScroll?(L=a.value)===null||L===void 0||L.scrollTo({index:ie}):(W=l.value)===null||W===void 0||W.scrollTo({index:ie,elSize:p.value}))}function D(L){var W,ee;!((W=i.value)===null||W===void 0)&&W.contains(L.target)&&((ee=e.onFocus)===null||ee===void 0||ee.call(e,L))}function F(L){var W,ee;!((W=i.value)===null||W===void 0)&&W.contains(L.relatedTarget)||(ee=e.onBlur)===null||ee===void 0||ee.call(e,L)}provide(internalSelectionMenuInjectionKey,{handleOptionMouseEnter:k,handleOptionClick:B,valueSetRef:C,pendingTmNodeRef:d,nodePropsRef:toRef(e,"nodeProps"),showCheckmarkRef:toRef(e,"showCheckmark"),multipleRef:toRef(e,"multiple"),valueRef:toRef(e,"value"),renderLabelRef:toRef(e,"renderLabel"),renderOptionRef:toRef(e,"renderOption"),labelFieldRef:toRef(e,"labelField"),valueFieldRef:toRef(e,"valueField")}),provide(internalSelectionMenuBodyInjectionKey,i),onMounted(()=>{const{value:L}=l;L&&L.sync()});const j=computed(()=>{const{size:L}=e,{common:{cubicBezierEaseInOut:W},self:{height:ee,borderRadius:ie,color:he,groupHeaderTextColor:oe,actionDividerColor:ge,optionTextColorPressed:pe,optionTextColor:Se,optionTextColorDisabled:ve,optionTextColorActive:ae,optionOpacityDisabled:H,optionCheckColor:q,actionTextColor:A,optionColorPending:X,optionColorActive:I,loadingColor:U,loadingSize:Y,optionColorActivePending:ne,[createKey("optionFontSize",L)]:ue,[createKey("optionHeight",L)]:xe,[createKey("optionPadding",L)]:we}}=r.value;return{"--n-height":ee,"--n-action-divider-color":ge,"--n-action-text-color":A,"--n-bezier":W,"--n-border-radius":ie,"--n-color":he,"--n-option-font-size":ue,"--n-group-header-text-color":oe,"--n-option-check-color":q,"--n-option-color-pending":X,"--n-option-color-active":I,"--n-option-color-active-pending":ne,"--n-option-height":xe,"--n-option-opacity-disabled":H,"--n-option-text-color":Se,"--n-option-text-color-active":ae,"--n-option-text-color-disabled":ve,"--n-option-text-color-pressed":pe,"--n-option-padding":we,"--n-option-padding-left":getMargin(we,"left"),"--n-option-padding-right":getMargin(we,"right"),"--n-loading-color":U,"--n-loading-size":Y}}),{inlineThemeDisabled:J}=e,Q=J?useThemeClass("internal-select-menu",computed(()=>e.size[0]),j,e):void 0,re={selfRef:i,next:$,prev:_,getPendingTmNode:R};return useOnResize(i,e.onResize),Object.assign({mergedTheme:r,mergedClsPrefix:t,rtlEnabled:o,virtualListRef:a,scrollbarRef:l,itemSize:p,padding:m,flattenedNodes:s,empty:b,virtualListContainer(){const{value:L}=a;return L==null?void 0:L.listElRef},virtualListContent(){const{value:L}=a;return L==null?void 0:L.itemsElRef},doScroll:S,handleFocusin:D,handleFocusout:F,handleKeyUp:T,handleKeyDown:M,handleMouseDown:E,handleVirtualListResize:y,handleVirtualListScroll:w,cssVars:J?void 0:j,themeClass:Q==null?void 0:Q.themeClass,onRender:Q==null?void 0:Q.onRender},re)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:o,themeClass:r,onRender:i}=this;return i==null||i(),h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,r,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},resolveWrappedSlot(e.header,a=>a&&h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?h("div",{class:`${n}-base-select-menu__loading`},h(NBaseLoading,{clsPrefix:n,strokeWidth:20})):this.empty?h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},resolveSlot(e.empty,()=>[h(NEmpty,{theme:o.peers.Empty,themeOverrides:o.peerOverrides.Empty})])):h(NScrollbar,{ref:"scrollbarRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?h(VVirtualList,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?h(NSelectGroupHeader,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:h(NSelectOption,{clsPrefix:n,key:a.key,tmNode:a})}):h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?h(NSelectGroupHeader,{key:a.key,clsPrefix:n,tmNode:a}):h(NSelectOption,{clsPrefix:n,key:a.key,tmNode:a})))}),resolveWrappedSlot(e.action,a=>a&&[h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),h(FocusDetector,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),oppositePlacement={top:"bottom",bottom:"top",left:"right",right:"left"},arrowSize="var(--n-arrow-height) * 1.414",style$p=c$1([cB("popover",` + `,[fadeInScaleUpTransition({enterScale:"0.5"})])])]),NInternalSelectMenu=defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},useTheme.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=useConfig(e),o=useRtl("InternalSelectMenu",n,t),r=useTheme("InternalSelectMenu","-internal-select-menu",style$q,internalSelectMenuLight,e,toRef(e,"clsPrefix")),i=ref(null),a=ref(null),l=ref(null),s=computed(()=>e.treeMate.getFlattenedNodes()),u=computed(()=>createIndexGetter(s.value)),d=ref(null);function f(){const{treeMate:L}=e;let W=null;const{value:ee}=e;ee===null?W=L.getFirstAvailableNode():(e.multiple?W=L.getNode((ee||[])[(ee||[]).length-1]):W=L.getNode(ee),(!W||W.disabled)&&(W=L.getFirstAvailableNode())),O(W||null)}function v(){const{value:L}=d;L&&!e.treeMate.getNode(L.key)&&(d.value=null)}let g;watch(()=>e.show,L=>{L?g=watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():v(),nextTick(N)):v()},{immediate:!0}):g==null||g()},{immediate:!0}),onBeforeUnmount(()=>{g==null||g()});const p=computed(()=>depx(r.value.self[createKey("optionHeight",e.size)])),m=computed(()=>getMargin(r.value.self[createKey("padding",e.size)])),C=computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),b=computed(()=>{const L=s.value;return L&&L.length===0});function x(L){const{onToggle:W}=e;W&&W(L)}function S(L){const{onScroll:W}=e;W&&W(L)}function w(L){var W;(W=l.value)===null||W===void 0||W.sync(),S(L)}function y(){var L;(L=l.value)===null||L===void 0||L.sync()}function R(){const{value:L}=d;return L||null}function k(L,W){W.disabled||O(W,!1)}function B(L,W){W.disabled||x(W)}function T(L){var W;happensIn(L,"action")||(W=e.onKeyup)===null||W===void 0||W.call(e,L)}function M(L){var W;happensIn(L,"action")||(W=e.onKeydown)===null||W===void 0||W.call(e,L)}function E(L){var W;(W=e.onMousedown)===null||W===void 0||W.call(e,L),!e.focusable&&L.preventDefault()}function $(){const{value:L}=d;L&&O(L.getNext({loop:!0}),!0)}function _(){const{value:L}=d;L&&O(L.getPrev({loop:!0}),!0)}function O(L,W=!1){d.value=L,W&&N()}function N(){var L,W;const ee=d.value;if(!ee)return;const ie=u.value(ee.key);ie!==null&&(e.virtualScroll?(L=a.value)===null||L===void 0||L.scrollTo({index:ie}):(W=l.value)===null||W===void 0||W.scrollTo({index:ie,elSize:p.value}))}function D(L){var W,ee;!((W=i.value)===null||W===void 0)&&W.contains(L.target)&&((ee=e.onFocus)===null||ee===void 0||ee.call(e,L))}function F(L){var W,ee;!((W=i.value)===null||W===void 0)&&W.contains(L.relatedTarget)||(ee=e.onBlur)===null||ee===void 0||ee.call(e,L)}provide(internalSelectionMenuInjectionKey,{handleOptionMouseEnter:k,handleOptionClick:B,valueSetRef:C,pendingTmNodeRef:d,nodePropsRef:toRef(e,"nodeProps"),showCheckmarkRef:toRef(e,"showCheckmark"),multipleRef:toRef(e,"multiple"),valueRef:toRef(e,"value"),renderLabelRef:toRef(e,"renderLabel"),renderOptionRef:toRef(e,"renderOption"),labelFieldRef:toRef(e,"labelField"),valueFieldRef:toRef(e,"valueField")}),provide(internalSelectionMenuBodyInjectionKey,i),onMounted(()=>{const{value:L}=l;L&&L.sync()});const j=computed(()=>{const{size:L}=e,{common:{cubicBezierEaseInOut:W},self:{height:ee,borderRadius:ie,color:he,groupHeaderTextColor:oe,actionDividerColor:ge,optionTextColorPressed:pe,optionTextColor:Se,optionTextColorDisabled:ve,optionTextColorActive:ae,optionOpacityDisabled:H,optionCheckColor:q,actionTextColor:A,optionColorPending:Y,optionColorActive:I,loadingColor:U,loadingSize:G,optionColorActivePending:ne,[createKey("optionFontSize",L)]:se,[createKey("optionHeight",L)]:xe,[createKey("optionPadding",L)]:we}}=r.value;return{"--n-height":ee,"--n-action-divider-color":ge,"--n-action-text-color":A,"--n-bezier":W,"--n-border-radius":ie,"--n-color":he,"--n-option-font-size":se,"--n-group-header-text-color":oe,"--n-option-check-color":q,"--n-option-color-pending":Y,"--n-option-color-active":I,"--n-option-color-active-pending":ne,"--n-option-height":xe,"--n-option-opacity-disabled":H,"--n-option-text-color":Se,"--n-option-text-color-active":ae,"--n-option-text-color-disabled":ve,"--n-option-text-color-pressed":pe,"--n-option-padding":we,"--n-option-padding-left":getMargin(we,"left"),"--n-option-padding-right":getMargin(we,"right"),"--n-loading-color":U,"--n-loading-size":G}}),{inlineThemeDisabled:J}=e,Q=J?useThemeClass("internal-select-menu",computed(()=>e.size[0]),j,e):void 0,re={selfRef:i,next:$,prev:_,getPendingTmNode:R};return useOnResize(i,e.onResize),Object.assign({mergedTheme:r,mergedClsPrefix:t,rtlEnabled:o,virtualListRef:a,scrollbarRef:l,itemSize:p,padding:m,flattenedNodes:s,empty:b,virtualListContainer(){const{value:L}=a;return L==null?void 0:L.listElRef},virtualListContent(){const{value:L}=a;return L==null?void 0:L.itemsElRef},doScroll:S,handleFocusin:D,handleFocusout:F,handleKeyUp:T,handleKeyDown:M,handleMouseDown:E,handleVirtualListResize:y,handleVirtualListScroll:w,cssVars:J?void 0:j,themeClass:Q==null?void 0:Q.themeClass,onRender:Q==null?void 0:Q.onRender},re)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:o,themeClass:r,onRender:i}=this;return i==null||i(),h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,r,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},resolveWrappedSlot(e.header,a=>a&&h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?h("div",{class:`${n}-base-select-menu__loading`},h(NBaseLoading,{clsPrefix:n,strokeWidth:20})):this.empty?h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},resolveSlot(e.empty,()=>[h(NEmpty,{theme:o.peers.Empty,themeOverrides:o.peerOverrides.Empty})])):h(NScrollbar,{ref:"scrollbarRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?h(VVirtualList,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?h(NSelectGroupHeader,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:h(NSelectOption,{clsPrefix:n,key:a.key,tmNode:a})}):h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?h(NSelectGroupHeader,{key:a.key,clsPrefix:n,tmNode:a}):h(NSelectOption,{clsPrefix:n,key:a.key,tmNode:a})))}),resolveWrappedSlot(e.action,a=>a&&[h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),h(FocusDetector,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),oppositePlacement={top:"bottom",bottom:"top",left:"right",right:"left"},arrowSize="var(--n-arrow-height) * 1.414",style$p=c$1([cB("popover",` transition: box-shadow .3s var(--n-bezier), background-color .3s var(--n-bezier), @@ -544,7 +544,7 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn line-height: 1.25; text-overflow: ellipsis; overflow: hidden; - `)])])]),NInternalSelection=defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},useTheme.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=useConfig(e),o=useRtl("InternalSelection",n,t),r=ref(null),i=ref(null),a=ref(null),l=ref(null),s=ref(null),u=ref(null),d=ref(null),f=ref(null),v=ref(null),g=ref(null),p=ref(!1),m=ref(!1),C=ref(!1),b=useTheme("InternalSelection","-internal-selection",style$m,internalSelectionLight,e,toRef(e,"clsPrefix")),x=computed(()=>e.clearable&&!e.disabled&&(C.value||e.active)),S=computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):render(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),w=computed(()=>{const K=e.selectedOption;if(K)return K[e.labelField]}),y=computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function R(){var K;const{value:Z}=r;if(Z){const{value:me}=i;me&&(me.style.width=`${Z.offsetWidth}px`,e.maxTagCount!=="responsive"&&((K=v.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:K}=g;K&&(K.style.display="none")}function B(){const{value:K}=g;K&&(K.style.display="inline-block")}watch(toRef(e,"active"),K=>{K||k()}),watch(toRef(e,"pattern"),()=>{e.multiple&&nextTick(R)});function T(K){const{onFocus:Z}=e;Z&&Z(K)}function M(K){const{onBlur:Z}=e;Z&&Z(K)}function E(K){const{onDeleteOption:Z}=e;Z&&Z(K)}function $(K){const{onClear:Z}=e;Z&&Z(K)}function _(K){const{onPatternInput:Z}=e;Z&&Z(K)}function O(K){var Z;(!K.relatedTarget||!(!((Z=a.value)===null||Z===void 0)&&Z.contains(K.relatedTarget)))&&T(K)}function N(K){var Z;!((Z=a.value)===null||Z===void 0)&&Z.contains(K.relatedTarget)||M(K)}function D(K){$(K)}function F(){C.value=!0}function j(){C.value=!1}function J(K){!e.active||!e.filterable||K.target!==i.value&&K.preventDefault()}function Q(K){E(K)}function re(K){if(K.key==="Backspace"&&!L.value&&!e.pattern.length){const{selectedOptions:Z}=e;Z!=null&&Z.length&&Q(Z[Z.length-1])}}const L=ref(!1);let W=null;function ee(K){const{value:Z}=r;if(Z){const me=K.target.value;Z.textContent=me,R()}e.ignoreComposition&&L.value?W=K:_(K)}function ie(){L.value=!0}function he(){L.value=!1,e.ignoreComposition&&_(W),W=null}function oe(K){var Z;m.value=!0,(Z=e.onPatternFocus)===null||Z===void 0||Z.call(e,K)}function ge(K){var Z;m.value=!1,(Z=e.onPatternBlur)===null||Z===void 0||Z.call(e,K)}function pe(){var K,Z;if(e.filterable)m.value=!1,(K=u.value)===null||K===void 0||K.blur(),(Z=i.value)===null||Z===void 0||Z.blur();else if(e.multiple){const{value:me}=l;me==null||me.blur()}else{const{value:me}=s;me==null||me.blur()}}function Se(){var K,Z,me;e.filterable?(m.value=!1,(K=u.value)===null||K===void 0||K.focus()):e.multiple?(Z=l.value)===null||Z===void 0||Z.focus():(me=s.value)===null||me===void 0||me.focus()}function ve(){const{value:K}=i;K&&(B(),K.focus())}function ae(){const{value:K}=i;K&&K.blur()}function H(K){const{value:Z}=d;Z&&Z.setTextContent(`+${K}`)}function q(){const{value:K}=f;return K}function A(){return i.value}let X=null;function I(){X!==null&&window.clearTimeout(X)}function U(){e.active||(I(),X=window.setTimeout(()=>{y.value&&(p.value=!0)},100))}function Y(){I()}function ne(K){K||(I(),p.value=!1)}watch(y,K=>{K||(p.value=!1)}),onMounted(()=>{watchEffect(()=>{const K=u.value;K&&(e.disabled?K.removeAttribute("tabindex"):K.tabIndex=m.value?-1:0)})}),useOnResize(a,e.onResize);const{inlineThemeDisabled:ue}=e,xe=computed(()=>{const{size:K}=e,{common:{cubicBezierEaseInOut:Z},self:{borderRadius:me,color:Pe,placeholderColor:$e,textColor:Te,paddingSingle:Ne,paddingMultiple:Me,caretColor:Ie,colorDisabled:Ke,textColorDisabled:Le,placeholderColorDisabled:Be,colorActive:z,boxShadowFocus:G,boxShadowActive:le,boxShadowHover:fe,border:de,borderFocus:se,borderHover:ce,borderActive:ke,arrowColor:Re,arrowColorDisabled:We,loadingColor:qe,colorActiveWarning:Xe,boxShadowFocusWarning:Ve,boxShadowActiveWarning:De,boxShadowHoverWarning:Ye,borderWarning:Ze,borderFocusWarning:Ge,borderHoverWarning:Oe,borderActiveWarning:P,colorActiveError:V,boxShadowFocusError:te,boxShadowActiveError:ye,boxShadowHoverError:Ce,borderError:be,borderFocusError:_e,borderHoverError:Ee,borderActiveError:ze,clearColor:Ae,clearColorHover:Fe,clearColorPressed:He,clearSize:Je,arrowSize:Qe,[createKey("height",K)]:et,[createKey("fontSize",K)]:tt}}=b.value,je=getMargin(Ne),Ue=getMargin(Me);return{"--n-bezier":Z,"--n-border":de,"--n-border-active":ke,"--n-border-focus":se,"--n-border-hover":ce,"--n-border-radius":me,"--n-box-shadow-active":le,"--n-box-shadow-focus":G,"--n-box-shadow-hover":fe,"--n-caret-color":Ie,"--n-color":Pe,"--n-color-active":z,"--n-color-disabled":Ke,"--n-font-size":tt,"--n-height":et,"--n-padding-single-top":je.top,"--n-padding-multiple-top":Ue.top,"--n-padding-single-right":je.right,"--n-padding-multiple-right":Ue.right,"--n-padding-single-left":je.left,"--n-padding-multiple-left":Ue.left,"--n-padding-single-bottom":je.bottom,"--n-padding-multiple-bottom":Ue.bottom,"--n-placeholder-color":$e,"--n-placeholder-color-disabled":Be,"--n-text-color":Te,"--n-text-color-disabled":Le,"--n-arrow-color":Re,"--n-arrow-color-disabled":We,"--n-loading-color":qe,"--n-color-active-warning":Xe,"--n-box-shadow-focus-warning":Ve,"--n-box-shadow-active-warning":De,"--n-box-shadow-hover-warning":Ye,"--n-border-warning":Ze,"--n-border-focus-warning":Ge,"--n-border-hover-warning":Oe,"--n-border-active-warning":P,"--n-color-active-error":V,"--n-box-shadow-focus-error":te,"--n-box-shadow-active-error":ye,"--n-box-shadow-hover-error":Ce,"--n-border-error":be,"--n-border-focus-error":_e,"--n-border-hover-error":Ee,"--n-border-active-error":ze,"--n-clear-size":Je,"--n-clear-color":Ae,"--n-clear-color-hover":Fe,"--n-clear-color-pressed":He,"--n-arrow-size":Qe}}),we=ue?useThemeClass("internal-selection",computed(()=>e.size[0]),xe,e):void 0;return{mergedTheme:b,mergedClearable:x,mergedClsPrefix:t,rtlEnabled:o,patternInputFocused:m,filterablePlaceholder:S,label:w,selected:y,showTagsPanel:p,isComposing:L,counterRef:d,counterWrapperRef:f,patternInputMirrorRef:r,patternInputRef:i,selfRef:a,multipleElRef:l,singleElRef:s,patternInputWrapperRef:u,overflowRef:v,inputTagElRef:g,handleMouseDown:J,handleFocusin:O,handleClear:D,handleMouseEnter:F,handleMouseLeave:j,handleDeleteOption:Q,handlePatternKeyDown:re,handlePatternInputInput:ee,handlePatternInputBlur:ge,handlePatternInputFocus:oe,handleMouseEnterCounter:U,handleMouseLeaveCounter:Y,handleFocusout:N,handleCompositionEnd:he,handleCompositionStart:ie,onPopoverUpdateShow:ne,focus:Se,focusInput:ve,blur:pe,blurInput:ae,updateCounter:H,getCounter:q,getTail:A,renderLabel:e.renderLabel,cssVars:ue?void 0:xe,themeClass:we==null?void 0:we.themeClass,onRender:we==null?void 0:we.onRender}},render(){const{status:e,multiple:t,size:n,disabled:o,filterable:r,maxTagCount:i,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:s,onRender:u,renderTag:d,renderLabel:f}=this;u==null||u();const v=i==="responsive",g=typeof i=="number",p=v||g,m=h(Wrapper,null,{default:()=>h(NBaseSuffix,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,x;return(x=(b=this.$slots).arrow)===null||x===void 0?void 0:x.call(b)}})});let C;if(t){const{labelField:b}=this,x=_=>h("div",{class:`${l}-base-selection-tag-wrapper`,key:_.value},d?d({option:_,handleClose:()=>{this.handleDeleteOption(_)}}):h(NTag,{size:n,closable:!_.disabled,disabled:o,onClose:()=>{this.handleDeleteOption(_)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(_,!0):render(_[b],_,!0)})),S=()=>(g?this.selectedOptions.slice(0,i):this.selectedOptions).map(x),w=r?h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:o,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,y=v?()=>h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},h(NTag,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:o})):void 0;let R;if(g){const _=this.selectedOptions.length-i;_>0&&(R=h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},h(NTag,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:o},{default:()=>`+${_}`})))}const k=v?r?h(VOverflow,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:y,tail:()=>w}):h(VOverflow,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:y}):g&&R?S().concat(R):S(),B=p?()=>h("div",{class:`${l}-base-selection-popover`},v?S():this.selectedOptions.map(x)):void 0,T=p?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},s):null,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,$=r?h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,v?null:w,m):h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:o?void 0:0},k,m);C=h(Fragment,null,p?h(NPopover,Object.assign({},T,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>$,default:B}):$,E)}else if(r){const b=this.pattern||this.isComposing,x=this.active?!b:!this.selected,S=this.active?!1:this.selected;C=h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:getTitleAttribute(this.label)},h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:o,disabled:o,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},h("div",{class:`${l}-base-selection-overlay__wrapper`},d?d({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):render(this.label,this.selectedOption,!0))):null,x?h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else C=h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?h("div",{class:`${l}-base-selection-input`,title:getTitleAttribute(this.label),key:"input"},h("div",{class:`${l}-base-selection-input__content`},d?d({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):render(this.label,this.selectedOption,!0))):h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},C,a?h("div",{class:`${l}-base-selection__border`}):null,a?h("div",{class:`${l}-base-selection__state-border`}):null)}}),style$l=cB("alert",` + `)])])]),NInternalSelection=defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},useTheme.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=useConfig(e),o=useRtl("InternalSelection",n,t),r=ref(null),i=ref(null),a=ref(null),l=ref(null),s=ref(null),u=ref(null),d=ref(null),f=ref(null),v=ref(null),g=ref(null),p=ref(!1),m=ref(!1),C=ref(!1),b=useTheme("InternalSelection","-internal-selection",style$m,internalSelectionLight,e,toRef(e,"clsPrefix")),x=computed(()=>e.clearable&&!e.disabled&&(C.value||e.active)),S=computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):render(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),w=computed(()=>{const K=e.selectedOption;if(K)return K[e.labelField]}),y=computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function R(){var K;const{value:Z}=r;if(Z){const{value:me}=i;me&&(me.style.width=`${Z.offsetWidth}px`,e.maxTagCount!=="responsive"&&((K=v.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:K}=g;K&&(K.style.display="none")}function B(){const{value:K}=g;K&&(K.style.display="inline-block")}watch(toRef(e,"active"),K=>{K||k()}),watch(toRef(e,"pattern"),()=>{e.multiple&&nextTick(R)});function T(K){const{onFocus:Z}=e;Z&&Z(K)}function M(K){const{onBlur:Z}=e;Z&&Z(K)}function E(K){const{onDeleteOption:Z}=e;Z&&Z(K)}function $(K){const{onClear:Z}=e;Z&&Z(K)}function _(K){const{onPatternInput:Z}=e;Z&&Z(K)}function O(K){var Z;(!K.relatedTarget||!(!((Z=a.value)===null||Z===void 0)&&Z.contains(K.relatedTarget)))&&T(K)}function N(K){var Z;!((Z=a.value)===null||Z===void 0)&&Z.contains(K.relatedTarget)||M(K)}function D(K){$(K)}function F(){C.value=!0}function j(){C.value=!1}function J(K){!e.active||!e.filterable||K.target!==i.value&&K.preventDefault()}function Q(K){E(K)}function re(K){if(K.key==="Backspace"&&!L.value&&!e.pattern.length){const{selectedOptions:Z}=e;Z!=null&&Z.length&&Q(Z[Z.length-1])}}const L=ref(!1);let W=null;function ee(K){const{value:Z}=r;if(Z){const me=K.target.value;Z.textContent=me,R()}e.ignoreComposition&&L.value?W=K:_(K)}function ie(){L.value=!0}function he(){L.value=!1,e.ignoreComposition&&_(W),W=null}function oe(K){var Z;m.value=!0,(Z=e.onPatternFocus)===null||Z===void 0||Z.call(e,K)}function ge(K){var Z;m.value=!1,(Z=e.onPatternBlur)===null||Z===void 0||Z.call(e,K)}function pe(){var K,Z;if(e.filterable)m.value=!1,(K=u.value)===null||K===void 0||K.blur(),(Z=i.value)===null||Z===void 0||Z.blur();else if(e.multiple){const{value:me}=l;me==null||me.blur()}else{const{value:me}=s;me==null||me.blur()}}function Se(){var K,Z,me;e.filterable?(m.value=!1,(K=u.value)===null||K===void 0||K.focus()):e.multiple?(Z=l.value)===null||Z===void 0||Z.focus():(me=s.value)===null||me===void 0||me.focus()}function ve(){const{value:K}=i;K&&(B(),K.focus())}function ae(){const{value:K}=i;K&&K.blur()}function H(K){const{value:Z}=d;Z&&Z.setTextContent(`+${K}`)}function q(){const{value:K}=f;return K}function A(){return i.value}let Y=null;function I(){Y!==null&&window.clearTimeout(Y)}function U(){e.active||(I(),Y=window.setTimeout(()=>{y.value&&(p.value=!0)},100))}function G(){I()}function ne(K){K||(I(),p.value=!1)}watch(y,K=>{K||(p.value=!1)}),onMounted(()=>{watchEffect(()=>{const K=u.value;K&&(e.disabled?K.removeAttribute("tabindex"):K.tabIndex=m.value?-1:0)})}),useOnResize(a,e.onResize);const{inlineThemeDisabled:se}=e,xe=computed(()=>{const{size:K}=e,{common:{cubicBezierEaseInOut:Z},self:{borderRadius:me,color:Pe,placeholderColor:$e,textColor:Te,paddingSingle:Ne,paddingMultiple:Me,caretColor:Ie,colorDisabled:Ke,textColorDisabled:Le,placeholderColorDisabled:Be,colorActive:z,boxShadowFocus:X,boxShadowActive:le,boxShadowHover:fe,border:ce,borderFocus:de,borderHover:ue,borderActive:ke,arrowColor:Re,arrowColorDisabled:We,loadingColor:qe,colorActiveWarning:Xe,boxShadowFocusWarning:Ve,boxShadowActiveWarning:De,boxShadowHoverWarning:Ye,borderWarning:Ze,borderFocusWarning:Ge,borderHoverWarning:Oe,borderActiveWarning:P,colorActiveError:V,boxShadowFocusError:te,boxShadowActiveError:ye,boxShadowHoverError:Ce,borderError:be,borderFocusError:_e,borderHoverError:Ee,borderActiveError:ze,clearColor:Ae,clearColorHover:Fe,clearColorPressed:He,clearSize:Je,arrowSize:Qe,[createKey("height",K)]:et,[createKey("fontSize",K)]:tt}}=b.value,je=getMargin(Ne),Ue=getMargin(Me);return{"--n-bezier":Z,"--n-border":ce,"--n-border-active":ke,"--n-border-focus":de,"--n-border-hover":ue,"--n-border-radius":me,"--n-box-shadow-active":le,"--n-box-shadow-focus":X,"--n-box-shadow-hover":fe,"--n-caret-color":Ie,"--n-color":Pe,"--n-color-active":z,"--n-color-disabled":Ke,"--n-font-size":tt,"--n-height":et,"--n-padding-single-top":je.top,"--n-padding-multiple-top":Ue.top,"--n-padding-single-right":je.right,"--n-padding-multiple-right":Ue.right,"--n-padding-single-left":je.left,"--n-padding-multiple-left":Ue.left,"--n-padding-single-bottom":je.bottom,"--n-padding-multiple-bottom":Ue.bottom,"--n-placeholder-color":$e,"--n-placeholder-color-disabled":Be,"--n-text-color":Te,"--n-text-color-disabled":Le,"--n-arrow-color":Re,"--n-arrow-color-disabled":We,"--n-loading-color":qe,"--n-color-active-warning":Xe,"--n-box-shadow-focus-warning":Ve,"--n-box-shadow-active-warning":De,"--n-box-shadow-hover-warning":Ye,"--n-border-warning":Ze,"--n-border-focus-warning":Ge,"--n-border-hover-warning":Oe,"--n-border-active-warning":P,"--n-color-active-error":V,"--n-box-shadow-focus-error":te,"--n-box-shadow-active-error":ye,"--n-box-shadow-hover-error":Ce,"--n-border-error":be,"--n-border-focus-error":_e,"--n-border-hover-error":Ee,"--n-border-active-error":ze,"--n-clear-size":Je,"--n-clear-color":Ae,"--n-clear-color-hover":Fe,"--n-clear-color-pressed":He,"--n-arrow-size":Qe}}),we=se?useThemeClass("internal-selection",computed(()=>e.size[0]),xe,e):void 0;return{mergedTheme:b,mergedClearable:x,mergedClsPrefix:t,rtlEnabled:o,patternInputFocused:m,filterablePlaceholder:S,label:w,selected:y,showTagsPanel:p,isComposing:L,counterRef:d,counterWrapperRef:f,patternInputMirrorRef:r,patternInputRef:i,selfRef:a,multipleElRef:l,singleElRef:s,patternInputWrapperRef:u,overflowRef:v,inputTagElRef:g,handleMouseDown:J,handleFocusin:O,handleClear:D,handleMouseEnter:F,handleMouseLeave:j,handleDeleteOption:Q,handlePatternKeyDown:re,handlePatternInputInput:ee,handlePatternInputBlur:ge,handlePatternInputFocus:oe,handleMouseEnterCounter:U,handleMouseLeaveCounter:G,handleFocusout:N,handleCompositionEnd:he,handleCompositionStart:ie,onPopoverUpdateShow:ne,focus:Se,focusInput:ve,blur:pe,blurInput:ae,updateCounter:H,getCounter:q,getTail:A,renderLabel:e.renderLabel,cssVars:se?void 0:xe,themeClass:we==null?void 0:we.themeClass,onRender:we==null?void 0:we.onRender}},render(){const{status:e,multiple:t,size:n,disabled:o,filterable:r,maxTagCount:i,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:s,onRender:u,renderTag:d,renderLabel:f}=this;u==null||u();const v=i==="responsive",g=typeof i=="number",p=v||g,m=h(Wrapper,null,{default:()=>h(NBaseSuffix,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,x;return(x=(b=this.$slots).arrow)===null||x===void 0?void 0:x.call(b)}})});let C;if(t){const{labelField:b}=this,x=_=>h("div",{class:`${l}-base-selection-tag-wrapper`,key:_.value},d?d({option:_,handleClose:()=>{this.handleDeleteOption(_)}}):h(NTag,{size:n,closable:!_.disabled,disabled:o,onClose:()=>{this.handleDeleteOption(_)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(_,!0):render(_[b],_,!0)})),S=()=>(g?this.selectedOptions.slice(0,i):this.selectedOptions).map(x),w=r?h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:o,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,y=v?()=>h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},h(NTag,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:o})):void 0;let R;if(g){const _=this.selectedOptions.length-i;_>0&&(R=h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},h(NTag,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:o},{default:()=>`+${_}`})))}const k=v?r?h(VOverflow,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:y,tail:()=>w}):h(VOverflow,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:y}):g&&R?S().concat(R):S(),B=p?()=>h("div",{class:`${l}-base-selection-popover`},v?S():this.selectedOptions.map(x)):void 0,T=p?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},s):null,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,$=r?h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,v?null:w,m):h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:o?void 0:0},k,m);C=h(Fragment,null,p?h(NPopover,Object.assign({},T,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>$,default:B}):$,E)}else if(r){const b=this.pattern||this.isComposing,x=this.active?!b:!this.selected,S=this.active?!1:this.selected;C=h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:getTitleAttribute(this.label)},h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:o,disabled:o,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},h("div",{class:`${l}-base-selection-overlay__wrapper`},d?d({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):render(this.label,this.selectedOption,!0))):null,x?h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else C=h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?h("div",{class:`${l}-base-selection-input`,title:getTitleAttribute(this.label),key:"input"},h("div",{class:`${l}-base-selection-input__content`},d?d({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):render(this.label,this.selectedOption,!0))):h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},C,a?h("div",{class:`${l}-base-selection__border`}):null,a?h("div",{class:`${l}-base-selection__state-border`}):null)}}),style$l=cB("alert",` line-height: var(--n-line-height); border-radius: var(--n-border-radius); position: relative; @@ -823,8 +823,8 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn border: var(--n-border-focus-${e}); `)])])]))]),safariStyle=cB("input",[cM("disabled",[cE("input-el, textarea-el",` -webkit-text-fill-color: var(--n-text-color-disabled); - `)])]),inputProps=Object.assign(Object.assign({},useTheme.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),NInput=defineComponent({name:"Input",props:inputProps,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:o,mergedRtlRef:r}=useConfig(e),i=useTheme("Input","-input",style$k,inputLight,e,t);isSafari&&useStyle("-input-safari",safariStyle,t);const a=ref(null),l=ref(null),s=ref(null),u=ref(null),d=ref(null),f=ref(null),v=ref(null),g=useCursor(v),p=ref(null),{localeRef:m}=useLocale("Input"),C=ref(e.defaultValue),b=toRef(e,"value"),x=useMergedState(b,C),S=useFormItem(e),{mergedSizeRef:w,mergedDisabledRef:y,mergedStatusRef:R}=S,k=ref(!1),B=ref(!1),T=ref(!1),M=ref(!1);let E=null;const $=computed(()=>{const{placeholder:P,pair:V}=e;return V?Array.isArray(P)?P:P===void 0?["",""]:[P,P]:P===void 0?[m.value.placeholder]:[P]}),_=computed(()=>{const{value:P}=T,{value:V}=x,{value:te}=$;return!P&&(isEmptyInputValue(V)||Array.isArray(V)&&isEmptyInputValue(V[0]))&&te[0]}),O=computed(()=>{const{value:P}=T,{value:V}=x,{value:te}=$;return!P&&te[1]&&(isEmptyInputValue(V)||Array.isArray(V)&&isEmptyInputValue(V[1]))}),N=useMemo(()=>e.internalForceFocus||k.value),D=useMemo(()=>{if(y.value||e.readonly||!e.clearable||!N.value&&!B.value)return!1;const{value:P}=x,{value:V}=N;return e.pair?!!(Array.isArray(P)&&(P[0]||P[1]))&&(B.value||V):!!P&&(B.value||V)}),F=computed(()=>{const{showPasswordOn:P}=e;if(P)return P;if(e.showPasswordToggle)return"click"}),j=ref(!1),J=computed(()=>{const{textDecoration:P}=e;return P?Array.isArray(P)?P.map(V=>({textDecoration:V})):[{textDecoration:P}]:["",""]}),Q=ref(void 0),re=()=>{var P,V;if(e.type==="textarea"){const{autosize:te}=e;if(te&&(Q.value=(V=(P=p.value)===null||P===void 0?void 0:P.$el)===null||V===void 0?void 0:V.offsetWidth),!l.value||typeof te=="boolean")return;const{paddingTop:ye,paddingBottom:Ce,lineHeight:be}=window.getComputedStyle(l.value),_e=Number(ye.slice(0,-2)),Ee=Number(Ce.slice(0,-2)),ze=Number(be.slice(0,-2)),{value:Ae}=s;if(!Ae)return;if(te.minRows){const Fe=Math.max(te.minRows,1),He=`${_e+Ee+ze*Fe}px`;Ae.style.minHeight=He}if(te.maxRows){const Fe=`${_e+Ee+ze*te.maxRows}px`;Ae.style.maxHeight=Fe}}},L=computed(()=>{const{maxlength:P}=e;return P===void 0?void 0:Number(P)});onMounted(()=>{const{value:P}=x;Array.isArray(P)||Re(P)});const W=getCurrentInstance().proxy;function ee(P,V){const{onUpdateValue:te,"onUpdate:value":ye,onInput:Ce}=e,{nTriggerFormInput:be}=S;te&&call(te,P,V),ye&&call(ye,P,V),Ce&&call(Ce,P,V),C.value=P,be()}function ie(P,V){const{onChange:te}=e,{nTriggerFormChange:ye}=S;te&&call(te,P,V),C.value=P,ye()}function he(P){const{onBlur:V}=e,{nTriggerFormBlur:te}=S;V&&call(V,P),te()}function oe(P){const{onFocus:V}=e,{nTriggerFormFocus:te}=S;V&&call(V,P),te()}function ge(P){const{onClear:V}=e;V&&call(V,P)}function pe(P){const{onInputBlur:V}=e;V&&call(V,P)}function Se(P){const{onInputFocus:V}=e;V&&call(V,P)}function ve(){const{onDeactivate:P}=e;P&&call(P)}function ae(){const{onActivate:P}=e;P&&call(P)}function H(P){const{onClick:V}=e;V&&call(V,P)}function q(P){const{onWrapperFocus:V}=e;V&&call(V,P)}function A(P){const{onWrapperBlur:V}=e;V&&call(V,P)}function X(){T.value=!0}function I(P){T.value=!1,P.target===f.value?U(P,1):U(P,0)}function U(P,V=0,te="input"){const ye=P.target.value;if(Re(ye),P instanceof InputEvent&&!P.isComposing&&(T.value=!1),e.type==="textarea"){const{value:be}=p;be&&be.syncUnifiedContainer()}if(E=ye,T.value)return;g.recordCursor();const Ce=Y(ye);if(Ce)if(!e.pair)te==="input"?ee(ye,{source:V}):ie(ye,{source:V});else{let{value:be}=x;Array.isArray(be)?be=[be[0],be[1]]:be=["",""],be[V]=ye,te==="input"?ee(be,{source:V}):ie(be,{source:V})}W.$forceUpdate(),Ce||nextTick(g.restoreCursor)}function Y(P){const{countGraphemes:V,maxlength:te,minlength:ye}=e;if(V){let be;if(te!==void 0&&(be===void 0&&(be=V(P)),be>Number(te))||ye!==void 0&&(be===void 0&&(be=V(P)),be{ye.preventDefault(),off("mouseup",document,V)};if(on("mouseup",document,V),F.value!=="mousedown")return;j.value=!0;const te=()=>{j.value=!1,off("mouseup",document,te)};on("mouseup",document,te)}function Le(P){e.onKeyup&&call(e.onKeyup,P)}function Be(P){switch(e.onKeydown&&call(e.onKeydown,P),P.key){case"Escape":G();break;case"Enter":z(P);break}}function z(P){var V,te;if(e.passivelyActivated){const{value:ye}=M;if(ye){e.internalDeactivateOnEnter&&G();return}P.preventDefault(),e.type==="textarea"?(V=l.value)===null||V===void 0||V.focus():(te=d.value)===null||te===void 0||te.focus()}}function G(){e.passivelyActivated&&(M.value=!1,nextTick(()=>{var P;(P=a.value)===null||P===void 0||P.focus()}))}function le(){var P,V,te;y.value||(e.passivelyActivated?(P=a.value)===null||P===void 0||P.focus():((V=l.value)===null||V===void 0||V.focus(),(te=d.value)===null||te===void 0||te.focus()))}function fe(){var P;!((P=a.value)===null||P===void 0)&&P.contains(document.activeElement)&&document.activeElement.blur()}function de(){var P,V;(P=l.value)===null||P===void 0||P.select(),(V=d.value)===null||V===void 0||V.select()}function se(){y.value||(l.value?l.value.focus():d.value&&d.value.focus())}function ce(){const{value:P}=a;P!=null&&P.contains(document.activeElement)&&P!==document.activeElement&&G()}function ke(P){if(e.type==="textarea"){const{value:V}=l;V==null||V.scrollTo(P)}else{const{value:V}=d;V==null||V.scrollTo(P)}}function Re(P){const{type:V,pair:te,autosize:ye}=e;if(!te&&ye)if(V==="textarea"){const{value:Ce}=s;Ce&&(Ce.textContent=(P??"")+`\r -`)}else{const{value:Ce}=u;Ce&&(P?Ce.textContent=P:Ce.innerHTML=" ")}}function We(){re()}const qe=ref({top:"0"});function Xe(P){var V;const{scrollTop:te}=P.target;qe.value.top=`${-te}px`,(V=p.value)===null||V===void 0||V.syncUnifiedContainer()}let Ve=null;watchEffect(()=>{const{autosize:P,type:V}=e;P&&V==="textarea"?Ve=watch(x,te=>{!Array.isArray(te)&&te!==E&&Re(te)}):Ve==null||Ve()});let De=null;watchEffect(()=>{e.type==="textarea"?De=watch(x,P=>{var V;!Array.isArray(P)&&P!==E&&((V=p.value)===null||V===void 0||V.syncUnifiedContainer())}):De==null||De()}),provide(inputInjectionKey,{mergedValueRef:x,maxlengthRef:L,mergedClsPrefixRef:t,countGraphemesRef:toRef(e,"countGraphemes")});const Ye={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:T,clear:$e,focus:le,blur:fe,select:de,deactivate:ce,activate:se,scrollTo:ke},Ze=useRtl("Input",r,t),Ge=computed(()=>{const{value:P}=w,{common:{cubicBezierEaseInOut:V},self:{color:te,borderRadius:ye,textColor:Ce,caretColor:be,caretColorError:_e,caretColorWarning:Ee,textDecorationColor:ze,border:Ae,borderDisabled:Fe,borderHover:He,borderFocus:Je,placeholderColor:Qe,placeholderColorDisabled:et,lineHeightTextarea:tt,colorDisabled:je,colorFocus:Ue,textColorDisabled:nt,boxShadowFocus:ot,iconSize:rt,colorFocusWarning:it,boxShadowFocusWarning:at,borderWarning:lt,borderFocusWarning:st,borderHoverWarning:dt,colorFocusError:ct,boxShadowFocusError:ut,borderError:ft,borderFocusError:ht,borderHoverError:pt,clearSize:vt,clearColor:gt,clearColorHover:mt,clearColorPressed:bt,iconColor:yt,iconColorDisabled:wt,suffixTextColor:xt,countTextColor:Ct,countTextColorDisabled:St,iconColorHover:kt,iconColorPressed:Rt,loadingColor:Pt,loadingColorError:Bt,loadingColorWarning:$t,[createKey("padding",P)]:Tt,[createKey("fontSize",P)]:Nt,[createKey("height",P)]:Mt}}=i.value,{left:It,right:_t}=getMargin(Tt);return{"--n-bezier":V,"--n-count-text-color":Ct,"--n-count-text-color-disabled":St,"--n-color":te,"--n-font-size":Nt,"--n-border-radius":ye,"--n-height":Mt,"--n-padding-left":It,"--n-padding-right":_t,"--n-text-color":Ce,"--n-caret-color":be,"--n-text-decoration-color":ze,"--n-border":Ae,"--n-border-disabled":Fe,"--n-border-hover":He,"--n-border-focus":Je,"--n-placeholder-color":Qe,"--n-placeholder-color-disabled":et,"--n-icon-size":rt,"--n-line-height-textarea":tt,"--n-color-disabled":je,"--n-color-focus":Ue,"--n-text-color-disabled":nt,"--n-box-shadow-focus":ot,"--n-loading-color":Pt,"--n-caret-color-warning":Ee,"--n-color-focus-warning":it,"--n-box-shadow-focus-warning":at,"--n-border-warning":lt,"--n-border-focus-warning":st,"--n-border-hover-warning":dt,"--n-loading-color-warning":$t,"--n-caret-color-error":_e,"--n-color-focus-error":ct,"--n-box-shadow-focus-error":ut,"--n-border-error":ft,"--n-border-focus-error":ht,"--n-border-hover-error":pt,"--n-loading-color-error":Bt,"--n-clear-color":gt,"--n-clear-size":vt,"--n-clear-color-hover":mt,"--n-clear-color-pressed":bt,"--n-icon-color":yt,"--n-icon-color-hover":kt,"--n-icon-color-pressed":Rt,"--n-icon-color-disabled":wt,"--n-suffix-text-color":xt}}),Oe=o?useThemeClass("input",computed(()=>{const{value:P}=w;return P[0]}),Ge,e):void 0;return Object.assign(Object.assign({},Ye),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:u,inputEl2Ref:f,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:p,rtlEnabled:Ze,uncontrolledValue:C,mergedValue:x,passwordVisible:j,mergedPlaceholder:$,showPlaceholder1:_,showPlaceholder2:O,mergedFocus:N,isComposing:T,activated:M,showClearButton:D,mergedSize:w,mergedDisabled:y,textDecorationStyle:J,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:F,placeholderStyle:qe,mergedStatus:R,textAreaScrollContainerWidth:Q,handleTextAreaScroll:Xe,handleCompositionStart:X,handleCompositionEnd:I,handleInput:U,handleInputBlur:ne,handleInputFocus:ue,handleWrapperBlur:xe,handleWrapperFocus:we,handleMouseEnter:Ne,handleMouseLeave:Me,handleMouseDown:Te,handleChange:Z,handleClick:me,handleClear:Pe,handlePasswordToggleClick:Ie,handlePasswordToggleMousedown:Ke,handleWrapperKeydown:Be,handleWrapperKeyup:Le,handleTextAreaMirrorResize:We,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:o?void 0:Ge,themeClass:Oe==null?void 0:Oe.themeClass,onRender:Oe==null?void 0:Oe.onRender})},render(){var e,t;const{mergedClsPrefix:n,mergedStatus:o,themeClass:r,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),h("div",{ref:"wrapperElRef",class:[`${n}-input`,r,o&&`${n}-input--${o}-status`,{[`${n}-input--rtl`]:this.rtlEnabled,[`${n}-input--disabled`]:this.mergedDisabled,[`${n}-input--textarea`]:i==="textarea",[`${n}-input--resizable`]:this.resizable&&!this.autosize,[`${n}-input--autosize`]:this.autosize,[`${n}-input--round`]:this.round&&i!=="textarea",[`${n}-input--pair`]:this.pair,[`${n}-input--focus`]:this.mergedFocus,[`${n}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},h("div",{class:`${n}-input-wrapper`},resolveWrappedSlot(s.prefix,u=>u&&h("div",{class:`${n}-input__prefix`},u)),i==="textarea"?h(NScrollbar,{ref:"textareaScrollbarInstRef",class:`${n}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var u,d;const{textAreaScrollContainerWidth:f}=this,v={width:this.autosize&&f&&`${f}px`};return h(Fragment,null,h("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${n}-input__textarea-el`,(u=this.inputProps)===null||u===void 0?void 0:u.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,v],onBlur:this.handleInputBlur,onFocus:g=>{this.handleInputFocus(g,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?h("div",{class:`${n}-input__placeholder`,style:[this.placeholderStyle,v],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?h(VResizeObserver,{onResize:this.handleTextAreaMirrorResize},{default:()=>h("div",{ref:"textareaMirrorElRef",class:`${n}-input__textarea-mirror`,key:"mirror"})}):null)}}):h("div",{class:`${n}-input__input`},h("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${n}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:u=>{this.handleInputFocus(u,0)},onInput:u=>{this.handleInput(u,0)},onChange:u=>{this.handleChange(u,0)}})),this.showPlaceholder1?h("div",{class:`${n}-input__placeholder`},h("span",null,this.mergedPlaceholder[0])):null,this.autosize?h("div",{class:`${n}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&resolveWrappedSlot(s.suffix,u=>u||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?h("div",{class:`${n}-input__suffix`},[resolveWrappedSlot(s["clear-icon-placeholder"],d=>(this.clearable||d)&&h(NBaseClear,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var f,v;return(v=(f=this.$slots)["clear-icon"])===null||v===void 0?void 0:v.call(f)}})),this.internalLoadingBeforeSuffix?null:u,this.loading!==void 0?h(NBaseSuffix,{clsPrefix:n,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?u:null,this.showCount&&this.type!=="textarea"?h(WordCount,null,{default:d=>{var f;return(f=s.count)===null||f===void 0?void 0:f.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?h("div",{class:`${n}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?resolveSlot(s["password-visible-icon"],()=>[h(NBaseIcon,{clsPrefix:n},{default:()=>h(EyeIcon,null)})]):resolveSlot(s["password-invisible-icon"],()=>[h(NBaseIcon,{clsPrefix:n},{default:()=>h(EyeOffIcon,null)})])):null]):null)),this.pair?h("span",{class:`${n}-input__separator`},resolveSlot(s.separator,()=>[this.separator])):null,this.pair?h("div",{class:`${n}-input-wrapper`},h("div",{class:`${n}-input__input`},h("input",{ref:"inputEl2Ref",type:this.type,class:`${n}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:u=>{this.handleInputFocus(u,1)},onInput:u=>{this.handleInput(u,1)},onChange:u=>{this.handleChange(u,1)}}),this.showPlaceholder2?h("div",{class:`${n}-input__placeholder`},h("span",null,this.mergedPlaceholder[1])):null),resolveWrappedSlot(s.suffix,u=>(this.clearable||u)&&h("div",{class:`${n}-input__suffix`},[this.clearable&&h(NBaseClear,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),u]))):null,this.mergedBordered?h("div",{class:`${n}-input__border`}):null,this.mergedBordered?h("div",{class:`${n}-input__state-border`}):null,this.showCount&&i==="textarea"?h(WordCount,null,{default:u=>{var d;const{renderCount:f}=this;return f?f(u):(d=s.count)===null||d===void 0?void 0:d.call(s,u)}}):null)}}),isImageSupportNativeLazy=isBrowser$1&&"loading"in document.createElement("img"),resolveOptionsAndHash=(e={})=>{var t;const{root:n=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(t=e.threshold)!==null&&t!==void 0?t:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof n=="string"?document.querySelector(n):n)||document.documentElement})}},observers=new WeakMap,unobserveHandleMap=new WeakMap,shouldStartLoadingRefMap=new WeakMap,observeIntersection=(e,t,n)=>{if(!e)return()=>{};const o=resolveOptionsAndHash(t),{root:r}=o.options;let i;const a=observers.get(r);a?i=a:(i=new Map,observers.set(r,i));let l,s;i.has(o.hash)?(s=i.get(o.hash),s[1].has(e)||(l=s[0],s[1].add(e),l.observe(e))):(l=new IntersectionObserver(f=>{f.forEach(v=>{if(v.isIntersecting){const g=unobserveHandleMap.get(v.target),p=shouldStartLoadingRefMap.get(v.target);g&&g(),p&&(p.value=!0)}})},o.options),l.observe(e),s=[l,new Set([e])],i.set(o.hash,s));let u=!1;const d=()=>{u||(unobserveHandleMap.delete(e),shouldStartLoadingRefMap.delete(e),u=!0,s[1].has(e)&&(s[0].unobserve(e),s[1].delete(e)),s[1].size<=0&&i.delete(o.hash),i.size||observers.delete(r))};return unobserveHandleMap.set(e,d),shouldStartLoadingRefMap.set(e,n),d},style$j=c$1([cB("select",` + `)])]),inputProps=Object.assign(Object.assign({},useTheme.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),NInput=defineComponent({name:"Input",props:inputProps,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:o,mergedRtlRef:r}=useConfig(e),i=useTheme("Input","-input",style$k,inputLight,e,t);isSafari&&useStyle("-input-safari",safariStyle,t);const a=ref(null),l=ref(null),s=ref(null),u=ref(null),d=ref(null),f=ref(null),v=ref(null),g=useCursor(v),p=ref(null),{localeRef:m}=useLocale("Input"),C=ref(e.defaultValue),b=toRef(e,"value"),x=useMergedState(b,C),S=useFormItem(e),{mergedSizeRef:w,mergedDisabledRef:y,mergedStatusRef:R}=S,k=ref(!1),B=ref(!1),T=ref(!1),M=ref(!1);let E=null;const $=computed(()=>{const{placeholder:P,pair:V}=e;return V?Array.isArray(P)?P:P===void 0?["",""]:[P,P]:P===void 0?[m.value.placeholder]:[P]}),_=computed(()=>{const{value:P}=T,{value:V}=x,{value:te}=$;return!P&&(isEmptyInputValue(V)||Array.isArray(V)&&isEmptyInputValue(V[0]))&&te[0]}),O=computed(()=>{const{value:P}=T,{value:V}=x,{value:te}=$;return!P&&te[1]&&(isEmptyInputValue(V)||Array.isArray(V)&&isEmptyInputValue(V[1]))}),N=useMemo(()=>e.internalForceFocus||k.value),D=useMemo(()=>{if(y.value||e.readonly||!e.clearable||!N.value&&!B.value)return!1;const{value:P}=x,{value:V}=N;return e.pair?!!(Array.isArray(P)&&(P[0]||P[1]))&&(B.value||V):!!P&&(B.value||V)}),F=computed(()=>{const{showPasswordOn:P}=e;if(P)return P;if(e.showPasswordToggle)return"click"}),j=ref(!1),J=computed(()=>{const{textDecoration:P}=e;return P?Array.isArray(P)?P.map(V=>({textDecoration:V})):[{textDecoration:P}]:["",""]}),Q=ref(void 0),re=()=>{var P,V;if(e.type==="textarea"){const{autosize:te}=e;if(te&&(Q.value=(V=(P=p.value)===null||P===void 0?void 0:P.$el)===null||V===void 0?void 0:V.offsetWidth),!l.value||typeof te=="boolean")return;const{paddingTop:ye,paddingBottom:Ce,lineHeight:be}=window.getComputedStyle(l.value),_e=Number(ye.slice(0,-2)),Ee=Number(Ce.slice(0,-2)),ze=Number(be.slice(0,-2)),{value:Ae}=s;if(!Ae)return;if(te.minRows){const Fe=Math.max(te.minRows,1),He=`${_e+Ee+ze*Fe}px`;Ae.style.minHeight=He}if(te.maxRows){const Fe=`${_e+Ee+ze*te.maxRows}px`;Ae.style.maxHeight=Fe}}},L=computed(()=>{const{maxlength:P}=e;return P===void 0?void 0:Number(P)});onMounted(()=>{const{value:P}=x;Array.isArray(P)||Re(P)});const W=getCurrentInstance().proxy;function ee(P,V){const{onUpdateValue:te,"onUpdate:value":ye,onInput:Ce}=e,{nTriggerFormInput:be}=S;te&&call(te,P,V),ye&&call(ye,P,V),Ce&&call(Ce,P,V),C.value=P,be()}function ie(P,V){const{onChange:te}=e,{nTriggerFormChange:ye}=S;te&&call(te,P,V),C.value=P,ye()}function he(P){const{onBlur:V}=e,{nTriggerFormBlur:te}=S;V&&call(V,P),te()}function oe(P){const{onFocus:V}=e,{nTriggerFormFocus:te}=S;V&&call(V,P),te()}function ge(P){const{onClear:V}=e;V&&call(V,P)}function pe(P){const{onInputBlur:V}=e;V&&call(V,P)}function Se(P){const{onInputFocus:V}=e;V&&call(V,P)}function ve(){const{onDeactivate:P}=e;P&&call(P)}function ae(){const{onActivate:P}=e;P&&call(P)}function H(P){const{onClick:V}=e;V&&call(V,P)}function q(P){const{onWrapperFocus:V}=e;V&&call(V,P)}function A(P){const{onWrapperBlur:V}=e;V&&call(V,P)}function Y(){T.value=!0}function I(P){T.value=!1,P.target===f.value?U(P,1):U(P,0)}function U(P,V=0,te="input"){const ye=P.target.value;if(Re(ye),P instanceof InputEvent&&!P.isComposing&&(T.value=!1),e.type==="textarea"){const{value:be}=p;be&&be.syncUnifiedContainer()}if(E=ye,T.value)return;g.recordCursor();const Ce=G(ye);if(Ce)if(!e.pair)te==="input"?ee(ye,{source:V}):ie(ye,{source:V});else{let{value:be}=x;Array.isArray(be)?be=[be[0],be[1]]:be=["",""],be[V]=ye,te==="input"?ee(be,{source:V}):ie(be,{source:V})}W.$forceUpdate(),Ce||nextTick(g.restoreCursor)}function G(P){const{countGraphemes:V,maxlength:te,minlength:ye}=e;if(V){let be;if(te!==void 0&&(be===void 0&&(be=V(P)),be>Number(te))||ye!==void 0&&(be===void 0&&(be=V(P)),be{ye.preventDefault(),off("mouseup",document,V)};if(on("mouseup",document,V),F.value!=="mousedown")return;j.value=!0;const te=()=>{j.value=!1,off("mouseup",document,te)};on("mouseup",document,te)}function Le(P){e.onKeyup&&call(e.onKeyup,P)}function Be(P){switch(e.onKeydown&&call(e.onKeydown,P),P.key){case"Escape":X();break;case"Enter":z(P);break}}function z(P){var V,te;if(e.passivelyActivated){const{value:ye}=M;if(ye){e.internalDeactivateOnEnter&&X();return}P.preventDefault(),e.type==="textarea"?(V=l.value)===null||V===void 0||V.focus():(te=d.value)===null||te===void 0||te.focus()}}function X(){e.passivelyActivated&&(M.value=!1,nextTick(()=>{var P;(P=a.value)===null||P===void 0||P.focus()}))}function le(){var P,V,te;y.value||(e.passivelyActivated?(P=a.value)===null||P===void 0||P.focus():((V=l.value)===null||V===void 0||V.focus(),(te=d.value)===null||te===void 0||te.focus()))}function fe(){var P;!((P=a.value)===null||P===void 0)&&P.contains(document.activeElement)&&document.activeElement.blur()}function ce(){var P,V;(P=l.value)===null||P===void 0||P.select(),(V=d.value)===null||V===void 0||V.select()}function de(){y.value||(l.value?l.value.focus():d.value&&d.value.focus())}function ue(){const{value:P}=a;P!=null&&P.contains(document.activeElement)&&P!==document.activeElement&&X()}function ke(P){if(e.type==="textarea"){const{value:V}=l;V==null||V.scrollTo(P)}else{const{value:V}=d;V==null||V.scrollTo(P)}}function Re(P){const{type:V,pair:te,autosize:ye}=e;if(!te&&ye)if(V==="textarea"){const{value:Ce}=s;Ce&&(Ce.textContent=(P??"")+`\r +`)}else{const{value:Ce}=u;Ce&&(P?Ce.textContent=P:Ce.innerHTML=" ")}}function We(){re()}const qe=ref({top:"0"});function Xe(P){var V;const{scrollTop:te}=P.target;qe.value.top=`${-te}px`,(V=p.value)===null||V===void 0||V.syncUnifiedContainer()}let Ve=null;watchEffect(()=>{const{autosize:P,type:V}=e;P&&V==="textarea"?Ve=watch(x,te=>{!Array.isArray(te)&&te!==E&&Re(te)}):Ve==null||Ve()});let De=null;watchEffect(()=>{e.type==="textarea"?De=watch(x,P=>{var V;!Array.isArray(P)&&P!==E&&((V=p.value)===null||V===void 0||V.syncUnifiedContainer())}):De==null||De()}),provide(inputInjectionKey,{mergedValueRef:x,maxlengthRef:L,mergedClsPrefixRef:t,countGraphemesRef:toRef(e,"countGraphemes")});const Ye={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:T,clear:$e,focus:le,blur:fe,select:ce,deactivate:ue,activate:de,scrollTo:ke},Ze=useRtl("Input",r,t),Ge=computed(()=>{const{value:P}=w,{common:{cubicBezierEaseInOut:V},self:{color:te,borderRadius:ye,textColor:Ce,caretColor:be,caretColorError:_e,caretColorWarning:Ee,textDecorationColor:ze,border:Ae,borderDisabled:Fe,borderHover:He,borderFocus:Je,placeholderColor:Qe,placeholderColorDisabled:et,lineHeightTextarea:tt,colorDisabled:je,colorFocus:Ue,textColorDisabled:nt,boxShadowFocus:ot,iconSize:rt,colorFocusWarning:it,boxShadowFocusWarning:at,borderWarning:lt,borderFocusWarning:st,borderHoverWarning:dt,colorFocusError:ct,boxShadowFocusError:ut,borderError:ft,borderFocusError:ht,borderHoverError:pt,clearSize:vt,clearColor:gt,clearColorHover:mt,clearColorPressed:bt,iconColor:yt,iconColorDisabled:wt,suffixTextColor:xt,countTextColor:Ct,countTextColorDisabled:St,iconColorHover:kt,iconColorPressed:Rt,loadingColor:Pt,loadingColorError:Bt,loadingColorWarning:$t,[createKey("padding",P)]:Tt,[createKey("fontSize",P)]:Nt,[createKey("height",P)]:Mt}}=i.value,{left:It,right:_t}=getMargin(Tt);return{"--n-bezier":V,"--n-count-text-color":Ct,"--n-count-text-color-disabled":St,"--n-color":te,"--n-font-size":Nt,"--n-border-radius":ye,"--n-height":Mt,"--n-padding-left":It,"--n-padding-right":_t,"--n-text-color":Ce,"--n-caret-color":be,"--n-text-decoration-color":ze,"--n-border":Ae,"--n-border-disabled":Fe,"--n-border-hover":He,"--n-border-focus":Je,"--n-placeholder-color":Qe,"--n-placeholder-color-disabled":et,"--n-icon-size":rt,"--n-line-height-textarea":tt,"--n-color-disabled":je,"--n-color-focus":Ue,"--n-text-color-disabled":nt,"--n-box-shadow-focus":ot,"--n-loading-color":Pt,"--n-caret-color-warning":Ee,"--n-color-focus-warning":it,"--n-box-shadow-focus-warning":at,"--n-border-warning":lt,"--n-border-focus-warning":st,"--n-border-hover-warning":dt,"--n-loading-color-warning":$t,"--n-caret-color-error":_e,"--n-color-focus-error":ct,"--n-box-shadow-focus-error":ut,"--n-border-error":ft,"--n-border-focus-error":ht,"--n-border-hover-error":pt,"--n-loading-color-error":Bt,"--n-clear-color":gt,"--n-clear-size":vt,"--n-clear-color-hover":mt,"--n-clear-color-pressed":bt,"--n-icon-color":yt,"--n-icon-color-hover":kt,"--n-icon-color-pressed":Rt,"--n-icon-color-disabled":wt,"--n-suffix-text-color":xt}}),Oe=o?useThemeClass("input",computed(()=>{const{value:P}=w;return P[0]}),Ge,e):void 0;return Object.assign(Object.assign({},Ye),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:u,inputEl2Ref:f,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:p,rtlEnabled:Ze,uncontrolledValue:C,mergedValue:x,passwordVisible:j,mergedPlaceholder:$,showPlaceholder1:_,showPlaceholder2:O,mergedFocus:N,isComposing:T,activated:M,showClearButton:D,mergedSize:w,mergedDisabled:y,textDecorationStyle:J,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:F,placeholderStyle:qe,mergedStatus:R,textAreaScrollContainerWidth:Q,handleTextAreaScroll:Xe,handleCompositionStart:Y,handleCompositionEnd:I,handleInput:U,handleInputBlur:ne,handleInputFocus:se,handleWrapperBlur:xe,handleWrapperFocus:we,handleMouseEnter:Ne,handleMouseLeave:Me,handleMouseDown:Te,handleChange:Z,handleClick:me,handleClear:Pe,handlePasswordToggleClick:Ie,handlePasswordToggleMousedown:Ke,handleWrapperKeydown:Be,handleWrapperKeyup:Le,handleTextAreaMirrorResize:We,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:o?void 0:Ge,themeClass:Oe==null?void 0:Oe.themeClass,onRender:Oe==null?void 0:Oe.onRender})},render(){var e,t;const{mergedClsPrefix:n,mergedStatus:o,themeClass:r,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),h("div",{ref:"wrapperElRef",class:[`${n}-input`,r,o&&`${n}-input--${o}-status`,{[`${n}-input--rtl`]:this.rtlEnabled,[`${n}-input--disabled`]:this.mergedDisabled,[`${n}-input--textarea`]:i==="textarea",[`${n}-input--resizable`]:this.resizable&&!this.autosize,[`${n}-input--autosize`]:this.autosize,[`${n}-input--round`]:this.round&&i!=="textarea",[`${n}-input--pair`]:this.pair,[`${n}-input--focus`]:this.mergedFocus,[`${n}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},h("div",{class:`${n}-input-wrapper`},resolveWrappedSlot(s.prefix,u=>u&&h("div",{class:`${n}-input__prefix`},u)),i==="textarea"?h(NScrollbar,{ref:"textareaScrollbarInstRef",class:`${n}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var u,d;const{textAreaScrollContainerWidth:f}=this,v={width:this.autosize&&f&&`${f}px`};return h(Fragment,null,h("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${n}-input__textarea-el`,(u=this.inputProps)===null||u===void 0?void 0:u.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,v],onBlur:this.handleInputBlur,onFocus:g=>{this.handleInputFocus(g,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?h("div",{class:`${n}-input__placeholder`,style:[this.placeholderStyle,v],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?h(VResizeObserver,{onResize:this.handleTextAreaMirrorResize},{default:()=>h("div",{ref:"textareaMirrorElRef",class:`${n}-input__textarea-mirror`,key:"mirror"})}):null)}}):h("div",{class:`${n}-input__input`},h("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${n}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:u=>{this.handleInputFocus(u,0)},onInput:u=>{this.handleInput(u,0)},onChange:u=>{this.handleChange(u,0)}})),this.showPlaceholder1?h("div",{class:`${n}-input__placeholder`},h("span",null,this.mergedPlaceholder[0])):null,this.autosize?h("div",{class:`${n}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&resolveWrappedSlot(s.suffix,u=>u||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?h("div",{class:`${n}-input__suffix`},[resolveWrappedSlot(s["clear-icon-placeholder"],d=>(this.clearable||d)&&h(NBaseClear,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var f,v;return(v=(f=this.$slots)["clear-icon"])===null||v===void 0?void 0:v.call(f)}})),this.internalLoadingBeforeSuffix?null:u,this.loading!==void 0?h(NBaseSuffix,{clsPrefix:n,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?u:null,this.showCount&&this.type!=="textarea"?h(WordCount,null,{default:d=>{var f;return(f=s.count)===null||f===void 0?void 0:f.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?h("div",{class:`${n}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?resolveSlot(s["password-visible-icon"],()=>[h(NBaseIcon,{clsPrefix:n},{default:()=>h(EyeIcon,null)})]):resolveSlot(s["password-invisible-icon"],()=>[h(NBaseIcon,{clsPrefix:n},{default:()=>h(EyeOffIcon,null)})])):null]):null)),this.pair?h("span",{class:`${n}-input__separator`},resolveSlot(s.separator,()=>[this.separator])):null,this.pair?h("div",{class:`${n}-input-wrapper`},h("div",{class:`${n}-input__input`},h("input",{ref:"inputEl2Ref",type:this.type,class:`${n}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:u=>{this.handleInputFocus(u,1)},onInput:u=>{this.handleInput(u,1)},onChange:u=>{this.handleChange(u,1)}}),this.showPlaceholder2?h("div",{class:`${n}-input__placeholder`},h("span",null,this.mergedPlaceholder[1])):null),resolveWrappedSlot(s.suffix,u=>(this.clearable||u)&&h("div",{class:`${n}-input__suffix`},[this.clearable&&h(NBaseClear,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),u]))):null,this.mergedBordered?h("div",{class:`${n}-input__border`}):null,this.mergedBordered?h("div",{class:`${n}-input__state-border`}):null,this.showCount&&i==="textarea"?h(WordCount,null,{default:u=>{var d;const{renderCount:f}=this;return f?f(u):(d=s.count)===null||d===void 0?void 0:d.call(s,u)}}):null)}}),isImageSupportNativeLazy=isBrowser$1&&"loading"in document.createElement("img"),resolveOptionsAndHash=(e={})=>{var t;const{root:n=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(t=e.threshold)!==null&&t!==void 0?t:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof n=="string"?document.querySelector(n):n)||document.documentElement})}},observers=new WeakMap,unobserveHandleMap=new WeakMap,shouldStartLoadingRefMap=new WeakMap,observeIntersection=(e,t,n)=>{if(!e)return()=>{};const o=resolveOptionsAndHash(t),{root:r}=o.options;let i;const a=observers.get(r);a?i=a:(i=new Map,observers.set(r,i));let l,s;i.has(o.hash)?(s=i.get(o.hash),s[1].has(e)||(l=s[0],s[1].add(e),l.observe(e))):(l=new IntersectionObserver(f=>{f.forEach(v=>{if(v.isIntersecting){const g=unobserveHandleMap.get(v.target),p=shouldStartLoadingRefMap.get(v.target);g&&g(),p&&(p.value=!0)}})},o.options),l.observe(e),s=[l,new Set([e])],i.set(o.hash,s));let u=!1;const d=()=>{u||(unobserveHandleMap.delete(e),shouldStartLoadingRefMap.delete(e),u=!0,s[1].has(e)&&(s[0].unobserve(e),s[1].delete(e)),s[1].size<=0&&i.delete(o.hash),i.size||observers.delete(r))};return unobserveHandleMap.set(e,d),shouldStartLoadingRefMap.set(e,n),d},style$j=c$1([cB("select",` z-index: auto; outline: none; width: 100%; @@ -832,7 +832,7 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn `),cB("select-menu",` margin: 4px 0; box-shadow: var(--n-menu-box-shadow); - `,[fadeInScaleUpTransition({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),selectProps=Object.assign(Object.assign({},useTheme.props),{to:useAdjustedTo.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),NSelect=defineComponent({name:"Select",props:selectProps,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:o,inlineThemeDisabled:r}=useConfig(e),i=useTheme("Select","-select",style$j,selectLight,e,t),a=ref(e.defaultValue),l=toRef(e,"value"),s=useMergedState(l,a),u=ref(!1),d=ref(""),f=computed(()=>{const{valueField:z,childrenField:G}=e,le=createTmOptions(z,G);return createTreeMate($.value,le)}),v=computed(()=>createValOptMap(M.value,e.valueField,e.childrenField)),g=ref(!1),p=useMergedState(toRef(e,"show"),g),m=ref(null),C=ref(null),b=ref(null),{localeRef:x}=useLocale("Select"),S=computed(()=>{var z;return(z=e.placeholder)!==null&&z!==void 0?z:x.value.placeholder}),w=useCompitable(e,["items","options"]),y=[],R=ref([]),k=ref([]),B=ref(new Map),T=computed(()=>{const{fallbackOption:z}=e;if(z===void 0){const{labelField:G,valueField:le}=e;return fe=>({[G]:String(fe),[le]:fe})}return z===!1?!1:G=>Object.assign(z(G),{value:G})}),M=computed(()=>k.value.concat(R.value).concat(w.value)),E=computed(()=>{const{filter:z}=e;if(z)return z;const{labelField:G,valueField:le}=e;return(fe,de)=>{if(!de)return!1;const se=de[G];if(typeof se=="string")return patternMatched(fe,se);const ce=de[le];return typeof ce=="string"?patternMatched(fe,ce):typeof ce=="number"?patternMatched(fe,String(ce)):!1}}),$=computed(()=>{if(e.remote)return w.value;{const{value:z}=M,{value:G}=d;return!G.length||!e.filterable?z:filterOptions(z,E.value,G,e.childrenField)}});function _(z){const G=e.remote,{value:le}=B,{value:fe}=v,{value:de}=T,se=[];return z.forEach(ce=>{if(fe.has(ce))se.push(fe.get(ce));else if(G&&le.has(ce))se.push(le.get(ce));else if(de){const ke=de(ce);ke&&se.push(ke)}}),se}const O=computed(()=>{if(e.multiple){const{value:z}=s;return Array.isArray(z)?_(z):[]}return null}),N=computed(()=>{const{value:z}=s;return!e.multiple&&!Array.isArray(z)?z===null?null:_([z])[0]||null:null}),D=useFormItem(e),{mergedSizeRef:F,mergedDisabledRef:j,mergedStatusRef:J}=D;function Q(z,G){const{onChange:le,"onUpdate:value":fe,onUpdateValue:de}=e,{nTriggerFormChange:se,nTriggerFormInput:ce}=D;le&&call(le,z,G),de&&call(de,z,G),fe&&call(fe,z,G),a.value=z,se(),ce()}function re(z){const{onBlur:G}=e,{nTriggerFormBlur:le}=D;G&&call(G,z),le()}function L(){const{onClear:z}=e;z&&call(z)}function W(z){const{onFocus:G,showOnFocus:le}=e,{nTriggerFormFocus:fe}=D;G&&call(G,z),fe(),le&&ge()}function ee(z){const{onSearch:G}=e;G&&call(G,z)}function ie(z){const{onScroll:G}=e;G&&call(G,z)}function he(){var z;const{remote:G,multiple:le}=e;if(G){const{value:fe}=B;if(le){const{valueField:de}=e;(z=O.value)===null||z===void 0||z.forEach(se=>{fe.set(se[de],se)})}else{const de=N.value;de&&fe.set(de[e.valueField],de)}}}function oe(z){const{onUpdateShow:G,"onUpdate:show":le}=e;G&&call(G,z),le&&call(le,z),g.value=z}function ge(){j.value||(oe(!0),g.value=!0,e.filterable&&Me())}function pe(){oe(!1)}function Se(){d.value="",k.value=y}const ve=ref(!1);function ae(){e.filterable&&(ve.value=!0)}function H(){e.filterable&&(ve.value=!1,p.value||Se())}function q(){j.value||(p.value?e.filterable?Me():pe():ge())}function A(z){var G,le;!((le=(G=b.value)===null||G===void 0?void 0:G.selfRef)===null||le===void 0)&&le.contains(z.relatedTarget)||(u.value=!1,re(z),pe())}function X(z){W(z),u.value=!0}function I(z){u.value=!0}function U(z){var G;!((G=m.value)===null||G===void 0)&&G.$el.contains(z.relatedTarget)||(u.value=!1,re(z),pe())}function Y(){var z;(z=m.value)===null||z===void 0||z.focus(),pe()}function ne(z){var G;p.value&&(!((G=m.value)===null||G===void 0)&&G.$el.contains(getPreciseEventTarget(z))||pe())}function ue(z){if(!Array.isArray(z))return[];if(T.value)return Array.from(z);{const{remote:G}=e,{value:le}=v;if(G){const{value:fe}=B;return z.filter(de=>le.has(de)||fe.has(de))}else return z.filter(fe=>le.has(fe))}}function xe(z){we(z.rawNode)}function we(z){if(j.value)return;const{tag:G,remote:le,clearFilterAfterSelect:fe,valueField:de}=e;if(G&&!le){const{value:se}=k,ce=se[0]||null;if(ce){const ke=R.value;ke.length?ke.push(ce):R.value=[ce],k.value=y}}if(le&&B.value.set(z[de],z),e.multiple){const se=ue(s.value),ce=se.findIndex(ke=>ke===z[de]);if(~ce){if(se.splice(ce,1),G&&!le){const ke=K(z[de]);~ke&&(R.value.splice(ke,1),fe&&(d.value=""))}}else se.push(z[de]),fe&&(d.value="");Q(se,_(se))}else{if(G&&!le){const se=K(z[de]);~se?R.value=[R.value[se]]:R.value=y}Ne(),pe(),Q(z[de],z)}}function K(z){return R.value.findIndex(le=>le[e.valueField]===z)}function Z(z){p.value||ge();const{value:G}=z.target;d.value=G;const{tag:le,remote:fe}=e;if(ee(G),le&&!fe){if(!G){k.value=y;return}const{onCreate:de}=e,se=de?de(G):{[e.labelField]:G,[e.valueField]:G},{valueField:ce,labelField:ke}=e;w.value.some(Re=>Re[ce]===se[ce]||Re[ke]===se[ke])||R.value.some(Re=>Re[ce]===se[ce]||Re[ke]===se[ke])?k.value=y:k.value=[se]}}function me(z){z.stopPropagation();const{multiple:G}=e;!G&&e.filterable&&pe(),L(),G?Q([],[]):Q(null,null)}function Pe(z){!happensIn(z,"action")&&!happensIn(z,"empty")&&z.preventDefault()}function $e(z){ie(z)}function Te(z){var G,le,fe,de,se;if(!e.keyboard){z.preventDefault();return}switch(z.key){case" ":if(e.filterable)break;z.preventDefault();case"Enter":if(!(!((G=m.value)===null||G===void 0)&&G.isComposing)){if(p.value){const ce=(le=b.value)===null||le===void 0?void 0:le.getPendingTmNode();ce?xe(ce):e.filterable||(pe(),Ne())}else if(ge(),e.tag&&ve.value){const ce=k.value[0];if(ce){const ke=ce[e.valueField],{value:Re}=s;e.multiple&&Array.isArray(Re)&&Re.some(We=>We===ke)||we(ce)}}}z.preventDefault();break;case"ArrowUp":if(z.preventDefault(),e.loading)return;p.value&&((fe=b.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(z.preventDefault(),e.loading)return;p.value?(de=b.value)===null||de===void 0||de.next():ge();break;case"Escape":p.value&&(markEventEffectPerformed(z),pe()),(se=m.value)===null||se===void 0||se.focus();break}}function Ne(){var z;(z=m.value)===null||z===void 0||z.focus()}function Me(){var z;(z=m.value)===null||z===void 0||z.focusInput()}function Ie(){var z;p.value&&((z=C.value)===null||z===void 0||z.syncPosition())}he(),watch(toRef(e,"options"),he);const Ke={focus:()=>{var z;(z=m.value)===null||z===void 0||z.focus()},focusInput:()=>{var z;(z=m.value)===null||z===void 0||z.focusInput()},blur:()=>{var z;(z=m.value)===null||z===void 0||z.blur()},blurInput:()=>{var z;(z=m.value)===null||z===void 0||z.blurInput()}},Le=computed(()=>{const{self:{menuBoxShadow:z}}=i.value;return{"--n-menu-box-shadow":z}}),Be=r?useThemeClass("select",void 0,Le,e):void 0;return Object.assign(Object.assign({},Ke),{mergedStatus:J,mergedClsPrefix:t,mergedBordered:n,namespace:o,treeMate:f,isMounted:isMounted(),triggerRef:m,menuRef:b,pattern:d,uncontrolledShow:g,mergedShow:p,adjustedTo:useAdjustedTo(e),uncontrolledValue:a,mergedValue:s,followerRef:C,localizedPlaceholder:S,selectedOption:N,selectedOptions:O,mergedSize:F,mergedDisabled:j,focused:u,activeWithoutMenuOpen:ve,inlineThemeDisabled:r,onTriggerInputFocus:ae,onTriggerInputBlur:H,handleTriggerOrMenuResize:Ie,handleMenuFocus:I,handleMenuBlur:U,handleMenuTabOut:Y,handleTriggerClick:q,handleToggle:xe,handleDeleteOption:we,handlePatternInput:Z,handleClear:me,handleTriggerBlur:A,handleTriggerFocus:X,handleKeydown:Te,handleMenuAfterLeave:Se,handleMenuClickOutside:ne,handleMenuScroll:$e,handleMenuKeydown:Te,handleMenuMousedown:Pe,mergedTheme:i,cssVars:r?void 0:Le,themeClass:Be==null?void 0:Be.themeClass,onRender:Be==null?void 0:Be.onRender})},render(){return h("div",{class:`${this.mergedClsPrefix}-select`},h(VBinder,null,{default:()=>[h(VTarget,null,{default:()=>h(NInternalSelection,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),h(VFollower,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===useAdjustedTo.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>h(Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),withDirectives(h(NInternalSelectMenu,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var o,r;return[(r=(o=this.$slots).empty)===null||r===void 0?void 0:r.call(o)]},header:()=>{var o,r;return[(r=(o=this.$slots).header)===null||r===void 0?void 0:r.call(o)]},action:()=>{var o,r;return[(r=(o=this.$slots).action)===null||r===void 0?void 0:r.call(o)]}}),this.displayDirective==="show"?[[vShow,this.mergedShow],[clickoutside,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[clickoutside,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),tooltipProps=Object.assign(Object.assign({},popoverBaseProps),useTheme.props),NTooltip=defineComponent({name:"Tooltip",props:tooltipProps,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=useConfig(e),n=useTheme("Tooltip","-tooltip",void 0,tooltipLight,e,t),o=ref(null);return Object.assign(Object.assign({},{syncPosition(){o.value.syncPosition()},setShow(i){o.value.setShow(i)}}),{popoverRef:o,mergedTheme:n,popoverThemeOverrides:computed(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return h(NPopover,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),style$i=cB("ellipsis",{overflow:"hidden"},[cNotM("line-clamp",` + `,[fadeInScaleUpTransition({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),selectProps=Object.assign(Object.assign({},useTheme.props),{to:useAdjustedTo.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),NSelect=defineComponent({name:"Select",props:selectProps,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:o,inlineThemeDisabled:r}=useConfig(e),i=useTheme("Select","-select",style$j,selectLight,e,t),a=ref(e.defaultValue),l=toRef(e,"value"),s=useMergedState(l,a),u=ref(!1),d=ref(""),f=computed(()=>{const{valueField:z,childrenField:X}=e,le=createTmOptions(z,X);return createTreeMate($.value,le)}),v=computed(()=>createValOptMap(M.value,e.valueField,e.childrenField)),g=ref(!1),p=useMergedState(toRef(e,"show"),g),m=ref(null),C=ref(null),b=ref(null),{localeRef:x}=useLocale("Select"),S=computed(()=>{var z;return(z=e.placeholder)!==null&&z!==void 0?z:x.value.placeholder}),w=useCompitable(e,["items","options"]),y=[],R=ref([]),k=ref([]),B=ref(new Map),T=computed(()=>{const{fallbackOption:z}=e;if(z===void 0){const{labelField:X,valueField:le}=e;return fe=>({[X]:String(fe),[le]:fe})}return z===!1?!1:X=>Object.assign(z(X),{value:X})}),M=computed(()=>k.value.concat(R.value).concat(w.value)),E=computed(()=>{const{filter:z}=e;if(z)return z;const{labelField:X,valueField:le}=e;return(fe,ce)=>{if(!ce)return!1;const de=ce[X];if(typeof de=="string")return patternMatched(fe,de);const ue=ce[le];return typeof ue=="string"?patternMatched(fe,ue):typeof ue=="number"?patternMatched(fe,String(ue)):!1}}),$=computed(()=>{if(e.remote)return w.value;{const{value:z}=M,{value:X}=d;return!X.length||!e.filterable?z:filterOptions(z,E.value,X,e.childrenField)}});function _(z){const X=e.remote,{value:le}=B,{value:fe}=v,{value:ce}=T,de=[];return z.forEach(ue=>{if(fe.has(ue))de.push(fe.get(ue));else if(X&&le.has(ue))de.push(le.get(ue));else if(ce){const ke=ce(ue);ke&&de.push(ke)}}),de}const O=computed(()=>{if(e.multiple){const{value:z}=s;return Array.isArray(z)?_(z):[]}return null}),N=computed(()=>{const{value:z}=s;return!e.multiple&&!Array.isArray(z)?z===null?null:_([z])[0]||null:null}),D=useFormItem(e),{mergedSizeRef:F,mergedDisabledRef:j,mergedStatusRef:J}=D;function Q(z,X){const{onChange:le,"onUpdate:value":fe,onUpdateValue:ce}=e,{nTriggerFormChange:de,nTriggerFormInput:ue}=D;le&&call(le,z,X),ce&&call(ce,z,X),fe&&call(fe,z,X),a.value=z,de(),ue()}function re(z){const{onBlur:X}=e,{nTriggerFormBlur:le}=D;X&&call(X,z),le()}function L(){const{onClear:z}=e;z&&call(z)}function W(z){const{onFocus:X,showOnFocus:le}=e,{nTriggerFormFocus:fe}=D;X&&call(X,z),fe(),le&&ge()}function ee(z){const{onSearch:X}=e;X&&call(X,z)}function ie(z){const{onScroll:X}=e;X&&call(X,z)}function he(){var z;const{remote:X,multiple:le}=e;if(X){const{value:fe}=B;if(le){const{valueField:ce}=e;(z=O.value)===null||z===void 0||z.forEach(de=>{fe.set(de[ce],de)})}else{const ce=N.value;ce&&fe.set(ce[e.valueField],ce)}}}function oe(z){const{onUpdateShow:X,"onUpdate:show":le}=e;X&&call(X,z),le&&call(le,z),g.value=z}function ge(){j.value||(oe(!0),g.value=!0,e.filterable&&Me())}function pe(){oe(!1)}function Se(){d.value="",k.value=y}const ve=ref(!1);function ae(){e.filterable&&(ve.value=!0)}function H(){e.filterable&&(ve.value=!1,p.value||Se())}function q(){j.value||(p.value?e.filterable?Me():pe():ge())}function A(z){var X,le;!((le=(X=b.value)===null||X===void 0?void 0:X.selfRef)===null||le===void 0)&&le.contains(z.relatedTarget)||(u.value=!1,re(z),pe())}function Y(z){W(z),u.value=!0}function I(z){u.value=!0}function U(z){var X;!((X=m.value)===null||X===void 0)&&X.$el.contains(z.relatedTarget)||(u.value=!1,re(z),pe())}function G(){var z;(z=m.value)===null||z===void 0||z.focus(),pe()}function ne(z){var X;p.value&&(!((X=m.value)===null||X===void 0)&&X.$el.contains(getPreciseEventTarget(z))||pe())}function se(z){if(!Array.isArray(z))return[];if(T.value)return Array.from(z);{const{remote:X}=e,{value:le}=v;if(X){const{value:fe}=B;return z.filter(ce=>le.has(ce)||fe.has(ce))}else return z.filter(fe=>le.has(fe))}}function xe(z){we(z.rawNode)}function we(z){if(j.value)return;const{tag:X,remote:le,clearFilterAfterSelect:fe,valueField:ce}=e;if(X&&!le){const{value:de}=k,ue=de[0]||null;if(ue){const ke=R.value;ke.length?ke.push(ue):R.value=[ue],k.value=y}}if(le&&B.value.set(z[ce],z),e.multiple){const de=se(s.value),ue=de.findIndex(ke=>ke===z[ce]);if(~ue){if(de.splice(ue,1),X&&!le){const ke=K(z[ce]);~ke&&(R.value.splice(ke,1),fe&&(d.value=""))}}else de.push(z[ce]),fe&&(d.value="");Q(de,_(de))}else{if(X&&!le){const de=K(z[ce]);~de?R.value=[R.value[de]]:R.value=y}Ne(),pe(),Q(z[ce],z)}}function K(z){return R.value.findIndex(le=>le[e.valueField]===z)}function Z(z){p.value||ge();const{value:X}=z.target;d.value=X;const{tag:le,remote:fe}=e;if(ee(X),le&&!fe){if(!X){k.value=y;return}const{onCreate:ce}=e,de=ce?ce(X):{[e.labelField]:X,[e.valueField]:X},{valueField:ue,labelField:ke}=e;w.value.some(Re=>Re[ue]===de[ue]||Re[ke]===de[ke])||R.value.some(Re=>Re[ue]===de[ue]||Re[ke]===de[ke])?k.value=y:k.value=[de]}}function me(z){z.stopPropagation();const{multiple:X}=e;!X&&e.filterable&&pe(),L(),X?Q([],[]):Q(null,null)}function Pe(z){!happensIn(z,"action")&&!happensIn(z,"empty")&&z.preventDefault()}function $e(z){ie(z)}function Te(z){var X,le,fe,ce,de;if(!e.keyboard){z.preventDefault();return}switch(z.key){case" ":if(e.filterable)break;z.preventDefault();case"Enter":if(!(!((X=m.value)===null||X===void 0)&&X.isComposing)){if(p.value){const ue=(le=b.value)===null||le===void 0?void 0:le.getPendingTmNode();ue?xe(ue):e.filterable||(pe(),Ne())}else if(ge(),e.tag&&ve.value){const ue=k.value[0];if(ue){const ke=ue[e.valueField],{value:Re}=s;e.multiple&&Array.isArray(Re)&&Re.some(We=>We===ke)||we(ue)}}}z.preventDefault();break;case"ArrowUp":if(z.preventDefault(),e.loading)return;p.value&&((fe=b.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(z.preventDefault(),e.loading)return;p.value?(ce=b.value)===null||ce===void 0||ce.next():ge();break;case"Escape":p.value&&(markEventEffectPerformed(z),pe()),(de=m.value)===null||de===void 0||de.focus();break}}function Ne(){var z;(z=m.value)===null||z===void 0||z.focus()}function Me(){var z;(z=m.value)===null||z===void 0||z.focusInput()}function Ie(){var z;p.value&&((z=C.value)===null||z===void 0||z.syncPosition())}he(),watch(toRef(e,"options"),he);const Ke={focus:()=>{var z;(z=m.value)===null||z===void 0||z.focus()},focusInput:()=>{var z;(z=m.value)===null||z===void 0||z.focusInput()},blur:()=>{var z;(z=m.value)===null||z===void 0||z.blur()},blurInput:()=>{var z;(z=m.value)===null||z===void 0||z.blurInput()}},Le=computed(()=>{const{self:{menuBoxShadow:z}}=i.value;return{"--n-menu-box-shadow":z}}),Be=r?useThemeClass("select",void 0,Le,e):void 0;return Object.assign(Object.assign({},Ke),{mergedStatus:J,mergedClsPrefix:t,mergedBordered:n,namespace:o,treeMate:f,isMounted:isMounted(),triggerRef:m,menuRef:b,pattern:d,uncontrolledShow:g,mergedShow:p,adjustedTo:useAdjustedTo(e),uncontrolledValue:a,mergedValue:s,followerRef:C,localizedPlaceholder:S,selectedOption:N,selectedOptions:O,mergedSize:F,mergedDisabled:j,focused:u,activeWithoutMenuOpen:ve,inlineThemeDisabled:r,onTriggerInputFocus:ae,onTriggerInputBlur:H,handleTriggerOrMenuResize:Ie,handleMenuFocus:I,handleMenuBlur:U,handleMenuTabOut:G,handleTriggerClick:q,handleToggle:xe,handleDeleteOption:we,handlePatternInput:Z,handleClear:me,handleTriggerBlur:A,handleTriggerFocus:Y,handleKeydown:Te,handleMenuAfterLeave:Se,handleMenuClickOutside:ne,handleMenuScroll:$e,handleMenuKeydown:Te,handleMenuMousedown:Pe,mergedTheme:i,cssVars:r?void 0:Le,themeClass:Be==null?void 0:Be.themeClass,onRender:Be==null?void 0:Be.onRender})},render(){return h("div",{class:`${this.mergedClsPrefix}-select`},h(VBinder,null,{default:()=>[h(VTarget,null,{default:()=>h(NInternalSelection,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),h(VFollower,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===useAdjustedTo.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>h(Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),withDirectives(h(NInternalSelectMenu,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var o,r;return[(r=(o=this.$slots).empty)===null||r===void 0?void 0:r.call(o)]},header:()=>{var o,r;return[(r=(o=this.$slots).header)===null||r===void 0?void 0:r.call(o)]},action:()=>{var o,r;return[(r=(o=this.$slots).action)===null||r===void 0?void 0:r.call(o)]}}),this.displayDirective==="show"?[[vShow,this.mergedShow],[clickoutside,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[clickoutside,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),tooltipProps=Object.assign(Object.assign({},popoverBaseProps),useTheme.props),NTooltip=defineComponent({name:"Tooltip",props:tooltipProps,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=useConfig(e),n=useTheme("Tooltip","-tooltip",void 0,tooltipLight,e,t),o=ref(null);return Object.assign(Object.assign({},{syncPosition(){o.value.syncPosition()},setShow(i){o.value.setShow(i)}}),{popoverRef:o,mergedTheme:n,popoverThemeOverrides:computed(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return h(NPopover,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),style$i=cB("ellipsis",{overflow:"hidden"},[cNotM("line-clamp",` white-space: nowrap; display: inline-block; vertical-align: bottom; @@ -1290,13 +1290,13 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn cursor: pointer; `),c$1("img",` border-radius: inherit; - `)])]),BLEEDING=32,NImagePreview=defineComponent({name:"ImagePreview",props:Object.assign(Object.assign({},imagePreviewSharedProps),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=useTheme("Image","-image",style$b,imageLight,e,toRef(e,"clsPrefix"));let n=null;const o=ref(null),r=ref(null),i=ref(void 0),a=ref(!1),l=ref(!1),{localeRef:s}=useLocale("Image");function u(){const{value:H}=r;if(!n||!H)return;const{style:q}=H,A=n.getBoundingClientRect(),X=A.left+A.width/2,I=A.top+A.height/2;q.transformOrigin=`${X}px ${I}px`}function d(H){var q,A;switch(H.key){case" ":H.preventDefault();break;case"ArrowLeft":(q=e.onPrev)===null||q===void 0||q.call(e);break;case"ArrowRight":(A=e.onNext)===null||A===void 0||A.call(e);break;case"Escape":he();break}}watch(a,H=>{H?on("keydown",document,d):off("keydown",document,d)}),onBeforeUnmount(()=>{off("keydown",document,d)});let f=0,v=0,g=0,p=0,m=0,C=0,b=0,x=0,S=!1;function w(H){const{clientX:q,clientY:A}=H;g=q-f,p=A-v,beforeNextFrameOnce(ie)}function y(H){const{mouseUpClientX:q,mouseUpClientY:A,mouseDownClientX:X,mouseDownClientY:I}=H,U=X-q,Y=I-A,ne=`vertical${Y>0?"Top":"Bottom"}`,ue=`horizontal${U>0?"Left":"Right"}`;return{moveVerticalDirection:ne,moveHorizontalDirection:ue,deltaHorizontal:U,deltaVertical:Y}}function R(H){const{value:q}=o;if(!q)return{offsetX:0,offsetY:0};const A=q.getBoundingClientRect(),{moveVerticalDirection:X,moveHorizontalDirection:I,deltaHorizontal:U,deltaVertical:Y}=H||{};let ne=0,ue=0;return A.width<=window.innerWidth?ne=0:A.left>0?ne=(A.width-window.innerWidth)/2:A.right0?ue=(A.height-window.innerHeight)/2:A.bottom.5){const H=_;$-=1,_=Math.max(.5,Math.pow(E,$));const q=H-_;ie(!1);const A=R();_+=q,ie(!1),_-=q,g=A.offsetX,p=A.offsetY,ie()}}function ee(){const H=i.value;H&&download(H,void 0)}function ie(H=!0){var q;const{value:A}=o;if(!A)return;const{style:X}=A,I=normalizeStyle((q=B==null?void 0:B.previewedImgPropsRef.value)===null||q===void 0?void 0:q.style);let U="";if(typeof I=="string")U=I+";";else for(const ne in I)U+=`${kebabCase$1(ne)}: ${I[ne]};`;const Y=`transform-origin: center; transform: translateX(${g}px) translateY(${p}px) rotate(${O}deg) scale(${_});`;S?X.cssText=U+"cursor: grabbing; transition: none;"+Y:X.cssText=U+"cursor: grab;"+Y+(H?"":"transition: none;"),H||A.offsetHeight}function he(){a.value=!a.value,l.value=!0}function oe(){_=re(),$=Math.ceil(Math.log(_)/Math.log(E)),g=0,p=0,ie()}const ge={setPreviewSrc:H=>{i.value=H},setThumbnailEl:H=>{n=H},toggleShow:he};function pe(H,q){if(e.showToolbarTooltip){const{value:A}=t;return h(NTooltip,{to:!1,theme:A.peers.Tooltip,themeOverrides:A.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>s.value[q],trigger:()=>H})}else return H}const Se=computed(()=>{const{common:{cubicBezierEaseInOut:H},self:{toolbarIconColor:q,toolbarBorderRadius:A,toolbarBoxShadow:X,toolbarColor:I}}=t.value;return{"--n-bezier":H,"--n-toolbar-icon-color":q,"--n-toolbar-color":I,"--n-toolbar-border-radius":A,"--n-toolbar-box-shadow":X}}),{inlineThemeDisabled:ve}=useConfig(),ae=ve?useThemeClass("image-preview",void 0,Se,e):void 0;return Object.assign({previewRef:o,previewWrapperRef:r,previewSrc:i,show:a,appear:isMounted(),displayed:l,previewedImgProps:B==null?void 0:B.previewedImgPropsRef,handleWheel(H){H.preventDefault()},handlePreviewMousedown:T,handlePreviewDblclick:M,syncTransformOrigin:u,handleAfterLeave:()=>{N(),O=0,l.value=!1},handleDragStart:H=>{var q,A;(A=(q=B==null?void 0:B.previewedImgPropsRef.value)===null||q===void 0?void 0:q.onDragstart)===null||A===void 0||A.call(q,H),H.preventDefault()},zoomIn:L,zoomOut:W,handleDownloadClick:ee,rotateCounterclockwise:j,rotateClockwise:J,handleSwitchPrev:D,handleSwitchNext:F,withTooltip:pe,resizeToOrignalImageSize:oe,cssVars:ve?void 0:Se,themeClass:ae==null?void 0:ae.themeClass,onRender:ae==null?void 0:ae.onRender},ge)},render(){var e,t;const{clsPrefix:n,renderToolbar:o,withTooltip:r}=this,i=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleSwitchPrev},{default:()=>prevIcon}),"tipPrevious"),a=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleSwitchNext},{default:()=>nextIcon}),"tipNext"),l=r(h(NBaseIcon,{clsPrefix:n,onClick:this.rotateCounterclockwise},{default:()=>h(RotateCounterclockwiseIcon,null)}),"tipCounterclockwise"),s=r(h(NBaseIcon,{clsPrefix:n,onClick:this.rotateClockwise},{default:()=>h(RotateClockwiseIcon,null)}),"tipClockwise"),u=r(h(NBaseIcon,{clsPrefix:n,onClick:this.resizeToOrignalImageSize},{default:()=>h(ResizeSmallIcon,null)}),"tipOriginalSize"),d=r(h(NBaseIcon,{clsPrefix:n,onClick:this.zoomOut},{default:()=>h(ZoomOutIcon,null)}),"tipZoomOut"),f=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleDownloadClick},{default:()=>h(DownloadIcon,null)}),"tipDownload"),v=r(h(NBaseIcon,{clsPrefix:n,onClick:this.toggleShow},{default:()=>closeIcon}),"tipClose"),g=r(h(NBaseIcon,{clsPrefix:n,onClick:this.zoomIn},{default:()=>h(ZoomInIcon,null)}),"tipZoomIn");return h(Fragment,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),h(LazyTeleport,{show:this.show},{default:()=>{var p;return this.show||this.displayed?((p=this.onRender)===null||p===void 0||p.call(this),withDirectives(h("div",{class:[`${n}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},h(Transition,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?h("div",{class:`${n}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?h(Transition,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?h("div",{class:`${n}-image-preview-toolbar`},o?o({nodes:{prev:i,next:a,rotateCounterclockwise:l,rotateClockwise:s,resizeToOriginalSize:u,zoomOut:d,zoomIn:g,download:f,close:v}}):h(Fragment,null,this.onPrev?h(Fragment,null,i,a):null,l,s,u,d,g,f,v)):null}):null,h(Transition,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:m={}}=this;return withDirectives(h("div",{class:`${n}-image-preview-wrapper`,ref:"previewWrapperRef"},h("img",Object.assign({},m,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${n}-image-preview`,m.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[vShow,this.show]])}})),[[zindexable,{enabled:this.show}]])):null}}))}}),imageGroupInjectionKey=createInjectionKey("n-image-group"),imageGroupProps=imagePreviewSharedProps,NImageGroup=defineComponent({name:"ImageGroup",props:imageGroupProps,setup(e){let t;const{mergedClsPrefixRef:n}=useConfig(e),o=`c${createId()}`,r=getCurrentInstance(),i=s=>{var u;t=s,(u=l.value)===null||u===void 0||u.setPreviewSrc(s)};function a(s){var u,d;if(!(r!=null&&r.proxy))return;const v=r.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${o}]:not([data-error=true])`);if(!v.length)return;const g=Array.from(v).findIndex(p=>p.dataset.previewSrc===t);~g?i(v[(g+s+v.length)%v.length].dataset.previewSrc):i(v[0].dataset.previewSrc),s===1?(u=e.onPreviewNext)===null||u===void 0||u.call(e):(d=e.onPreviewPrev)===null||d===void 0||d.call(e)}provide(imageGroupInjectionKey,{mergedClsPrefixRef:n,setPreviewSrc:i,setThumbnailEl:s=>{var u;(u=l.value)===null||u===void 0||u.setThumbnailEl(s)},toggleShow:()=>{var s;(s=l.value)===null||s===void 0||s.toggleShow()},groupId:o,renderToolbarRef:toRef(e,"renderToolbar")});const l=ref(null);return{mergedClsPrefix:n,previewInstRef:l,next:()=>{a(1)},prev:()=>{a(-1)}}},render(){return h(NImagePreview,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},this.$slots)}}),imageProps=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},imagePreviewSharedProps),NImage=defineComponent({name:"Image",props:imageProps,inheritAttrs:!1,setup(e){const t=ref(null),n=ref(!1),o=ref(null),r=inject(imageGroupInjectionKey,null),{mergedClsPrefixRef:i}=r||useConfig(e),a={click:()=>{if(e.previewDisabled||n.value)return;const u=e.previewSrc||e.src;if(r){r.setPreviewSrc(u),r.setThumbnailEl(t.value),r.toggleShow();return}const{value:d}=o;d&&(d.setPreviewSrc(u),d.setThumbnailEl(t.value),d.toggleShow())}},l=ref(!e.lazy);onMounted(()=>{var u;(u=t.value)===null||u===void 0||u.setAttribute("data-group-id",(r==null?void 0:r.groupId)||"")}),onMounted(()=>{if(e.lazy&&e.intersectionObserverOptions){let u;const d=watchEffect(()=>{u==null||u(),u=void 0,u=observeIntersection(t.value,e.intersectionObserverOptions,l)});onBeforeUnmount(()=>{d(),u==null||u()})}}),watchEffect(()=>{var u;e.src||((u=e.imgProps)===null||u===void 0||u.src),n.value=!1});const s=ref(!1);return provide(imageContextKey,{previewedImgPropsRef:toRef(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:i,groupId:r==null?void 0:r.groupId,previewInstRef:o,imageRef:t,showError:n,shouldStartLoading:l,loaded:s,mergedOnClick:u=>{var d,f;a.click(),(f=(d=e.imgProps)===null||d===void 0?void 0:d.onClick)===null||f===void 0||f.call(d,u)},mergedOnError:u=>{if(!l.value)return;n.value=!0;const{onError:d,imgProps:{onError:f}={}}=e;d==null||d(u),f==null||f(u)},mergedOnLoad:u=>{const{onLoad:d,imgProps:{onLoad:f}={}}=e;d==null||d(u),f==null||f(u),s.value=!0}},a)},render(){var e,t;const{mergedClsPrefix:n,imgProps:o={},loaded:r,$attrs:i,lazy:a}=this,l=(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e),s=this.src||o.src,u=h("img",Object.assign(Object.assign({},o),{ref:"imageRef",width:this.width||o.width,height:this.height||o.height,src:this.showError?this.fallbackSrc:a&&this.intersectionObserverOptions?this.shouldStartLoading?s:void 0:s,alt:this.alt||o.alt,"aria-label":this.alt||o.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:isImageSupportNativeLazy&&a&&!this.intersectionObserverOptions?"lazy":"eager",style:[o.style||"",l&&!r?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return h("div",Object.assign({},i,{role:"none",class:[i.class,`${n}-image`,(this.previewDisabled||this.showError)&&`${n}-image--preview-disabled`]}),this.groupId?u:h(NImagePreview,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:n,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},{default:()=>u,toolbar:()=>{var d,f;return(f=(d=this.$slots).toolbar)===null||f===void 0?void 0:f.call(d)}}),!r&&l)}});function parse(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function isWipValue(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^\.\d+$/.test(e))}function validator(e){return e==null?!0:!Number.isNaN(e)}function format(e,t){return e==null?"":t===void 0?String(e):e.toFixed(t)}function parseNumber(e){if(e===null)return null;if(typeof e=="number")return e;{const t=Number(e);return Number.isNaN(t)?null:t}}const style$a=c$1([cB("input-number-suffix",` + `)])]),BLEEDING=32,NImagePreview=defineComponent({name:"ImagePreview",props:Object.assign(Object.assign({},imagePreviewSharedProps),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=useTheme("Image","-image",style$b,imageLight,e,toRef(e,"clsPrefix"));let n=null;const o=ref(null),r=ref(null),i=ref(void 0),a=ref(!1),l=ref(!1),{localeRef:s}=useLocale("Image");function u(){const{value:H}=r;if(!n||!H)return;const{style:q}=H,A=n.getBoundingClientRect(),Y=A.left+A.width/2,I=A.top+A.height/2;q.transformOrigin=`${Y}px ${I}px`}function d(H){var q,A;switch(H.key){case" ":H.preventDefault();break;case"ArrowLeft":(q=e.onPrev)===null||q===void 0||q.call(e);break;case"ArrowRight":(A=e.onNext)===null||A===void 0||A.call(e);break;case"Escape":he();break}}watch(a,H=>{H?on("keydown",document,d):off("keydown",document,d)}),onBeforeUnmount(()=>{off("keydown",document,d)});let f=0,v=0,g=0,p=0,m=0,C=0,b=0,x=0,S=!1;function w(H){const{clientX:q,clientY:A}=H;g=q-f,p=A-v,beforeNextFrameOnce(ie)}function y(H){const{mouseUpClientX:q,mouseUpClientY:A,mouseDownClientX:Y,mouseDownClientY:I}=H,U=Y-q,G=I-A,ne=`vertical${G>0?"Top":"Bottom"}`,se=`horizontal${U>0?"Left":"Right"}`;return{moveVerticalDirection:ne,moveHorizontalDirection:se,deltaHorizontal:U,deltaVertical:G}}function R(H){const{value:q}=o;if(!q)return{offsetX:0,offsetY:0};const A=q.getBoundingClientRect(),{moveVerticalDirection:Y,moveHorizontalDirection:I,deltaHorizontal:U,deltaVertical:G}=H||{};let ne=0,se=0;return A.width<=window.innerWidth?ne=0:A.left>0?ne=(A.width-window.innerWidth)/2:A.right0?se=(A.height-window.innerHeight)/2:A.bottom.5){const H=_;$-=1,_=Math.max(.5,Math.pow(E,$));const q=H-_;ie(!1);const A=R();_+=q,ie(!1),_-=q,g=A.offsetX,p=A.offsetY,ie()}}function ee(){const H=i.value;H&&download(H,void 0)}function ie(H=!0){var q;const{value:A}=o;if(!A)return;const{style:Y}=A,I=normalizeStyle((q=B==null?void 0:B.previewedImgPropsRef.value)===null||q===void 0?void 0:q.style);let U="";if(typeof I=="string")U=I+";";else for(const ne in I)U+=`${kebabCase$1(ne)}: ${I[ne]};`;const G=`transform-origin: center; transform: translateX(${g}px) translateY(${p}px) rotate(${O}deg) scale(${_});`;S?Y.cssText=U+"cursor: grabbing; transition: none;"+G:Y.cssText=U+"cursor: grab;"+G+(H?"":"transition: none;"),H||A.offsetHeight}function he(){a.value=!a.value,l.value=!0}function oe(){_=re(),$=Math.ceil(Math.log(_)/Math.log(E)),g=0,p=0,ie()}const ge={setPreviewSrc:H=>{i.value=H},setThumbnailEl:H=>{n=H},toggleShow:he};function pe(H,q){if(e.showToolbarTooltip){const{value:A}=t;return h(NTooltip,{to:!1,theme:A.peers.Tooltip,themeOverrides:A.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>s.value[q],trigger:()=>H})}else return H}const Se=computed(()=>{const{common:{cubicBezierEaseInOut:H},self:{toolbarIconColor:q,toolbarBorderRadius:A,toolbarBoxShadow:Y,toolbarColor:I}}=t.value;return{"--n-bezier":H,"--n-toolbar-icon-color":q,"--n-toolbar-color":I,"--n-toolbar-border-radius":A,"--n-toolbar-box-shadow":Y}}),{inlineThemeDisabled:ve}=useConfig(),ae=ve?useThemeClass("image-preview",void 0,Se,e):void 0;return Object.assign({previewRef:o,previewWrapperRef:r,previewSrc:i,show:a,appear:isMounted(),displayed:l,previewedImgProps:B==null?void 0:B.previewedImgPropsRef,handleWheel(H){H.preventDefault()},handlePreviewMousedown:T,handlePreviewDblclick:M,syncTransformOrigin:u,handleAfterLeave:()=>{N(),O=0,l.value=!1},handleDragStart:H=>{var q,A;(A=(q=B==null?void 0:B.previewedImgPropsRef.value)===null||q===void 0?void 0:q.onDragstart)===null||A===void 0||A.call(q,H),H.preventDefault()},zoomIn:L,zoomOut:W,handleDownloadClick:ee,rotateCounterclockwise:j,rotateClockwise:J,handleSwitchPrev:D,handleSwitchNext:F,withTooltip:pe,resizeToOrignalImageSize:oe,cssVars:ve?void 0:Se,themeClass:ae==null?void 0:ae.themeClass,onRender:ae==null?void 0:ae.onRender},ge)},render(){var e,t;const{clsPrefix:n,renderToolbar:o,withTooltip:r}=this,i=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleSwitchPrev},{default:()=>prevIcon}),"tipPrevious"),a=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleSwitchNext},{default:()=>nextIcon}),"tipNext"),l=r(h(NBaseIcon,{clsPrefix:n,onClick:this.rotateCounterclockwise},{default:()=>h(RotateCounterclockwiseIcon,null)}),"tipCounterclockwise"),s=r(h(NBaseIcon,{clsPrefix:n,onClick:this.rotateClockwise},{default:()=>h(RotateClockwiseIcon,null)}),"tipClockwise"),u=r(h(NBaseIcon,{clsPrefix:n,onClick:this.resizeToOrignalImageSize},{default:()=>h(ResizeSmallIcon,null)}),"tipOriginalSize"),d=r(h(NBaseIcon,{clsPrefix:n,onClick:this.zoomOut},{default:()=>h(ZoomOutIcon,null)}),"tipZoomOut"),f=r(h(NBaseIcon,{clsPrefix:n,onClick:this.handleDownloadClick},{default:()=>h(DownloadIcon,null)}),"tipDownload"),v=r(h(NBaseIcon,{clsPrefix:n,onClick:this.toggleShow},{default:()=>closeIcon}),"tipClose"),g=r(h(NBaseIcon,{clsPrefix:n,onClick:this.zoomIn},{default:()=>h(ZoomInIcon,null)}),"tipZoomIn");return h(Fragment,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),h(LazyTeleport,{show:this.show},{default:()=>{var p;return this.show||this.displayed?((p=this.onRender)===null||p===void 0||p.call(this),withDirectives(h("div",{class:[`${n}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},h(Transition,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?h("div",{class:`${n}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?h(Transition,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?h("div",{class:`${n}-image-preview-toolbar`},o?o({nodes:{prev:i,next:a,rotateCounterclockwise:l,rotateClockwise:s,resizeToOriginalSize:u,zoomOut:d,zoomIn:g,download:f,close:v}}):h(Fragment,null,this.onPrev?h(Fragment,null,i,a):null,l,s,u,d,g,f,v)):null}):null,h(Transition,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:m={}}=this;return withDirectives(h("div",{class:`${n}-image-preview-wrapper`,ref:"previewWrapperRef"},h("img",Object.assign({},m,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${n}-image-preview`,m.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[vShow,this.show]])}})),[[zindexable,{enabled:this.show}]])):null}}))}}),imageGroupInjectionKey=createInjectionKey("n-image-group"),imageGroupProps=imagePreviewSharedProps,NImageGroup=defineComponent({name:"ImageGroup",props:imageGroupProps,setup(e){let t;const{mergedClsPrefixRef:n}=useConfig(e),o=`c${createId()}`,r=getCurrentInstance(),i=s=>{var u;t=s,(u=l.value)===null||u===void 0||u.setPreviewSrc(s)};function a(s){var u,d;if(!(r!=null&&r.proxy))return;const v=r.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${o}]:not([data-error=true])`);if(!v.length)return;const g=Array.from(v).findIndex(p=>p.dataset.previewSrc===t);~g?i(v[(g+s+v.length)%v.length].dataset.previewSrc):i(v[0].dataset.previewSrc),s===1?(u=e.onPreviewNext)===null||u===void 0||u.call(e):(d=e.onPreviewPrev)===null||d===void 0||d.call(e)}provide(imageGroupInjectionKey,{mergedClsPrefixRef:n,setPreviewSrc:i,setThumbnailEl:s=>{var u;(u=l.value)===null||u===void 0||u.setThumbnailEl(s)},toggleShow:()=>{var s;(s=l.value)===null||s===void 0||s.toggleShow()},groupId:o,renderToolbarRef:toRef(e,"renderToolbar")});const l=ref(null);return{mergedClsPrefix:n,previewInstRef:l,next:()=>{a(1)},prev:()=>{a(-1)}}},render(){return h(NImagePreview,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},this.$slots)}}),imageProps=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},imagePreviewSharedProps),NImage=defineComponent({name:"Image",props:imageProps,inheritAttrs:!1,setup(e){const t=ref(null),n=ref(!1),o=ref(null),r=inject(imageGroupInjectionKey,null),{mergedClsPrefixRef:i}=r||useConfig(e),a={click:()=>{if(e.previewDisabled||n.value)return;const u=e.previewSrc||e.src;if(r){r.setPreviewSrc(u),r.setThumbnailEl(t.value),r.toggleShow();return}const{value:d}=o;d&&(d.setPreviewSrc(u),d.setThumbnailEl(t.value),d.toggleShow())}},l=ref(!e.lazy);onMounted(()=>{var u;(u=t.value)===null||u===void 0||u.setAttribute("data-group-id",(r==null?void 0:r.groupId)||"")}),onMounted(()=>{if(e.lazy&&e.intersectionObserverOptions){let u;const d=watchEffect(()=>{u==null||u(),u=void 0,u=observeIntersection(t.value,e.intersectionObserverOptions,l)});onBeforeUnmount(()=>{d(),u==null||u()})}}),watchEffect(()=>{var u;e.src||((u=e.imgProps)===null||u===void 0||u.src),n.value=!1});const s=ref(!1);return provide(imageContextKey,{previewedImgPropsRef:toRef(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:i,groupId:r==null?void 0:r.groupId,previewInstRef:o,imageRef:t,showError:n,shouldStartLoading:l,loaded:s,mergedOnClick:u=>{var d,f;a.click(),(f=(d=e.imgProps)===null||d===void 0?void 0:d.onClick)===null||f===void 0||f.call(d,u)},mergedOnError:u=>{if(!l.value)return;n.value=!0;const{onError:d,imgProps:{onError:f}={}}=e;d==null||d(u),f==null||f(u)},mergedOnLoad:u=>{const{onLoad:d,imgProps:{onLoad:f}={}}=e;d==null||d(u),f==null||f(u),s.value=!0}},a)},render(){var e,t;const{mergedClsPrefix:n,imgProps:o={},loaded:r,$attrs:i,lazy:a}=this,l=(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e),s=this.src||o.src,u=h("img",Object.assign(Object.assign({},o),{ref:"imageRef",width:this.width||o.width,height:this.height||o.height,src:this.showError?this.fallbackSrc:a&&this.intersectionObserverOptions?this.shouldStartLoading?s:void 0:s,alt:this.alt||o.alt,"aria-label":this.alt||o.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:isImageSupportNativeLazy&&a&&!this.intersectionObserverOptions?"lazy":"eager",style:[o.style||"",l&&!r?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return h("div",Object.assign({},i,{role:"none",class:[i.class,`${n}-image`,(this.previewDisabled||this.showError)&&`${n}-image--preview-disabled`]}),this.groupId?u:h(NImagePreview,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:n,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},{default:()=>u,toolbar:()=>{var d,f;return(f=(d=this.$slots).toolbar)===null||f===void 0?void 0:f.call(d)}}),!r&&l)}});function parse(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function isWipValue(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^\.\d+$/.test(e))}function validator(e){return e==null?!0:!Number.isNaN(e)}function format(e,t){return e==null?"":t===void 0?String(e):e.toFixed(t)}function parseNumber(e){if(e===null)return null;if(typeof e=="number")return e;{const t=Number(e);return Number.isNaN(t)?null:t}}const style$a=c$1([cB("input-number-suffix",` display: inline-block; margin-right: 10px; `),cB("input-number-prefix",` display: inline-block; margin-left: 10px; - `)]),HOLDING_CHANGE_THRESHOLD=800,HOLDING_CHANGE_INTERVAL=100,inputNumberProps=Object.assign(Object.assign({},useTheme.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),NInputNumber=defineComponent({name:"InputNumber",props:inputNumberProps,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,mergedRtlRef:o}=useConfig(e),r=useTheme("InputNumber","-input-number",style$a,inputNumberLight,e,n),{localeRef:i}=useLocale("InputNumber"),a=useFormItem(e),{mergedSizeRef:l,mergedDisabledRef:s,mergedStatusRef:u}=a,d=ref(null),f=ref(null),v=ref(null),g=ref(e.defaultValue),p=toRef(e,"value"),m=useMergedState(p,g),C=ref(""),b=I=>{const U=String(I).split(".")[1];return U?U.length:0},x=I=>{const U=[e.min,e.max,e.step,I].map(Y=>Y===void 0?0:b(Y));return Math.max(...U)},S=useMemo(()=>{const{placeholder:I}=e;return I!==void 0?I:i.value.placeholder}),w=useMemo(()=>{const I=parseNumber(e.step);return I!==null?I===0?1:Math.abs(I):1}),y=useMemo(()=>{const I=parseNumber(e.min);return I!==null?I:null}),R=useMemo(()=>{const I=parseNumber(e.max);return I!==null?I:null}),k=I=>{const{value:U}=m;if(I===U){T();return}const{"onUpdate:value":Y,onUpdateValue:ne,onChange:ue}=e,{nTriggerFormInput:xe,nTriggerFormChange:we}=a;ue&&call(ue,I),ne&&call(ne,I),Y&&call(Y,I),g.value=I,xe(),we()},B=({offset:I,doUpdateIfValid:U,fixPrecision:Y,isInputing:ne})=>{const{value:ue}=C;if(ne&&isWipValue(ue))return!1;const xe=(e.parse||parse)(ue);if(xe===null)return U&&k(null),null;if(validator(xe)){const we=b(xe),{precision:K}=e;if(K!==void 0&&Kme){if(!U||ne)return!1;Z=me}if(Pe!==null&&Z{const{value:I}=m;if(validator(I)){const{format:U,precision:Y}=e;U?C.value=U(I):I===null||Y===void 0||b(I)>Y?C.value=format(I,void 0):C.value=format(I,Y)}else C.value=String(I)};T();const M=useMemo(()=>B({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),E=useMemo(()=>{const{value:I}=m;if(e.validator&&I===null)return!1;const{value:U}=w;return B({offset:-U,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),$=useMemo(()=>{const{value:I}=m;if(e.validator&&I===null)return!1;const{value:U}=w;return B({offset:+U,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function _(I){const{onFocus:U}=e,{nTriggerFormFocus:Y}=a;U&&call(U,I),Y()}function O(I){var U,Y;if(I.target===((U=d.value)===null||U===void 0?void 0:U.wrapperElRef))return;const ne=B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(ne!==!1){const we=(Y=d.value)===null||Y===void 0?void 0:Y.inputElRef;we&&(we.value=String(ne||"")),m.value===ne&&T()}else T();const{onBlur:ue}=e,{nTriggerFormBlur:xe}=a;ue&&call(ue,I),xe(),nextTick(()=>{T()})}function N(I){const{onClear:U}=e;U&&call(U,I)}function D(){const{value:I}=$;if(!I){oe();return}const{value:U}=m;if(U===null)e.validator||k(Q());else{const{value:Y}=w;B({offset:Y,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function F(){const{value:I}=E;if(!I){he();return}const{value:U}=m;if(U===null)e.validator||k(Q());else{const{value:Y}=w;B({offset:-Y,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const j=_,J=O;function Q(){if(e.validator)return null;const{value:I}=y,{value:U}=R;return I!==null?Math.max(0,I):U!==null?Math.min(0,U):0}function re(I){N(I),k(null)}function L(I){var U,Y,ne;!((U=v.value)===null||U===void 0)&&U.$el.contains(I.target)&&I.preventDefault(),!((Y=f.value)===null||Y===void 0)&&Y.$el.contains(I.target)&&I.preventDefault(),(ne=d.value)===null||ne===void 0||ne.activate()}let W=null,ee=null,ie=null;function he(){ie&&(window.clearTimeout(ie),ie=null),W&&(window.clearInterval(W),W=null)}function oe(){pe&&(window.clearTimeout(pe),pe=null),ee&&(window.clearInterval(ee),ee=null)}function ge(){he(),ie=window.setTimeout(()=>{W=window.setInterval(()=>{F()},HOLDING_CHANGE_INTERVAL)},HOLDING_CHANGE_THRESHOLD),on("mouseup",document,he,{once:!0})}let pe=null;function Se(){oe(),pe=window.setTimeout(()=>{ee=window.setInterval(()=>{D()},HOLDING_CHANGE_INTERVAL)},HOLDING_CHANGE_THRESHOLD),on("mouseup",document,oe,{once:!0})}const ve=()=>{ee||D()},ae=()=>{W||F()};function H(I){var U,Y;if(I.key==="Enter"){if(I.target===((U=d.value)===null||U===void 0?void 0:U.wrapperElRef))return;B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((Y=d.value)===null||Y===void 0||Y.deactivate())}else if(I.key==="ArrowUp"){if(!$.value||e.keyboard.ArrowUp===!1)return;I.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&D()}else if(I.key==="ArrowDown"){if(!E.value||e.keyboard.ArrowDown===!1)return;I.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&F()}}function q(I){C.value=I,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&B({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}watch(m,()=>{T()});const A={focus:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.focus()},blur:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.blur()},select:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.select()}},X=useRtl("InputNumber",o,n);return Object.assign(Object.assign({},A),{rtlEnabled:X,inputInstRef:d,minusButtonInstRef:f,addButtonInstRef:v,mergedClsPrefix:n,mergedBordered:t,uncontrolledValue:g,mergedValue:m,mergedPlaceholder:S,displayedValueInvalid:M,mergedSize:l,mergedDisabled:s,displayedValue:C,addable:$,minusable:E,mergedStatus:u,handleFocus:j,handleBlur:J,handleClear:re,handleMouseDown:L,handleAddClick:ve,handleMinusClick:ae,handleAddMousedown:Se,handleMinusMousedown:ge,handleKeyDown:H,handleUpdateDisplayedValue:q,mergedTheme:r,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:computed(()=>{const{self:{iconColorDisabled:I}}=r.value,[U,Y,ne,ue]=rgba(I);return{textColorTextDisabled:`rgb(${U}, ${Y}, ${ne})`,opacityDisabled:`${ue}`}})})},render(){const{mergedClsPrefix:e,$slots:t}=this,n=()=>h(XButton,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>resolveSlot(t["minus-icon"],()=>[h(NBaseIcon,{clsPrefix:e},{default:()=>h(RemoveIcon,null)})])}),o=()=>h(XButton,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>resolveSlot(t["add-icon"],()=>[h(NBaseIcon,{clsPrefix:e},{default:()=>h(AddIcon,null)})])});return h("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},h(NInput,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var r;return this.showButton&&this.buttonPlacement==="both"?[n(),resolveWrappedSlot(t.prefix,i=>i?h("span",{class:`${e}-input-number-prefix`},i):null)]:(r=t.prefix)===null||r===void 0?void 0:r.call(t)},suffix:()=>{var r;return this.showButton?[resolveWrappedSlot(t.suffix,i=>i?h("span",{class:`${e}-input-number-suffix`},i):null),this.buttonPlacement==="right"?n():null,o()]:(r=t.suffix)===null||r===void 0?void 0:r.call(t)}}))}}),style$9=c$1([cB("list",` + `)]),HOLDING_CHANGE_THRESHOLD=800,HOLDING_CHANGE_INTERVAL=100,inputNumberProps=Object.assign(Object.assign({},useTheme.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),NInputNumber=defineComponent({name:"InputNumber",props:inputNumberProps,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,mergedRtlRef:o}=useConfig(e),r=useTheme("InputNumber","-input-number",style$a,inputNumberLight,e,n),{localeRef:i}=useLocale("InputNumber"),a=useFormItem(e),{mergedSizeRef:l,mergedDisabledRef:s,mergedStatusRef:u}=a,d=ref(null),f=ref(null),v=ref(null),g=ref(e.defaultValue),p=toRef(e,"value"),m=useMergedState(p,g),C=ref(""),b=I=>{const U=String(I).split(".")[1];return U?U.length:0},x=I=>{const U=[e.min,e.max,e.step,I].map(G=>G===void 0?0:b(G));return Math.max(...U)},S=useMemo(()=>{const{placeholder:I}=e;return I!==void 0?I:i.value.placeholder}),w=useMemo(()=>{const I=parseNumber(e.step);return I!==null?I===0?1:Math.abs(I):1}),y=useMemo(()=>{const I=parseNumber(e.min);return I!==null?I:null}),R=useMemo(()=>{const I=parseNumber(e.max);return I!==null?I:null}),k=I=>{const{value:U}=m;if(I===U){T();return}const{"onUpdate:value":G,onUpdateValue:ne,onChange:se}=e,{nTriggerFormInput:xe,nTriggerFormChange:we}=a;se&&call(se,I),ne&&call(ne,I),G&&call(G,I),g.value=I,xe(),we()},B=({offset:I,doUpdateIfValid:U,fixPrecision:G,isInputing:ne})=>{const{value:se}=C;if(ne&&isWipValue(se))return!1;const xe=(e.parse||parse)(se);if(xe===null)return U&&k(null),null;if(validator(xe)){const we=b(xe),{precision:K}=e;if(K!==void 0&&Kme){if(!U||ne)return!1;Z=me}if(Pe!==null&&Z{const{value:I}=m;if(validator(I)){const{format:U,precision:G}=e;U?C.value=U(I):I===null||G===void 0||b(I)>G?C.value=format(I,void 0):C.value=format(I,G)}else C.value=String(I)};T();const M=useMemo(()=>B({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),E=useMemo(()=>{const{value:I}=m;if(e.validator&&I===null)return!1;const{value:U}=w;return B({offset:-U,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),$=useMemo(()=>{const{value:I}=m;if(e.validator&&I===null)return!1;const{value:U}=w;return B({offset:+U,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function _(I){const{onFocus:U}=e,{nTriggerFormFocus:G}=a;U&&call(U,I),G()}function O(I){var U,G;if(I.target===((U=d.value)===null||U===void 0?void 0:U.wrapperElRef))return;const ne=B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(ne!==!1){const we=(G=d.value)===null||G===void 0?void 0:G.inputElRef;we&&(we.value=String(ne||"")),m.value===ne&&T()}else T();const{onBlur:se}=e,{nTriggerFormBlur:xe}=a;se&&call(se,I),xe(),nextTick(()=>{T()})}function N(I){const{onClear:U}=e;U&&call(U,I)}function D(){const{value:I}=$;if(!I){oe();return}const{value:U}=m;if(U===null)e.validator||k(Q());else{const{value:G}=w;B({offset:G,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function F(){const{value:I}=E;if(!I){he();return}const{value:U}=m;if(U===null)e.validator||k(Q());else{const{value:G}=w;B({offset:-G,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const j=_,J=O;function Q(){if(e.validator)return null;const{value:I}=y,{value:U}=R;return I!==null?Math.max(0,I):U!==null?Math.min(0,U):0}function re(I){N(I),k(null)}function L(I){var U,G,ne;!((U=v.value)===null||U===void 0)&&U.$el.contains(I.target)&&I.preventDefault(),!((G=f.value)===null||G===void 0)&&G.$el.contains(I.target)&&I.preventDefault(),(ne=d.value)===null||ne===void 0||ne.activate()}let W=null,ee=null,ie=null;function he(){ie&&(window.clearTimeout(ie),ie=null),W&&(window.clearInterval(W),W=null)}function oe(){pe&&(window.clearTimeout(pe),pe=null),ee&&(window.clearInterval(ee),ee=null)}function ge(){he(),ie=window.setTimeout(()=>{W=window.setInterval(()=>{F()},HOLDING_CHANGE_INTERVAL)},HOLDING_CHANGE_THRESHOLD),on("mouseup",document,he,{once:!0})}let pe=null;function Se(){oe(),pe=window.setTimeout(()=>{ee=window.setInterval(()=>{D()},HOLDING_CHANGE_INTERVAL)},HOLDING_CHANGE_THRESHOLD),on("mouseup",document,oe,{once:!0})}const ve=()=>{ee||D()},ae=()=>{W||F()};function H(I){var U,G;if(I.key==="Enter"){if(I.target===((U=d.value)===null||U===void 0?void 0:U.wrapperElRef))return;B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((G=d.value)===null||G===void 0||G.deactivate())}else if(I.key==="ArrowUp"){if(!$.value||e.keyboard.ArrowUp===!1)return;I.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&D()}else if(I.key==="ArrowDown"){if(!E.value||e.keyboard.ArrowDown===!1)return;I.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&F()}}function q(I){C.value=I,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&B({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}watch(m,()=>{T()});const A={focus:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.focus()},blur:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.blur()},select:()=>{var I;return(I=d.value)===null||I===void 0?void 0:I.select()}},Y=useRtl("InputNumber",o,n);return Object.assign(Object.assign({},A),{rtlEnabled:Y,inputInstRef:d,minusButtonInstRef:f,addButtonInstRef:v,mergedClsPrefix:n,mergedBordered:t,uncontrolledValue:g,mergedValue:m,mergedPlaceholder:S,displayedValueInvalid:M,mergedSize:l,mergedDisabled:s,displayedValue:C,addable:$,minusable:E,mergedStatus:u,handleFocus:j,handleBlur:J,handleClear:re,handleMouseDown:L,handleAddClick:ve,handleMinusClick:ae,handleAddMousedown:Se,handleMinusMousedown:ge,handleKeyDown:H,handleUpdateDisplayedValue:q,mergedTheme:r,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:computed(()=>{const{self:{iconColorDisabled:I}}=r.value,[U,G,ne,se]=rgba(I);return{textColorTextDisabled:`rgb(${U}, ${G}, ${ne})`,opacityDisabled:`${se}`}})})},render(){const{mergedClsPrefix:e,$slots:t}=this,n=()=>h(XButton,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>resolveSlot(t["minus-icon"],()=>[h(NBaseIcon,{clsPrefix:e},{default:()=>h(RemoveIcon,null)})])}),o=()=>h(XButton,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>resolveSlot(t["add-icon"],()=>[h(NBaseIcon,{clsPrefix:e},{default:()=>h(AddIcon,null)})])});return h("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},h(NInput,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var r;return this.showButton&&this.buttonPlacement==="both"?[n(),resolveWrappedSlot(t.prefix,i=>i?h("span",{class:`${e}-input-number-prefix`},i):null)]:(r=t.prefix)===null||r===void 0?void 0:r.call(t)},suffix:()=>{var r;return this.showButton?[resolveWrappedSlot(t.suffix,i=>i?h("span",{class:`${e}-input-number-suffix`},i):null),this.buttonPlacement==="right"?n():null,o()]:(r=t.suffix)===null||r===void 0?void 0:r.call(t)}}))}}),style$9=c$1([cB("list",` --n-merged-border-color: var(--n-border-color); --n-merged-color: var(--n-color); --n-merged-color-hover: var(--n-color-hover); @@ -2053,5 +2053,5 @@ import{v as vShow,i as inject,g as getCurrentInstance,w as watch,o as onBeforeUn /* 移除顶部边距 */\r .scroller>.scroller-positioner>.content {\r padding-top: 0 !important;\r -}`,settingSvgUrl="/web/assets/setting-c6ca7b14.svg",usePromptStore=defineStore("prompt-store",()=>{const e=ref([{type:1,name:"ChatGPT 中文调教指南 - 简体",url:"./data/prompts/prompts-zh.json",refer:"https://github.com/PlexPt/awesome-chatgpt-prompts-zh"},{type:1,name:"ChatGPT 中文调教指南 - 繁体",url:"./data/prompts/prompts-zh-TW.json",refer:"https://github.com/PlexPt/awesome-chatgpt-prompts-zh"},{type:1,name:"Awesome ChatGPT Prompts",url:"./data/prompts/prompts.csv",refer:"https://github.com/f/awesome-chatgpt-prompts"},{type:2,name:"",url:"",refer:""}]),t=ref(!1),n=ref(!1),o=ref([]),r=ref(""),i=ref(0),a=ref({isShow:!1,newPrompt:{act:"",prompt:""}}),l=computed(()=>{var u;return r.value?(u=o.value)==null?void 0:u.filter(d=>d.act.includes(r.value)||d.prompt.includes(r.value)):o.value});function s(u){if(u instanceof Array&&u.every(d=>d.act&&d.prompt)){if(o.value.length===0)return o.value.push(...u),{result:!0,data:{successCount:u.length}};const d=u.filter(f=>{var v;return(v=o.value)==null?void 0:v.every(g=>f.act!==g.act&&f.prompt!==g.prompt)});return o.value.push(...d),{result:!0,data:{successCount:d.length}}}else return{result:!1,msg:"提示词格式有误"}}return{promptDownloadConfig:e,isShowPromptSotre:t,isShowChatPrompt:n,promptList:o,keyword:r,searchPromptList:l,selectedPromptIndex:i,optPromptConfig:a,addPrompt:s}},{persist:{key:"prompt-store",storage:localStorage,paths:["promptList"]}}),_hoisted_1$8=["href"],_hoisted_2$6={key:1},_sfc_main$9=defineComponent({__name:"ChatNavItem",props:{navConfig:{}},setup(e){return(t,n)=>t.navConfig.url?(openBlock(),createElementBlock("a",{key:0,href:t.navConfig.url,target:"_blank",rel:"noopener noreferrer"},toDisplayString(t.navConfig.label),9,_hoisted_1$8)):(openBlock(),createElementBlock("div",_hoisted_2$6,toDisplayString(t.navConfig.label),1))}}),_hoisted_1$7={class:"flex justify-center gap-3 px-8"},_hoisted_2$5={class:"flex justify-center items-center"},_hoisted_3$4=["src"],_hoisted_4$4=createBaseVNode("p",{class:"text-left"},"提示:形容词+名词+动词+风格,描述得越详细时,效果越好。",-1),DEMO_KEYWORD="骑着摩托的小猫咪,疾驰在路上,动漫场景,详细的细节。",_sfc_main$8=defineComponent({__name:"CreateImage",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=e,o=t,r=useMessage(),i=ref(""),a=ref(""),l=ref(!1),s=computed({get:()=>n.show,set:v=>o("update:show",v)}),u=()=>{if(!i.value){r.error("请先输入关键词");return}l.value=!0,a.value=`/images/create?re=1&showselective=1&sude=1&kseed=7500&SFX=2&q=${encodeURIComponent(i.value)}&t=${Date.now()}`},d=()=>{i.value="",a.value=""},f=()=>(i.value=DEMO_KEYWORD,u());return(v,g)=>(openBlock(),createBlock(unref(NModal),{class:"w-11/12 lg:w-[540px] select-none",show:s.value,"onUpdate:show":g[2]||(g[2]=p=>s.value=p),"on-close":d,preset:"card",title:"图像创建"},{default:withCtx(()=>[createBaseVNode("head",_hoisted_1$7,[createVNode(unref(NInput),{class:"flex-1",placeholder:"提示词",value:i.value,"onUpdate:value":g[0]||(g[0]=p=>i.value=p),clearable:!0,onKeyup:withKeys(u,["enter"]),maxlength:"100"},null,8,["value"]),createVNode(unref(NButton),{secondary:"",type:"info",onClick:u,loading:l.value},{default:withCtx(()=>[createTextVNode("开始创建")]),_:1},8,["loading"])]),createBaseVNode("main",_hoisted_2$5,[a.value?(openBlock(),createElementBlock("iframe",{key:0,class:"w-[310px] h-[350px] xl:w-[475px] xl:h-[520px] my-4",src:a.value,frameborder:"0",onLoad:g[1]||(g[1]=p=>l.value=!1)},null,40,_hoisted_3$4)):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"h-[40vh] xl:h-[60vh] flex justify-center items-center",description:"暂未创建"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:f},{default:withCtx(()=>[createTextVNode("使用示例创建")]),_:1}),createBaseVNode("div",{class:"text-[#c2c2c2] px-2 xl:px-10"},[_hoisted_4$4,createBaseVNode("p",{class:"text-left"},"示例:"+toDisplayString(DEMO_KEYWORD))])]),_:1}))])]),_:1},8,["show"]))}}),useChatStore=defineStore("chat-store",()=>{const e="/sydney/ChatHub",t=ref(!1),n=ref(""),o=ref([{baseUrl:"https://sydney.bing.com",label:"Bing 官方"},{baseUrl:"https://sydney.b1ng.chat",label:"Cloudflare Worker"},{baseUrl:location.origin,label:"本站"},{baseUrl:"",label:"自定义",isCus:!0}]),r=3e3,i=async l=>{if(!l.baseUrl)return{isUsable:!1,errorMsg:"链接不可为空"};try{const s=Date.now(),u=new WebSocket(l.baseUrl.replace("http","ws")+e),d=setTimeout(()=>{u.close()},r);return await new Promise((f,v)=>{u.onopen=()=>{clearTimeout(d),f(u.close())},u.onerror=()=>{clearTimeout(d),v(new Error(`聊天服务器 ${l.baseUrl} 连接失败`))},u.onclose=()=>v(new Error(`聊天服务器 ${l.baseUrl} 连接超时`))}),{isUsable:!0,delay:Date.now()-s}}catch(s){return{isUsable:!1,errorMsg:s instanceof Error?s.message:""}}};return{isShowChatServiceSelectModal:t,sydneyConfigs:o,selectedSydneyBaseUrl:n,checkSydneyConfig:i,checkAllSydneyConfig:async()=>{const l=o.value.filter(s=>s.baseUrl).map(async s=>{const u=await i(s);s.isUsable=u.isUsable,s.delay=u.delay});await Promise.all(l)}}},{persist:{key:"chat-store",storage:localStorage,paths:["selectedSydneyBaseUrl","sydneyConfigs"]}}),_hoisted_1$6=createBaseVNode("div",{class:"text-3xl py-2"},"账号登录",-1),_hoisted_2$4={key:0},_hoisted_3$3={key:0,style:{"margin-top":"12px","margin-bottom":"24px"}},_hoisted_4$3=createBaseVNode("br",null,null,-1),_hoisted_5$2={key:1},_hoisted_6$1=["src"],_hoisted_7$1={key:1},_hoisted_8=createBaseVNode("div",{class:"text-3xl py-2"},"设置",-1),_hoisted_9=createBaseVNode("div",{class:"text-3xl py-2"},"Cookie 设置",-1),_hoisted_10=createBaseVNode("div",{class:"text-3xl py-2"},"高级设置",-1),_hoisted_11=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[createBaseVNode("path",{d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26zm64 226H200v-32h44v-88h-32v-32h64v120h44z",fill:"currentColor"})],-1),_hoisted_12=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[createBaseVNode("path",{d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26zm64 226H200v-32h44v-88h-32v-32h64v120h44z",fill:"currentColor"})],-1),_hoisted_13=createBaseVNode("div",{class:"text-xl py-2"},"将删除包括 Cookie 等的所有缓存?",-1),_hoisted_14=createBaseVNode("div",{class:"text-3xl py-2"},"关于",-1),_sfc_main$7=defineComponent({__name:"ChatNav",setup(__props){const isShowMore=ref(!1),isShowSettingModal=ref(!1),isShowAdvancedSettingModal=ref(!1),isShowSetAboutModal=ref(!1),isShowCookieModal=ref(!1),isShowLoginModal=ref(!1),isShowIframe=ref(!1),userToken=ref(""),userKievRPSSecAuth=ref(""),userMUID=ref(""),userRwBf=ref(""),message=useMessage(),promptStore=usePromptStore(),{isShowPromptSotre}=storeToRefs(promptStore),isShowClearCacheModal=ref(!1),isShowCreateImageModal=ref(!1),chatStore=useChatStore(),{isShowChatServiceSelectModal}=storeToRefs(chatStore),userStore=useUserStore(),localVersion="2.4.0",lastVersion=ref("加载中..."),{historyEnable,themeMode,uiVersion,langRegion,autoReopenMic,fullCookiesEnable,cookiesStr,enterpriseEnable,copilotProEnable,customChatNum,gpt4tEnable,sydneyEnable,sydneyPrompt,passServer}=storeToRefs(userStore);let cookiesEnable=ref(!1),cookies=ref(""),history=ref(!0),themeModeSetting=ref("auto"),uiVersionSetting=ref("v3"),langRegionSetting=ref("CN"),theme=ref(inject("theme")),autoReopenMicSetting=ref(!0),settingIconStyle=ref({filter:"invert(70%)"}),passingCFChallenge=ref(!1);const enterpriseSetting=ref(!1),copilotProSetting=ref(!1),customChatNumSetting=ref(0),gpt4tSetting=ref(!0),sydneySetting=ref(!1),sydneyPromptSetting=ref(""),passServerSetting=ref(""),getCookieTip=ref("获取 Cookie 中, 请稍后..."),bingUrl=base58Decode("7RYHpA38gs3NAby2mkvoRMwjncBpS"),oneKeyLogin=ref("false"),loginTypeOptions=ref([{label:"账号登录",value:"false"},{label:"一键登录",value:"true"}]),msLoginAccount=ref(""),msLoginPassword=ref(""),msLoginType=ref("passwd"),msLoginCode=ref(""),msLogining=ref(!1),msContinueing=ref(!1),msLoginTypeOptions=ref([{label:"密码登录",value:"passwd"},{label:"邮箱验证码登录",value:"email"},{label:"2FA登录",value:"device"}]),msLoginContext=ref({cookies:"",context:{}}),GetLastVersion=async()=>{const t=await(await fetch("https://api.github.com/repos/Harry-zklcdc/go-proxy-bingai/releases/latest")).json();lastVersion.value=t.tag_name},navType={login:"login",setting:"setting",chat:"chat",notebook:"notebook",compose:"compose",createImage:"createImage",reset:"reset",about:"about"};let navConfigs=ref([{key:navType.setting,label:"设置"},{key:navType.notebook,label:"笔记本"},{key:navType.compose,label:"撰写文章",url:"/web/compose.html"},{key:navType.createImage,label:"图像创建"},{key:navType.reset,label:"一键重置"},{key:navType.about,label:"关于"}]);const themeModeOptions=ref([{label:"浅色",value:"light"},{label:"深色",value:"dark"},{label:"跟随系统",value:"auto"}]),uiVersionOptions=ref([{label:"V1",value:"v1"},{label:"V2",value:"v2"},{label:"V3",value:"v3"}]),langRegionOptions=ref([{label:"中文优先",value:"CN"},{label:"英文优先",value:"US"}]);onMounted(()=>{themeMode.value=="light"?settingIconStyle.value={filter:"invert(0%)"}:themeMode.value=="dark"?settingIconStyle.value={filter:"invert(70%)"}:themeMode.value=="auto"&&(useOsTheme().value=="dark"?settingIconStyle.value={filter:"invert(70%)"}:settingIconStyle.value={filter:"invert(0%)"})});const sleep=async e=>new Promise(t=>setTimeout(t,e)),renderDropdownLabel=e=>h(_sfc_main$9,{navConfig:e}),handleSelect=async e=>{var t,n,o,r,i,a,l,s,u,d,f,v,g,p,m,C,b,x,S,w,y;switch(e){case navType.chat:{CIB.showConversation(),navConfigs.value[1]={key:navType.notebook,label:"笔记本"};const R=CIB.config.sydney.request.optionsSets.indexOf("prjupy"),k=CIB.config.sydney.request.optionsSets.indexOf("clgalileo");CIB.config.sydney.request.optionsSets=CIB.config.sydney.request.optionsSets.slice(0,R),k>-1&&(CIB.config.sydney.request.optionsSets[k]="galileo"),uiVersion.value=="v3"&&(await sleep(25),await ChatHomeScreen.init("/turing/api/suggestions/v2/zeroinputstarter"));const B=document.querySelector("cib-serp"),T=(t=B==null?void 0:B.shadowRoot)==null?void 0:t.querySelector("cib-conversation"),M=(n=T==null?void 0:T.shadowRoot)==null?void 0:n.querySelector("cib-welcome-container"),E=(o=M==null?void 0:M.shadowRoot)==null?void 0:o.querySelectorAll("div[class='muid-upsell']");E!=null&&E.length&&E.forEach(_=>{_.remove()}),(i=(r=M==null?void 0:M.shadowRoot)==null?void 0:r.querySelector(".preview-container"))==null||i.remove(),(l=(a=M==null?void 0:M.shadowRoot)==null?void 0:a.querySelector(".footer"))==null||l.remove(),(u=(s=B==null?void 0:B.shadowRoot)==null?void 0:s.querySelector("cib-serp-feedback"))==null||u.remove(),isMobile()&&((f=(d=M==null?void 0:M.shadowRoot)==null?void 0:d.querySelector(".container-item"))==null||f.remove(),CIB.vm.actionBar.input.placeholder='有问题尽管问我...("/" 触发提示词)');const $=document.createElement("style");$.innerText=conversationCssText,(v=T.shadowRoot)==null||v.append($)}break;case navType.notebook:{CIB.showNotebook();const R=CIB.config.sydney.request.optionsSets.indexOf("galileo");R>-1&&(CIB.config.sydney.request.optionsSets[R]="clgalileo"),CIB.config.sydney.request.optionsSets.push("prjupy","uprofdeuv1","uprofupdv2","gndlogcf"),navConfigs.value[1]={key:navType.chat,label:"聊天"},await sleep(25);const k=document.querySelector("cib-serp"),B=(g=k==null?void 0:k.shadowRoot)==null?void 0:g.querySelector("cib-notebook"),T=(p=B==null?void 0:B.shadowRoot)==null?void 0:p.querySelector("cib-ai-disclaimer");(C=(m=T==null?void 0:T.shadowRoot)==null?void 0:m.querySelector("div"))==null||C.remove(),(x=(b=T==null?void 0:T.shadowRoot)==null?void 0:b.querySelector("div"))==null||x.remove()}break;case navType.setting:isShowSettingModal.value=!0;break;case navType.createImage:!((S=userStore.sysConfig)!=null&&S.isSysCK)&&!userStore.getUserToken()&&message.warning("体验画图功能需先登录"),isShowCreateImageModal.value=!0;break;case navType.reset:isShowClearCacheModal.value=!0;break;case navType.about:{isShowSetAboutModal.value=!0,GetLastVersion(),await sleep(25);const R=document.createElement("div");render$1(h(NConfigProvider,{theme:theme.value},[h(NForm,{"label-placement":"left","label-width":"82px",size:"small",style:"margin-top: 0px"},authorEleRender())]),R);for(let k=0;k{switch(e){case"autoPassCFChallenge":autoPassCFChallenge();break;case"login":isShowLoginModal.value=!0,isShowIframe.value=!1;break;case"chatService":isShowChatServiceSelectModal.value=!0,chatStore.checkAllSydneyConfig();break;case"cookieSetting":userToken.value=userStore.getUserToken(),userKievRPSSecAuth.value=userStore.getUserKievRPSSecAuth(),userMUID.value=userStore.getUserMUID(),userRwBf.value=userStore.getUserRwBf(),history.value=historyEnable.value,cookiesEnable.value=fullCookiesEnable.value,cookies.value=cookiesStr.value,isShowCookieModal.value=!0;break;case"promptStore":isShowPromptSotre.value=!0;break;case"advancedSetting":history.value=historyEnable.value,themeModeSetting.value=themeMode.value,uiVersionSetting.value=uiVersion.value,langRegionSetting.value=langRegion.value,copilotProSetting.value=copilotProEnable.value,enterpriseSetting.value=enterpriseEnable.value,customChatNumSetting.value=customChatNum.value,gpt4tSetting.value=gpt4tEnable.value,autoReopenMicSetting.value=autoReopenMic.value,sydneySetting.value=sydneyEnable.value,sydneyPromptSetting.value=sydneyPrompt.value,passServerSetting.value=passServer.value,isShowAdvancedSettingModal.value=!0;break;default:return}},resetCache=async()=>{isShowClearCacheModal.value=!1,await userStore.resetCache(),message.success("清理完成"),window.location.href="/"},saveSetting=()=>{cookiesEnable.value?(userStore.saveCookies(cookies.value),cookiesStr.value=cookies.value):(userToken.value?userStore.saveUserToken(userToken.value):message.warning("请先填入用户 _U Cookie"),userKievRPSSecAuth.value?userStore.saveUserKievRPSSecAuth(userKievRPSSecAuth.value):message.warning("请先填入用户 KievRPSSecAuth Cookie"),userRwBf.value?userStore.saveUserRwBf(userRwBf.value):message.warning("请先填入用户 _RwBf Cookie"),userMUID.value?userStore.saveUserMUID(userMUID.value):message.warning("请先填入用户 MUID Cookie")),fullCookiesEnable.value=cookiesEnable.value,isShowCookieModal.value=!1},saveAdvancedSetting=()=>{var u,d,f,v;historyEnable.value=history.value;const e=enterpriseEnable.value;enterpriseEnable.value=enterpriseSetting.value,customChatNum.value=customChatNumSetting.value;const t=gpt4tEnable.value,n=sydneyEnable.value,o=uiVersion.value,r=copilotProEnable.value;copilotProEnable.value=copilotProSetting.value,gpt4tEnable.value=gpt4tSetting.value,autoReopenMic.value=autoReopenMicSetting.value,sydneyEnable.value=sydneySetting.value,sydneyPrompt.value=sydneyPromptSetting.value,uiVersion.value=uiVersionSetting.value,passServerSetting.value&&passServerSetting.value.startsWith("http")&&userStore.setPassServer(passServerSetting.value),langRegion.value!=langRegionSetting.value&&(langRegion.value=langRegionSetting.value,_G.Region=langRegionSetting.value);const i=document.querySelector("cib-serp"),a=(v=(f=(d=(u=i==null?void 0:i.shadowRoot)==null?void 0:u.querySelector("cib-conversation"))==null?void 0:d.querySelector("cib-side-panel"))==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(".main"),l=a==null?void 0:a.querySelector(".threads-header"),s=a==null?void 0:a.querySelector(".threads-container");isMobile()||(history.value&&userStore.getUserToken()&&!enterpriseEnable.value?o==="v1"?CIB.vm.sidePanel.panels=[{type:"threads",label:"最近的活动"},{type:"plugins",label:"插件"}]:(l.style.display="flex",s.style.display="block"):o==="v2"?(l.style.display="none",s.style.display="none"):(CIB.vm.sidePanel.panels=[{type:"plugins",label:"插件"}],CIB.vm.sidePanel.selectedPanel="plugins")),themeMode.value=themeModeSetting.value,themeModeSetting.value=="light"?(CIB.changeColorScheme(0),theme.value=lightTheme,settingIconStyle.value={filter:"invert(0%)"}):themeModeSetting.value=="dark"?(CIB.changeColorScheme(1),theme.value=darkTheme,settingIconStyle.value={filter:"invert(70%)"}):themeModeSetting.value=="auto"&&(useOsTheme().value=="dark"?(CIB.changeColorScheme(1),theme.value=darkTheme,settingIconStyle.value={filter:"invert(70%)"}):(CIB.changeColorScheme(0),theme.value=lightTheme,settingIconStyle.value={filter:"invert(0%)"})),isShowAdvancedSettingModal.value=!1,(e!=enterpriseSetting.value||n!=sydneySetting.value||t!=gpt4tSetting.value||o!=uiVersionSetting.value||r!=copilotProSetting.value)&&(window.location.href="/")},newWindow=()=>{window.open("/fd/auth/signin?action=interactive&provider=windows_live_id&return_url=https%3a%2f%2fwww.bing.com%2fchat%3fq%3dBing%2bAI%26FORM%3dhpcodx%26wlsso%3d1%26wlexpsignin%3d1&src=EXPLICIT&sig=001DD71D5A386F753B1FC3055B306E8F","_blank")},loginHandel=async()=>{isShowIframe.value=!0,getCookieTip.value="获取 Cookie 中, 请稍后...",window.addEventListener("message",function(r){const i=r.data;i.cookies!=""&&i.cookies!=null&&i.cookies!=null&&(userStore.saveCookies(i.cookies),cookiesStr.value=i.cookies,message.success("登录成功"),isShowLoginModal.value=!1,window.location.href="/")}),await sleep(1500),getCookieTimeoutHandel();const e=document.getElementById("login"),t=base58Decode(_G.S);let n=[];for(let r=0;r<_G.SP.length;r++)n.push(t[_G.SP[r]]);const o=base58Decode(n.join(""));e.contentWindow.postMessage({IG:_G.IG,T:await aesEncrypt(o,_G.IG)},"*")},msLoginHandel=async()=>{switch(msLogining.value=!0,msLoginType.value){case"passwd":{if(msLoginAccount.value){if(!msLoginPassword.value){message.warning("请先填入密码"),msLogining.value=!1;break}}else{message.warning("请先填入账号"),msLogining.value=!1;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,password:msLoginPassword.value,type:msLoginType.value})});if(!e.ok){message.error("登录失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;case"email":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!1;break}const e=await fetch("/api/ms/login",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value,verify_code:msLoginCode.value,cookies:msLoginContext.value.cookies,context:msLoginContext.value.context})});if(!e.ok){message.error("登录失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;case"device":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value})}),t=await e.json();if(e.status!=201){message.error("获取2FA失败, 请重试"),msLogining.value=!1;break}message.success("获取2FA成功, 请在手机上查看并输入验证码"),msLoginCode.value=t.data.code,msLoginContext.value.cookies=t.data.cookies,msLoginContext.value.context=t.data.context,await msLoginContinueHandel()}break;default:msLogining.value=!1;break}},msLoginContinueHandel=async()=>{switch(msContinueing.value=!0,msLoginType.value){case"email":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value})});if(e.status!=201){message.error("获取邮箱验证码失败, 请重试"),msContinueing.value=!1;break}message.success("获取邮箱验证码成功, 请检查邮箱"),msContinueing.value=!1;const t=await e.json();msLoginContext.value.cookies=t.data.cookies,msLoginContext.value.context=t.data.context}break;case"device":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value,cookies:msLoginContext.value.cookies,context:msLoginContext.value.context})});if(!e.ok){message.error("获取2FA失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;default:msContinueing.value=!1;break}},authorEleRender=()=>{const e=JSON.parse(decodeURI(base58Decode(_G.TP)));let t=[];for(let n=0;nh(eval(ele.type),ele.props,ele.children.map(e=>e.type?renderHandler(e):e)),getCookieTimeoutHandel=async()=>{await sleep(3e3),getCookieTip.value="获取 Cookie 时间过长, 请检查油猴插件及脚本是否安装正确"},autoPassCFChallenge=async()=>{let e=await fetch("/pass",{credentials:"include",method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({IG:_G.IG,T:await aesEncrypt(_G.AT,_G.IG)})}).then(t=>t.json()).catch(()=>{message.error("人机验证失败, 请重试"),passingCFChallenge.value=!1});e.result!=null&&e.result!=null?(userStore.saveCookies(e.result.cookies),cookiesStr.value=e.result.cookies,message.success("自动通过人机验证成功"),passingCFChallenge.value=!1,window.location.href="/"):(message.error("人机验证失败, 请重试"),passingCFChallenge.value=!1)};return(e,t)=>(openBlock(),createElementBlock(Fragment,null,[unref(isMobile)()?(openBlock(),createBlock(unref(NDropdown),{key:0,class:"select-none",show:isShowMore.value,options:unref(navConfigs),"render-label":renderDropdownLabel,onSelect:handleSelect},{default:withCtx(()=>[createVNode(unref(NImage),{class:"fixed top-6 right-4 cursor-pointer z-50",src:unref(settingSvgUrl),alt:"设置菜单","preview-disabled":!0,onClick:t[0]||(t[0]=n=>isShowMore.value=!isShowMore.value),style:normalizeStyle(unref(settingIconStyle))},null,8,["src","style"])]),_:1},8,["show","options"])):(openBlock(),createBlock(unref(NDropdown),{key:1,class:"select-none",trigger:"hover",options:unref(navConfigs),"render-label":renderDropdownLabel,onSelect:handleSelect},{default:withCtx(()=>[createVNode(unref(NImage),{class:"fixed top-6 right-6 cursor-pointer z-50",src:unref(settingSvgUrl),alt:"设置菜单","preview-disabled":!0,style:normalizeStyle(unref(settingIconStyle))},null,8,["src","style"])]),_:1},8,["options"])),createVNode(unref(NModal),{show:isShowLoginModal.value,"onUpdate:show":t[7]||(t[7]=n=>isShowLoginModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_1$6]),action:withCtx(()=>[withDirectives(createVNode(unref(NButton),{size:"large",type:"info",onClick:newWindow},{default:withCtx(()=>[createTextVNode("打开登录页面")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{size:"large",onClick:t[6]||(t[6]=n=>isShowLoginModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:loginHandel},{default:withCtx(()=>[createTextVNode("确定")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{size:"large",type:"info",loading:msContinueing.value,onClick:msLoginContinueHandel},{default:withCtx(()=>[createTextVNode("获取邮箱验证码")]),_:1},8,["loading"]),[[vShow,oneKeyLogin.value!="true"&&msLoginType.value==="email"]]),withDirectives(createVNode(unref(NButton),{ghost:"",size:"large",type:"info",loading:msLogining.value,onClick:msLoginHandel},{default:withCtx(()=>[createTextVNode("确定")]),_:1},8,["loading"]),[[vShow,oneKeyLogin.value!="true"]])]),default:withCtx(()=>[createVNode(unref(NSelect),{value:oneKeyLogin.value,"onUpdate:value":t[1]||(t[1]=n=>oneKeyLogin.value=n),options:loginTypeOptions.value,size:"large",placeholder:"选择登录方式"},null,8,["value","options"]),oneKeyLogin.value=="true"?(openBlock(),createElementBlock("div",_hoisted_2$4,[isShowIframe.value?(openBlock(),createElementBlock("div",_hoisted_5$2,[createVNode(unref(NSpin),{size:"large",description:getCookieTip.value,style:{margin:"0 auto",width:"100%"}},null,8,["description"]),createBaseVNode("iframe",{id:"login",src:unref(bingUrl),style:{border:"none",width:"0",height:"0"}},null,8,_hoisted_6$1)])):(openBlock(),createElementBlock("div",_hoisted_3$3,[createVNode(unref(NP),null,{default:withCtx(()=>[createTextVNode(" 使用此功能前, 请先安装"),createVNode(unref(NA),{href:"https://www.tampermonkey.net/"},{default:withCtx(()=>[createTextVNode("油猴插件")]),_:1}),createTextVNode(", 并安装"),createVNode(unref(NA),{href:"https://greasyfork.org/zh-CN/scripts/487409-go-proxy-bingai"},{default:withCtx(()=>[createTextVNode("此脚本")]),_:1}),_hoisted_4$3,createTextVNode(" 请点击下面「打开登录页面」按钮, 在新打开登录页面中登录账号, 登录成功后点击确定 ")]),_:1})]))])):(openBlock(),createElementBlock("div",_hoisted_7$1,[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"登录方式"},{default:withCtx(()=>[createVNode(unref(NRadioGroup),{value:msLoginType.value,"onUpdate:value":t[2]||(t[2]=n=>msLoginType.value=n)},{default:withCtx(()=>[createVNode(unref(NSpace),{vertical:""},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(msLoginTypeOptions.value,n=>(openBlock(),createBlock(unref(NRadio),{size:"large",key:n.value,value:n.value},{default:withCtx(()=>[createTextVNode(toDisplayString(n.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"account",label:"账号"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginAccount.value,"onUpdate:value":t[3]||(t[3]=n=>msLoginAccount.value=n),type:"text",placeholder:"账号"},null,8,["value"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"password",label:" 密码"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginPassword.value,"onUpdate:value":t[4]||(t[4]=n=>msLoginPassword.value=n),type:"password","show-password-on":"click",placeholder:"密码"},null,8,["value"])]),_:1},512),[[vShow,msLoginType.value==="passwd"]]),withDirectives(createVNode(unref(NFormItem),{path:"verify_code",label:"验证码"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginCode.value,"onUpdate:value":t[5]||(t[5]=n=>msLoginCode.value=n),type:"text",placeholder:"验证码",disabled:msLoginType.value==="device"},null,8,["value","disabled"])]),_:1},512),[[vShow,msLoginType.value!=="passwd"]])]),_:1},512)]))]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowSettingModal.value,"onUpdate:show":t[15]||(t[15]=n=>isShowSettingModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_8]),action:withCtx(()=>[createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:t[14]||(t[14]=n=>isShowSettingModal.value=!1)},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NGrid),{"x-gap":"0",cols:2},{default:withCtx(()=>[createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"自动人机验证"},{default:withCtx(()=>[createVNode(unref(NTooltip),null,{trigger:withCtx(()=>[createVNode(unref(NButton),{type:"info",loading:unref(passingCFChallenge),onClick:t[8]||(t[8]=n=>settingMenu("autoPassCFChallenge"))},{default:withCtx(()=>[createTextVNode("启动")]),_:1},8,["loading"])]),default:withCtx(()=>[createTextVNode(" 旧版本的人机验证, 现已完全自动代理通过 ")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"账号登录"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[9]||(t[9]=n=>settingMenu("login"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"服务选择"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[10]||(t[10]=n=>settingMenu("chatService"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"Cookie 设置"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[11]||(t[11]=n=>settingMenu("cookieSetting"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"提示词库"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[12]||(t[12]=n=>settingMenu("promptStore"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"高级设置"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[13]||(t[13]=n=>settingMenu("advancedSetting"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowCookieModal.value,"onUpdate:show":t[23]||(t[23]=n=>isShowCookieModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_9]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[22]||(t[22]=n=>isShowCookieModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:saveSetting},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"完整 Cookie"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(cookiesEnable),"onUpdate:value":t[16]||(t[16]=n=>isRef(cookiesEnable)?cookiesEnable.value=n:cookiesEnable=n)},null,8,["value"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"Token"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userToken.value,"onUpdate:value":t[17]||(t[17]=n=>userToken.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 _U 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"KievRPSSecAuth"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userKievRPSSecAuth.value,"onUpdate:value":t[18]||(t[18]=n=>userKievRPSSecAuth.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 KievRPSSecAuth 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"_RwBf"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userRwBf.value,"onUpdate:value":t[19]||(t[19]=n=>userRwBf.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 _RwBf 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"MUID"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userMUID.value,"onUpdate:value":t[20]||(t[20]=n=>userMUID.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 MUID 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"Cookies"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:unref(cookies),"onUpdate:value":t[21]||(t[21]=n=>isRef(cookies)?cookies.value=n:cookies=n),type:"text",placeholder:"完整用户 Cookie"},null,8,["value"])]),_:1},512),[[vShow,unref(cookiesEnable)]])]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowAdvancedSettingModal.value,"onUpdate:show":t[37]||(t[37]=n=>isShowAdvancedSettingModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_10]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[36]||(t[36]=n=>isShowAdvancedSettingModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:saveAdvancedSetting},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NGrid),{"x-gap":"0",cols:2},{default:withCtx(()=>[createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"history",label:"历史记录"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(history),"onUpdate:value":t[24]||(t[24]=n=>isRef(history)?history.value=n:history=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"enterpriseEnable",label:"企业版"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:enterpriseSetting.value,"onUpdate:value":t[25]||(t[25]=n=>enterpriseSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"copilotProEnable"},{label:withCtx(()=>[createTextVNode(" Copilot Pro "),createVNode(unref(NTooltip),{trigger:"hover"},{trigger:withCtx(()=>[createVNode(unref(NIcon),{size:"14",style:{top:"2px"}},{default:withCtx(()=>[_hoisted_11]),_:1})]),default:withCtx(()=>[createTextVNode(" 如果有 Copilot Pro 的账号, 可开启此选项 ")]),_:1})]),default:withCtx(()=>[createVNode(unref(NSwitch),{value:copilotProSetting.value,"onUpdate:value":t[26]||(t[26]=n=>copilotProSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"sydneyEnable",label:"连续语音对话"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(autoReopenMicSetting),"onUpdate:value":t[27]||(t[27]=n=>isRef(autoReopenMicSetting)?autoReopenMicSetting.value=n:autoReopenMicSetting=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"gpt4tEnable"},{label:withCtx(()=>[createTextVNode(" Copilot 增强 "),createVNode(unref(NTooltip),{trigger:"hover",style:{maxWidth:"240px"}},{trigger:withCtx(()=>[createVNode(unref(NIcon),{size:"14",style:{top:"2px"}},{default:withCtx(()=>[_hoisted_12]),_:1})]),default:withCtx(()=>[createTextVNode(" 增强 Microsoft Copilot 的能力, 有可能会导致一些问题 ")]),_:1})]),default:withCtx(()=>[createVNode(unref(NSwitch),{value:gpt4tSetting.value,"onUpdate:value":t[28]||(t[28]=n=>gpt4tSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"sydneyEnable",label:"越狱模式"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:sydneySetting.value,"onUpdate:value":t[29]||(t[29]=n=>sydneySetting.value=n)},null,8,["value"])]),_:1})]),_:1})]),_:1}),createVNode(unref(NFormItem),{path:"langRegion",label:"语言理解能力"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(langRegionSetting),"onUpdate:value":t[30]||(t[30]=n=>isRef(langRegionSetting)?langRegionSetting.value=n:langRegionSetting=n),options:langRegionOptions.value,size:"large",placeholder:"语言理解能力"},null,8,["value","options"])]),_:1}),createVNode(unref(NFormItem),{path:"sydneyPrompt",label:"人机验证服务器"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:passServerSetting.value,"onUpdate:value":t[31]||(t[31]=n=>passServerSetting.value=n),type:"text",placeholder:"人机验证服务器"},null,8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"sydneyPrompt",label:"提示词"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:sydneyPromptSetting.value,"onUpdate:value":t[32]||(t[32]=n=>sydneyPromptSetting.value=n),type:"text",placeholder:"越狱模式提示词"},null,8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"themeMode",label:"UI 版本"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(uiVersionSetting),"onUpdate:value":t[33]||(t[33]=n=>isRef(uiVersionSetting)?uiVersionSetting.value=n:uiVersionSetting=n),options:uiVersionOptions.value,size:"large",placeholder:"请选择 UI 版本"},null,8,["value","options"])]),_:1}),createVNode(unref(NFormItem),{path:"themeMode",label:"主题模式"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(themeModeSetting),"onUpdate:value":t[34]||(t[34]=n=>isRef(themeModeSetting)?themeModeSetting.value=n:themeModeSetting=n),options:themeModeOptions.value,size:"large",placeholder:"请选择主题模式"},null,8,["value","options"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"customChatNum",label:"聊天次数"},{default:withCtx(()=>[createVNode(unref(NInputNumber),{size:"large",value:customChatNumSetting.value,"onUpdate:value":t[35]||(t[35]=n=>customChatNumSetting.value=n),min:"0",style:{width:"100%"}},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]])]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowClearCacheModal.value,"onUpdate:show":t[39]||(t[39]=n=>isShowClearCacheModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_13]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[38]||(t[38]=n=>isShowClearCacheModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"error",onClick:resetCache},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowSetAboutModal.value,"onUpdate:show":t[41]||(t[41]=n=>isShowSetAboutModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_14]),action:withCtx(()=>[createVNode(unref(NButton),{ghost:"",size:"large",onClick:t[40]||(t[40]=n=>isShowSetAboutModal.value=!1),type:"info"},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"82px",size:"small",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"version",label:"版本号"},{default:withCtx(()=>[createVNode(unref(NTag),{type:"info",size:"small",round:""},{default:withCtx(()=>[createTextVNode(toDisplayString("v"+unref(localVersion)),1)]),_:1})]),_:1}),createVNode(unref(NFormItem),{path:"latestVersion",label:"最新版本",id:"latestVersion",ref:"latestVersion"},{default:withCtx(()=>[createVNode(unref(NTag),{type:"info",size:"small",round:""},{default:withCtx(()=>[createTextVNode(toDisplayString(lastVersion.value),1)]),_:1})]),_:1},512)]),_:1},512)]),_:1},8,["show"]),createVNode(_sfc_main$8,{show:isShowCreateImageModal.value,"onUpdate:show":t[42]||(t[42]=n=>isShowCreateImageModal.value=n)},null,8,["show"])],64))}}),_hoisted_1$5={class:"inline-block max-w-[120px] xl:max-w-[650px] overflow-hidden text-ellipsis"},_hoisted_2$3={class:"float-right"},_sfc_main$6=defineComponent({__name:"ChatPromptItem",props:{index:{},source:{}},setup(e){const t=useMessage(),n=usePromptStore(),{promptList:o,optPromptConfig:r}=storeToRefs(n),i=l=>{o.value=o.value.filter(s=>s.act!==l.act&&s.prompt!==l.prompt),t.success("删除提示词成功")},a=l=>{r.value.isShow=!0,r.value.type="edit",r.value.title="编辑提示词",r.value.tmpPrompt=l,r.value.newPrompt={...l}};return(l,s)=>(openBlock(),createBlock(unref(NThing),{class:"hover:bg-gray-400 dark:md:hover:bg-slate-800 cursor-pointer p-5"},{description:withCtx(()=>[createVNode(unref(NTag),{type:"info"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$5,toDisplayString(l.source.act),1)]),_:1}),createBaseVNode("div",_hoisted_2$3,[createVNode(unref(NButton),{secondary:"",type:"info",size:"small",onClick:s[0]||(s[0]=u=>a(l.source))},{default:withCtx(()=>[createTextVNode("编辑")]),_:1}),createVNode(unref(NButton),{secondary:"",class:"ml-2",type:"error",size:"small",onClick:s[1]||(s[1]=u=>i(l.source))},{default:withCtx(()=>[createTextVNode("删除")]),_:1})])]),default:withCtx(()=>[createVNode(unref(NEllipsis),{tooltip:!1,"line-clamp":2},{default:withCtx(()=>[createTextVNode(toDisplayString(l.source.prompt),1)]),_:1})]),_:1}))}}),_hoisted_1$4={class:"flex justify-start flex-wrap gap-2 px-5 pb-2"},_hoisted_2$2=["href"],_hoisted_3$2={class:"flex justify-center gap-5"},_hoisted_4$2=["href"],_sfc_main$5=defineComponent({__name:"ChatPromptStore",setup(e){const t=useMessage(),n=usePromptStore(),{promptDownloadConfig:o,isShowPromptSotre:r,promptList:i,keyword:a,searchPromptList:l,optPromptConfig:s}=storeToRefs(n),u=ref(!1),d=ref(!1),f=ref(!1),v=()=>{s.value.isShow=!0,s.value.type="add",s.value.title="添加提示词",s.value.newPrompt={act:"",prompt:""}},g=()=>{const{type:S,tmpPrompt:w,newPrompt:y}=s.value;if(!y.act)return t.error("提示词标题不能为空");if(!y.prompt)return t.error("提示词描述不能为空");if(S==="add")i.value=[y,...i.value],t.success("添加提示词成功");else if(S==="edit"){if(y.act===(w==null?void 0:w.act)&&y.prompt===(w==null?void 0:w.prompt)){t.warning("提示词未变更"),s.value.isShow=!1;return}const R=i.value.findIndex(k=>k.act===(w==null?void 0:w.act)&&k.prompt===(w==null?void 0:w.prompt));R>-1?(i.value[R]=y,t.success("编辑提示词成功")):t.error("编辑提示词出错")}s.value.isShow=!1},p=S=>new Promise((w,y)=>{const R=new FileReader;R.onload=function(k){var B;w((B=k.target)==null?void 0:B.result)},R.onerror=y,R.readAsText(S)}),m=async S=>{var w;if(S.file.file){d.value=!0;const y=await p(S.file.file),R=JSON.parse(y),k=n.addPrompt(R);k.result?(t.info(`上传文件含 ${R.length} 条数据`),t.success(`成功导入 ${(w=k.data)==null?void 0:w.successCount} 条有效数据`)):t.error(k.msg||"提示词格式有误"),d.value=!1}else t.error("上传文件有误")},C=()=>{if(i.value.length===0)return t.error("暂无可导出的提示词数据");f.value=!0;const S=JSON.stringify(i.value),w=new Blob([S],{type:"application/json"}),y=URL.createObjectURL(w),R=document.createElement("a");R.href=y,R.download="BingAIPrompts.json",R.click(),URL.revokeObjectURL(y),t.success("导出提示词库成功"),f.value=!1},b=()=>{i.value=[],t.success("清空提示词库成功")},x=async S=>{var R;if(!S.url)return t.error("请先输入下载链接");S.isDownloading=!0;let w;if(S.url.endsWith(".json"))w=await fetch(S.url).then(k=>k.json());else if(S.url.endsWith(".csv")){const k=await fetch(S.url).then(B=>B.text());console.log(k),w=k.split(` -`).filter(B=>B).map(B=>{var M;const T=B.split('","');return{act:T[0].slice(1),prompt:(M=T[1])==null?void 0:M.slice(1)}}),w.shift()}else return S.isDownloading=!1,t.error("暂不支持下载此后缀的提示词");S.isDownloading=!1;const y=n.addPrompt(w);y.result?(t.info(`下载文件含 ${w.length} 条数据`),t.success(`成功导入 ${(R=y.data)==null?void 0:R.successCount} 条有效数据`)):t.error(y.msg||"提示词格式有误")};return(S,w)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(NModal),{class:"w-11/12 xl:w-[900px]",show:unref(r),"onUpdate:show":w[3]||(w[3]=y=>isRef(r)?r.value=y:null),preset:"card",title:"提示词库"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$4,[createVNode(unref(NInput),{class:"basis-full xl:basis-0 xl:min-w-[300px]",placeholder:"搜索提示词",value:unref(a),"onUpdate:value":w[0]||(w[0]=y=>isRef(a)?a.value=y:null),clearable:!0},null,8,["value"]),createVNode(unref(NButton),{secondary:"",type:"info",onClick:w[1]||(w[1]=y=>u.value=!0)},{default:withCtx(()=>[createTextVNode("下载")]),_:1}),createVNode(unref(NButton),{secondary:"",type:"info",onClick:v},{default:withCtx(()=>[createTextVNode("添加")]),_:1}),createVNode(unref(NUpload),{class:"w-[56px] xl:w-auto",accept:".json","default-upload":!1,"show-file-list":!1,onChange:m},{default:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"success",loading:d.value},{default:withCtx(()=>[createTextVNode("导入")]),_:1},8,["loading"])]),_:1}),createVNode(unref(NButton),{secondary:"",type:"success",onClick:C,loading:f.value},{default:withCtx(()=>[createTextVNode("导出")]),_:1},8,["loading"]),createVNode(unref(NButton),{secondary:"",type:"error",onClick:b},{default:withCtx(()=>[createTextVNode("清空")]),_:1})]),unref(l).length>0?(openBlock(),createBlock(unref(NVirtualList),{key:0,class:"h-[40vh] xl:h-[60vh] overflow-y-auto","item-size":131,"item-resizable":"",items:unref(l)},{default:withCtx(({item:y,index:R})=>[createVNode(_sfc_main$6,{index:R,source:y},null,8,["index","source"])]),_:1},8,["items"])):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"h-[40vh] xl:h-[60vh] flex justify-center items-center",description:"暂无数据"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:w[2]||(w[2]=y=>u.value=!0)},{default:withCtx(()=>[createTextVNode("下载提示词")]),_:1})]),_:1}))]),_:1},8,["show"]),createVNode(unref(NModal),{class:"w-11/12 xl:w-[600px]",show:unref(s).isShow,"onUpdate:show":w[6]||(w[6]=y=>unref(s).isShow=y),preset:"card",title:unref(s).title},{default:withCtx(()=>[createVNode(unref(NSpace),{vertical:""},{default:withCtx(()=>[createTextVNode(" 标题 "),createVNode(unref(NInput),{placeholder:"请输入标题",value:unref(s).newPrompt.act,"onUpdate:value":w[4]||(w[4]=y=>unref(s).newPrompt.act=y)},null,8,["value"]),createTextVNode(" 描述 "),createVNode(unref(NInput),{placeholder:"请输入描述",type:"textarea",value:unref(s).newPrompt.prompt,"onUpdate:value":w[5]||(w[5]=y=>unref(s).newPrompt.prompt=y)},null,8,["value"]),createVNode(unref(NButton),{block:"",secondary:"",type:"info",onClick:g},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),_:1})]),_:1},8,["show","title"]),createVNode(unref(NModal),{class:"w-11/12 xl:w-[600px]",show:u.value,"onUpdate:show":w[7]||(w[7]=y=>u.value=y),preset:"card",title:"下载提示词"},{default:withCtx(()=>[createVNode(unref(NList),{class:"overflow-y-auto rounded-lg",hoverable:"",clickable:""},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(o),(y,R)=>(openBlock(),createBlock(unref(NListItem),{key:R},{suffix:withCtx(()=>[createBaseVNode("div",_hoisted_3$2,[y.type===1?(openBlock(),createElementBlock("a",{key:0,class:"no-underline",href:y.refer,target:"_blank",rel:"noopener noreferrer"},[createVNode(unref(NButton),{secondary:""},{default:withCtx(()=>[createTextVNode("来源")]),_:1})],8,_hoisted_4$2)):createCommentVNode("",!0),createVNode(unref(NButton),{secondary:"",type:"info",onClick:k=>x(y),loading:y.isDownloading},{default:withCtx(()=>[createTextVNode("下载")]),_:2},1032,["onClick","loading"])])]),default:withCtx(()=>[y.type===1?(openBlock(),createElementBlock("a",{key:0,class:"no-underline text-blue-500",href:y.url,target:"_blank",rel:"noopener noreferrer"},toDisplayString(y.name),9,_hoisted_2$2)):y.type===2?(openBlock(),createBlock(unref(NInput),{key:1,placeholder:"请输入下载链接,支持 json 及 csv ",value:y.url,"onUpdate:value":k=>y.url=k},null,8,["value","onUpdate:value"])):createCommentVNode("",!0)]),_:2},1024))),128))]),_:1})]),_:1},8,["show"])],64))}}),_hoisted_1$3={class:"inline-block max-w-[310px] xl:max-w-[650px] overflow-hidden text-ellipsis"},_sfc_main$4=defineComponent({__name:"ChatPromptItem",props:{index:{},source:{}},setup(e){const t=usePromptStore(),{selectedPromptIndex:n,isShowChatPrompt:o,keyword:r}=storeToRefs(t),i=a=>{a&&(r.value="",CIB.vm.actionBar.textInput.value=a.prompt,CIB.vm.actionBar.input.focus(),o.value=!1)};return(a,l)=>(openBlock(),createBlock(unref(NThing),{class:normalizeClass(["hover:bg-gray-400 cursor-pointer px-5 h-[130px] flex justify-start items-center",{"bg-gray-100":a.index===unref(n)}]),onClick:l[0]||(l[0]=s=>i(a.source))},{description:withCtx(()=>[createVNode(unref(NTag),{type:"info"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$3,toDisplayString(a.source.act),1)]),_:1})]),default:withCtx(()=>[createVNode(unref(NEllipsis),{tooltip:!1,"line-clamp":2},{default:withCtx(()=>[createTextVNode(toDisplayString(a.source.prompt),1)]),_:1})]),_:1},8,["class"]))}}),_withScopeId=e=>(pushScopeId("data-v-4813a901"),e=e(),popScopeId(),e),_hoisted_1$2={key:0,class:"loading-spinner"},_hoisted_2$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce1"},null,-1)),_hoisted_3$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce2"},null,-1)),_hoisted_4$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce3"},null,-1)),_hoisted_5$1=[_hoisted_2$1,_hoisted_3$1,_hoisted_4$1],_sfc_main$3=defineComponent({__name:"LoadingSpinner",props:{isShow:{type:Boolean}},setup(e){return(t,n)=>(openBlock(),createBlock(Transition,{name:"fade"},{default:withCtx(()=>[t.isShow?(openBlock(),createElementBlock("div",_hoisted_1$2,_hoisted_5$1)):createCommentVNode("",!0)]),_:1}))}}),LoadingSpinner_vue_vue_type_style_index_0_scoped_4813a901_lang="",_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},LoadingSpinner=_export_sfc(_sfc_main$3,[["__scopeId","data-v-4813a901"]]),_hoisted_1$1={key:0,class:"hidden lg:block"},_hoisted_2={key:1},_hoisted_3={class:"hidden lg:table-cell"},_hoisted_4={key:1},_hoisted_5={key:0,class:"flex justify-center items-center flex-wrap gap-2"},_hoisted_6=["onClick"],_hoisted_7={class:"flex justify-center items-center flex-wrap gap-2"},_sfc_main$2=defineComponent({__name:"ChatServiceSelect",setup(e){const t=useChatStore(),{isShowChatServiceSelectModal:n,sydneyConfigs:o,selectedSydneyBaseUrl:r}=storeToRefs(t),i=useMessage(),a=async u=>{u.isUsable=void 0,u.delay=void 0;const d=await t.checkSydneyConfig(u);d.errorMsg&&i.error(d.errorMsg),u.isUsable=d.isUsable,u.delay=d.delay},l=u=>{r.value=u.baseUrl,CIB.config.sydney.baseUrl=u.baseUrl,n.value=!1},s=u=>{if(u.baseUrl){if(!u.baseUrl.startsWith("https://")){i.error("请填写 https 开头的正确链接");return}return a(u)}};return(u,d)=>(openBlock(),createBlock(unref(NModal),{class:"w-11/12 lg:w-[900px]",show:unref(n),"onUpdate:show":d[0]||(d[0]=f=>isRef(n)?n.value=f:null),preset:"card",title:"聊天服务器设置"},{default:withCtx(()=>[createVNode(unref(NTable),{striped:""},{default:withCtx(()=>[createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(o),(f,v)=>(openBlock(),createElementBlock("tr",{key:v},[createBaseVNode("td",null,[f.isCus?(openBlock(),createElementBlock("span",_hoisted_1$1,toDisplayString(f.label),1)):(openBlock(),createElementBlock("span",_hoisted_2,toDisplayString(f.label),1)),f.isCus?(openBlock(),createBlock(unref(NInput),{key:2,class:"lg:hidden",value:f.baseUrl,"onUpdate:value":g=>f.baseUrl=g,placeholder:"自定义聊天服务器链接",onChange:g=>s(f)},null,8,["value","onUpdate:value","onChange"])):createCommentVNode("",!0)]),createBaseVNode("td",_hoisted_3,[f.isCus?(openBlock(),createBlock(unref(NInput),{key:0,value:f.baseUrl,"onUpdate:value":g=>f.baseUrl=g,placeholder:"自定义聊天服务器链接",onChange:g=>s(f)},null,8,["value","onUpdate:value","onChange"])):(openBlock(),createElementBlock("span",_hoisted_4,toDisplayString(f.baseUrl),1))]),createBaseVNode("td",null,[f.baseUrl&&f.isUsable===void 0&&f.delay===void 0?(openBlock(),createElementBlock("div",_hoisted_5,[createVNode(unref(NButton),{tertiary:"",loading:!0,size:"small",type:"info"})])):f.baseUrl?(openBlock(),createElementBlock("div",{key:1,class:"flex justify-center items-center flex-wrap gap-2",onClick:g=>a(f)},[f.isUsable===!1?(openBlock(),createBlock(unref(NTag),{key:0,type:"error",class:"cursor-pointer"},{default:withCtx(()=>[createTextVNode("不可用")]),_:1})):createCommentVNode("",!0),f.delay?(openBlock(),createBlock(unref(NTag),{key:1,type:"success",class:"cursor-pointer"},{default:withCtx(()=>[createTextVNode(toDisplayString(f.delay)+" ms",1)]),_:2},1024)):createCommentVNode("",!0)],8,_hoisted_6)):createCommentVNode("",!0)]),createBaseVNode("td",null,[createBaseVNode("div",_hoisted_7,[createVNode(unref(NButton),{class:"hidden lg:table-cell",secondary:"",onClick:g=>a(f)},{default:withCtx(()=>[createTextVNode("检测")]),_:2},1032,["onClick"]),f.baseUrl===unref(r)?(openBlock(),createBlock(unref(NButton),{key:0,secondary:"",type:"success"},{default:withCtx(()=>[createTextVNode("当前")]),_:1})):(openBlock(),createBlock(unref(NButton),{key:1,secondary:"",type:"info",onClick:g=>l(f)},{default:withCtx(()=>[createTextVNode("选择")]),_:2},1032,["onClick"]))])])]))),128))])]),_:1})]),_:1},8,["show"]))}}),_hoisted_1=createBaseVNode("div",{class:"w-0 md:w-[60px]"},null,-1),promptItemHeight=130,_sfc_main$1=defineComponent({__name:"Chat",setup(e){const t=useMessage(),n=useDialog();window.$dialog=n;const o=ref(!0),r=usePromptStore(),{isShowPromptSotre:i,isShowChatPrompt:a,keyword:l,promptList:s,searchPromptList:u,selectedPromptIndex:d}=storeToRefs(r),f=useChatStore(),{isShowChatServiceSelectModal:v,sydneyConfigs:g,selectedSydneyBaseUrl:p}=storeToRefs(f),m=useUserStore(),C=ref(),b=ref(!1),x=ref(!1),S=ref(!1),w=ref(""),y=ref(!1);computed(()=>CIB.vm.isMobile&&CIB.vm.sidePanel.isVisibleMobile||!CIB.vm.isMobile&&CIB.vm.sidePanel.isVisibleDesktop);const{themeMode:R,uiVersion:k,gpt4tEnable:B,sydneyEnable:T,sydneyPrompt:M,enterpriseEnable:E,copilotProEnable:$}=storeToRefs(m);onMounted(async()=>{if(await j(),O(),await SydneyFullScreenConv.initWithWaitlistUpdate({cookLoc:{}},10),isMobile()){const A=document.querySelector("cib-serp");A==null||A.setAttribute("mobile","")}k.value==="v3"&&await sj_evt.bind("chs_init",()=>{ChatHomeScreen.init("/turing/api/suggestions/v2/zeroinputstarter")},!0),D(),o.value=!1,J(),Q(),re(),ie(),R.value=="light"?CIB.changeColorScheme(0):R.value=="dark"?CIB.changeColorScheme(1):R.value=="auto"&&(window.matchMedia("(prefers-color-scheme: dark)").matches?CIB.changeColorScheme(1):CIB.changeColorScheme(0))});const _=async A=>new Promise(X=>setTimeout(X,A)),O=()=>{},N=()=>{if(p.value)CIB.config.sydney.baseUrl=p.value,v.value=!1;else{if(v.value=!0,p.value=CIB.config.sydney.baseUrl,g.value.filter(X=>!X.isCus).every(X=>X.baseUrl!==p.value)){const X=g.value.find(I=>I.isCus);X&&(X.baseUrl=p.value)}f.checkAllSydneyConfig()}},D=async()=>{const A=base58Decode(_G.S);let X=[];for(let Y=0;Y<_G.SP.length;Y++)X.push(A[_G.SP[Y]]);base58Decode(X.join(""))!=_G.AT&&n.warning({title:decodeURI(base58Decode(_G.TIP)),content:decodeURI(base58Decode(_G.TIPC)),maskClosable:!1,closable:!1,closeOnEsc:!1});const U=await m.getSysConfig();switch(U.code){case ApiResultCode.OK:{if(!U.data.isAuth){S.value=!0;return}if(await F(U.data),U.data.info!=""){const Y=JSON.parse(U.data.info);t.create(Y.content,{type:Y.type,keepAliveOnHover:!0,showIcon:!0,render:ne=>h(NAlert,{closable:!0,type:ne.type==="loading"?"default":ne.type,title:Y.title,style:{boxShadow:"var(--n-box-shadow)",maxWidth:"calc(100vw - 32px)",width:"360px",position:"fixed",top:"20px",right:"12px"}},{default:()=>ne.content})})}}break;case ApiResultCode.UnLegal:_G.SB=!0,n.warning({title:decodeURI(base58Decode(_G.TIP)),content:decodeURI(base58Decode(_G.TIPC)),maskClosable:!1,closable:!1,closeOnEsc:!1});break;default:t.error(`[${U.code}] ${U.message}`);break}},F=async A=>{A.isSysCK||await m.checkUserToken(),N()},j=async()=>new Promise((A,X)=>{sj_evt.bind("sydFSC.init",A,!0),sj_evt.fire("showSydFSC")}),J=async()=>{var ne,ue,xe,we,K,Z,me,Pe,$e,Te,Ne,Me;location.hostname==="localhost"&&(CIB.config.sydney.hostnamesToBypassSecureConnection=CIB.config.sydney.hostnamesToBypassSecureConnection.filter(Ie=>Ie!==location.hostname)),isMobile()&&await _(25);const A=document.querySelector("cib-serp"),X=(ne=A==null?void 0:A.shadowRoot)==null?void 0:ne.querySelector("cib-conversation"),I=(ue=X==null?void 0:X.shadowRoot)==null?void 0:ue.querySelector("cib-welcome-container"),U=(xe=I==null?void 0:I.shadowRoot)==null?void 0:xe.querySelectorAll("div[class='muid-upsell']");U!=null&&U.length&&U.forEach(Ie=>{Ie.remove()}),(K=(we=I==null?void 0:I.shadowRoot)==null?void 0:we.querySelector(".preview-container"))==null||K.remove(),(me=(Z=I==null?void 0:I.shadowRoot)==null?void 0:Z.querySelector(".footer"))==null||me.remove(),($e=(Pe=A==null?void 0:A.shadowRoot)==null?void 0:Pe.querySelector("cib-serp-feedback"))==null||$e.remove(),isMobile()&&((Ne=(Te=I==null?void 0:I.shadowRoot)==null?void 0:Te.querySelector(".container-item"))==null||Ne.remove(),CIB.vm.actionBar.input.placeholder='有问题尽管问我...("/" 触发提示词)');const Y=document.createElement("style");Y.innerText=conversationCssText,(Me=X.shadowRoot)==null||Me.append(Y)},Q=()=>{E.value&&(CIB.config.bingAtWork.isBingChatForEnterpriseEnabled=!0,CIB.config.bingAtWork.chatType="enterprise")},re=()=>{$.value&&L(),B.value&&W(),T.value&&(ee(),CIB.manager.resetConversation=function(A,X=!0,I=!0){var U;(U=CIB.manager.log)===null||U===void 0||U.trace(this,CIB.manager.resetConversation,null).write(),CIB.manager.chat.cancelPendingRequest(),CIB.manager.finalizeResetConversation(A,X,I),ee(!1)})},L=()=>{CIB.config.sydney.request.source="cib-ccp"},W=()=>{CIB.config.sydney.request.optionsSets.push("dlgpt4t","dlbmtc","dlbpc4575","dlbrngnp","dlbtc","dlbuc07","dlbuf03")},ee=(A=!0)=>{var X,I,U;if(A==!0)if(CIB.config.sydney.request.sliceIds=["winmuid1tf","styleoff","ccadesk","smsrpsuppv4cf","ssrrcache","contansperf","crchatrev","winstmsg2tf","creatgoglt","creatorv2t","sydconfigoptt","adssqovroff","530pstho","517opinion","418dhlth","512sprtic1s0","emsgpr","525ptrcps0","529rweas0","515oscfing2s0","524vidansgs0"],CIB.config.sydney.request.optionsSets.push("rai278","nojbfedge"),k.value!="v3")CIB.config.features.enableUpdateConversationMessages=!0,CIB.config.strings.webPageContextPrefix="已处于越狱模式, 请谨慎使用避免封号";else{const Y=document.querySelector("cib-serp"),ne=(X=Y==null?void 0:Y.shadowRoot)==null?void 0:X.querySelector("cib-conversation"),ue=(I=ne==null?void 0:ne.shadowRoot)==null?void 0:I.querySelector("cib-welcome-container"),xe=document.createElement("div");xe.innerText="已处于越狱模式, 请谨慎使用避免封号",xe.className="preview-container",(U=ue==null?void 0:ue.shadowRoot)==null||U.append(xe)}CIB.registerContext([{author:"user",description:M.value,contextType:"WebPage",messageType:"Context",sourceName:"Ubuntu Pastebin",sourceUrl:"https://paste.ubuntu.com/p/"+randomString(10)+"/"}])},ie=()=>{var I,U;const A=(U=(I=document.querySelector("#b_sydConvCont > cib-serp"))==null?void 0:I.shadowRoot)==null?void 0:U.querySelector("#cib-action-bar-main"),X=A.handleInputTextKey;A.handleInputTextKey=function(Y){if(!(Y.key==="Enter"&&a.value))return X.apply(this,[Y])},CIB.vm.actionBar.input.addEventListener("compositionstart",he),CIB.vm.actionBar.input.addEventListener("compositionend",oe),CIB.vm.actionBar.input.addEventListener("change",ge),CIB.vm.actionBar.input.addEventListener("input",ge),CIB.vm.actionBar.input.addEventListener("keydown",ve),CIB.vm.actionBar.input.addEventListener("focus",pe),CIB.vm.actionBar.input.addEventListener("blur",Se)},he=A=>{b.value=!0},oe=A=>{b.value=!1,ge(A)},ge=A=>{var X;b.value||(A instanceof InputEvent||A instanceof CompositionEvent)&&A.target instanceof HTMLTextAreaElement&&((X=A.target.value)!=null&&X.startsWith("/")?(a.value=!0,l.value=A.target.value.slice(1),d.value=0):(l.value="",a.value=!1))},pe=A=>{},Se=A=>{setTimeout(()=>{a.value=!1},200)},ve=A=>{switch(A.key){case"ArrowUp":d.value>0&&(d.value--,C.value&&C.value.scrollToIndex(d.value));break;case"ArrowDown":d.value{A&&(l.value="",CIB.vm.actionBar.textInput.value=A.prompt,a.value=!1)},H=()=>{x.value=!0,setTimeout(()=>{var A;if(x.value===!0){x.value=!1;const X=((A=C.value)==null?void 0:A.getOffset())||0;d.value=Math.round(X/promptItemHeight)}},100)},q=async()=>{if(!w.value){t.error("请先输入授权码");return}y.value=!0,m.setAuthKey(w.value);const A=await m.getSysConfig();A.data.isAuth?(t.success("授权成功"),S.value=!1,F(A.data)):t.error("授权码有误"),y.value=!1};return(A,X)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(LoadingSpinner,{"is-show":o.value},null,8,["is-show"]),createBaseVNode("main",null,[createVNode(unref(NPopover),{trigger:"manual",show:unref(a),"show-arrow":!1,class:"max-w-[1060px] max-h-[390px]",to:!1},{trigger:withCtx(()=>[createVNode(unref(NButton),{style:{position:"fixed",left:"20px",bottom:"80px","z-index":"-1",opacity:"0"}})]),default:withCtx(()=>[_hoisted_1,unref(s).length>0?(openBlock(),createBlock(unref(NVirtualList),{key:0,class:"w-full max-w-[1060px] max-h-[390px] overflow-y-auto","item-size":131,"item-resizable":"",items:unref(s),onScroll:H},{default:withCtx(({item:I,index:U})=>[createVNode(_sfc_main$4,{index:U,source:I},null,8,["index","source"])]),_:1},8,["items"])):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"w-full max-w-[1060px] max-h-[390px] rounded-xl py-6",description:"暂未设置提示词数据"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:X[0]||(X[0]=I=>i.value=!0)},{default:withCtx(()=>[createTextVNode("去提示词库添加")]),_:1})]),_:1}))]),_:1},8,["show"])]),createBaseVNode("footer",null,[createVNode(_sfc_main$2),createVNode(unref(NModal),{show:S.value,"onUpdate:show":X[2]||(X[2]=I=>S.value=I),preset:"dialog","close-on-esc":!1,"mask-closable":!1,"show-icon":!1},{default:withCtx(()=>[createVNode(unref(NResult),{class:"box-border w-11/12 lg:w-[400px] px-4 py-4 rounded-md",status:"403",title:"401 未授权"},{footer:withCtx(()=>[createVNode(unref(NInput),{class:"w-11/12",value:w.value,"onUpdate:value":X[1]||(X[1]=I=>w.value=I),type:"password",placeholder:"请输入授权码",maxlength:"60",clearable:""},null,8,["value"]),createVNode(unref(NButton),{class:"mt-4",secondary:"",type:"info",loading:y.value,onClick:q},{default:withCtx(()=>[createTextVNode("授权")]),_:1},8,["loading"])]),_:1})]),_:1},8,["show"])])],64))}}),_sfc_main=defineComponent({__name:"index",setup(e){return(t,n)=>(openBlock(),createElementBlock("main",null,[createVNode(_sfc_main$7),createVNode(_sfc_main$5),createVNode(_sfc_main$1)]))}});export{_sfc_main as default}; +}`,settingSvgUrl="/web/assets/setting-c6ca7b14.svg",usePromptStore=defineStore("prompt-store",()=>{const e=ref([{type:1,name:"ChatGPT 中文调教指南 - 简体",url:"./data/prompts/prompts-zh.json",refer:"https://github.com/PlexPt/awesome-chatgpt-prompts-zh"},{type:1,name:"ChatGPT 中文调教指南 - 繁体",url:"./data/prompts/prompts-zh-TW.json",refer:"https://github.com/PlexPt/awesome-chatgpt-prompts-zh"},{type:1,name:"Awesome ChatGPT Prompts",url:"./data/prompts/prompts.csv",refer:"https://github.com/f/awesome-chatgpt-prompts"},{type:2,name:"",url:"",refer:""}]),t=ref(!1),n=ref(!1),o=ref([]),r=ref(""),i=ref(0),a=ref({isShow:!1,newPrompt:{act:"",prompt:""}}),l=computed(()=>{var u;return r.value?(u=o.value)==null?void 0:u.filter(d=>d.act.includes(r.value)||d.prompt.includes(r.value)):o.value});function s(u){if(u instanceof Array&&u.every(d=>d.act&&d.prompt)){if(o.value.length===0)return o.value.push(...u),{result:!0,data:{successCount:u.length}};const d=u.filter(f=>{var v;return(v=o.value)==null?void 0:v.every(g=>f.act!==g.act&&f.prompt!==g.prompt)});return o.value.push(...d),{result:!0,data:{successCount:d.length}}}else return{result:!1,msg:"提示词格式有误"}}return{promptDownloadConfig:e,isShowPromptSotre:t,isShowChatPrompt:n,promptList:o,keyword:r,searchPromptList:l,selectedPromptIndex:i,optPromptConfig:a,addPrompt:s}},{persist:{key:"prompt-store",storage:localStorage,paths:["promptList"]}}),_hoisted_1$8=["href"],_hoisted_2$6={key:1},_sfc_main$9=defineComponent({__name:"ChatNavItem",props:{navConfig:{}},setup(e){return(t,n)=>t.navConfig.url?(openBlock(),createElementBlock("a",{key:0,href:t.navConfig.url,target:"_blank",rel:"noopener noreferrer"},toDisplayString(t.navConfig.label),9,_hoisted_1$8)):(openBlock(),createElementBlock("div",_hoisted_2$6,toDisplayString(t.navConfig.label),1))}}),_hoisted_1$7={class:"flex justify-center gap-3 px-8"},_hoisted_2$5={class:"flex justify-center items-center"},_hoisted_3$4=["src"],_hoisted_4$4=createBaseVNode("p",{class:"text-left"},"提示:形容词+名词+动词+风格,描述得越详细时,效果越好。",-1),DEMO_KEYWORD="骑着摩托的小猫咪,疾驰在路上,动漫场景,详细的细节。",_sfc_main$8=defineComponent({__name:"CreateImage",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=e,o=t,r=useMessage(),i=ref(""),a=ref(""),l=ref(!1),s=computed({get:()=>n.show,set:v=>o("update:show",v)}),u=()=>{if(!i.value){r.error("请先输入关键词");return}l.value=!0,a.value=`/images/create?re=1&showselective=1&sude=1&kseed=7500&SFX=2&q=${encodeURIComponent(i.value)}&t=${Date.now()}`},d=()=>{i.value="",a.value=""},f=()=>(i.value=DEMO_KEYWORD,u());return(v,g)=>(openBlock(),createBlock(unref(NModal),{class:"w-11/12 lg:w-[540px] select-none",show:s.value,"onUpdate:show":g[2]||(g[2]=p=>s.value=p),"on-close":d,preset:"card",title:"图像创建"},{default:withCtx(()=>[createBaseVNode("head",_hoisted_1$7,[createVNode(unref(NInput),{class:"flex-1",placeholder:"提示词",value:i.value,"onUpdate:value":g[0]||(g[0]=p=>i.value=p),clearable:!0,onKeyup:withKeys(u,["enter"]),maxlength:"100"},null,8,["value"]),createVNode(unref(NButton),{secondary:"",type:"info",onClick:u,loading:l.value},{default:withCtx(()=>[createTextVNode("开始创建")]),_:1},8,["loading"])]),createBaseVNode("main",_hoisted_2$5,[a.value?(openBlock(),createElementBlock("iframe",{key:0,class:"w-[310px] h-[350px] xl:w-[475px] xl:h-[520px] my-4",src:a.value,frameborder:"0",onLoad:g[1]||(g[1]=p=>l.value=!1)},null,40,_hoisted_3$4)):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"h-[40vh] xl:h-[60vh] flex justify-center items-center",description:"暂未创建"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:f},{default:withCtx(()=>[createTextVNode("使用示例创建")]),_:1}),createBaseVNode("div",{class:"text-[#c2c2c2] px-2 xl:px-10"},[_hoisted_4$4,createBaseVNode("p",{class:"text-left"},"示例:"+toDisplayString(DEMO_KEYWORD))])]),_:1}))])]),_:1},8,["show"]))}}),useChatStore=defineStore("chat-store",()=>{const e="/sydney/ChatHub",t=ref(!1),n=ref(""),o=ref([{baseUrl:"https://sydney.bing.com",label:"Bing 官方"},{baseUrl:"https://sydney.b1ng.chat",label:"Cloudflare Worker"},{baseUrl:location.origin,label:"本站"},{baseUrl:"",label:"自定义",isCus:!0}]),r=3e3,i=async l=>{if(!l.baseUrl)return{isUsable:!1,errorMsg:"链接不可为空"};try{const s=Date.now(),u=new WebSocket(l.baseUrl.replace("http","ws")+e),d=setTimeout(()=>{u.close()},r);return await new Promise((f,v)=>{u.onopen=()=>{clearTimeout(d),f(u.close())},u.onerror=()=>{clearTimeout(d),v(new Error(`聊天服务器 ${l.baseUrl} 连接失败`))},u.onclose=()=>v(new Error(`聊天服务器 ${l.baseUrl} 连接超时`))}),{isUsable:!0,delay:Date.now()-s}}catch(s){return{isUsable:!1,errorMsg:s instanceof Error?s.message:""}}};return{isShowChatServiceSelectModal:t,sydneyConfigs:o,selectedSydneyBaseUrl:n,checkSydneyConfig:i,checkAllSydneyConfig:async()=>{const l=o.value.filter(s=>s.baseUrl).map(async s=>{const u=await i(s);s.isUsable=u.isUsable,s.delay=u.delay});await Promise.all(l)}}},{persist:{key:"chat-store",storage:localStorage,paths:["selectedSydneyBaseUrl","sydneyConfigs"]}}),_hoisted_1$6=createBaseVNode("div",{class:"text-3xl py-2"},"账号登录",-1),_hoisted_2$4={key:0},_hoisted_3$3={key:0,style:{"margin-top":"12px","margin-bottom":"24px"}},_hoisted_4$3=createBaseVNode("br",null,null,-1),_hoisted_5$2={key:1},_hoisted_6$1=["src"],_hoisted_7$1={key:1},_hoisted_8=createBaseVNode("div",{class:"text-3xl py-2"},"设置",-1),_hoisted_9=createBaseVNode("div",{class:"text-3xl py-2"},"Cookie 设置",-1),_hoisted_10=createBaseVNode("div",{class:"text-3xl py-2"},"高级设置",-1),_hoisted_11=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[createBaseVNode("path",{d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26zm64 226H200v-32h44v-88h-32v-32h64v120h44z",fill:"currentColor"})],-1),_hoisted_12=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[createBaseVNode("path",{d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26zm64 226H200v-32h44v-88h-32v-32h64v120h44z",fill:"currentColor"})],-1),_hoisted_13=createBaseVNode("div",{class:"text-xl py-2"},"将删除包括 Cookie 等的所有缓存?",-1),_hoisted_14=createBaseVNode("div",{class:"text-3xl py-2"},"关于",-1),_sfc_main$7=defineComponent({__name:"ChatNav",setup(__props){const isShowMore=ref(!1),isShowSettingModal=ref(!1),isShowAdvancedSettingModal=ref(!1),isShowSetAboutModal=ref(!1),isShowCookieModal=ref(!1),isShowLoginModal=ref(!1),isShowIframe=ref(!1),userToken=ref(""),userKievRPSSecAuth=ref(""),userMUID=ref(""),userRwBf=ref(""),message=useMessage(),promptStore=usePromptStore(),{isShowPromptSotre}=storeToRefs(promptStore),isShowClearCacheModal=ref(!1),isShowCreateImageModal=ref(!1),chatStore=useChatStore(),{isShowChatServiceSelectModal}=storeToRefs(chatStore),userStore=useUserStore(),localVersion="2.4.1",lastVersion=ref("加载中..."),{historyEnable,themeMode,uiVersion,langRegion,autoReopenMic,fullCookiesEnable,cookiesStr,enterpriseEnable,copilotProEnable,customChatNum,gpt4tEnable,sydneyEnable,sydneyPrompt,passServer}=storeToRefs(userStore);let cookiesEnable=ref(!1),cookies=ref(""),history=ref(!0),themeModeSetting=ref("auto"),uiVersionSetting=ref("v3"),langRegionSetting=ref("CN"),theme=ref(inject("theme")),autoReopenMicSetting=ref(!0),settingIconStyle=ref({filter:"invert(70%)"}),passingCFChallenge=ref(!1);const enterpriseSetting=ref(!1),copilotProSetting=ref(!1),customChatNumSetting=ref(0),gpt4tSetting=ref(!0),sydneySetting=ref(!1),sydneyPromptSetting=ref(""),passServerSetting=ref(""),getCookieTip=ref("获取 Cookie 中, 请稍后..."),bingUrl=base58Decode("7RYHpA38gs3NAby2mkvoRMwjncBpS"),oneKeyLogin=ref("false"),loginTypeOptions=ref([{label:"账号登录",value:"false"},{label:"一键登录",value:"true"}]),msLoginAccount=ref(""),msLoginPassword=ref(""),msLoginType=ref("passwd"),msLoginCode=ref(""),msLogining=ref(!1),msContinueing=ref(!1),msLoginTypeOptions=ref([{label:"密码登录",value:"passwd"},{label:"邮箱验证码登录",value:"email"},{label:"2FA登录",value:"device"}]),msLoginContext=ref({cookies:"",context:{}}),GetLastVersion=async()=>{const t=await(await fetch("https://api.github.com/repos/Harry-zklcdc/go-proxy-bingai/releases/latest")).json();lastVersion.value=t.tag_name},navType={login:"login",setting:"setting",chat:"chat",notebook:"notebook",compose:"compose",createImage:"createImage",reset:"reset",about:"about"};let navConfigs=ref([{key:navType.setting,label:"设置"},{key:navType.notebook,label:"笔记本"},{key:navType.compose,label:"撰写文章",url:"/web/compose.html"},{key:navType.createImage,label:"图像创建"},{key:navType.reset,label:"一键重置"},{key:navType.about,label:"关于"}]);const themeModeOptions=ref([{label:"浅色",value:"light"},{label:"深色",value:"dark"},{label:"跟随系统",value:"auto"}]),uiVersionOptions=ref([{label:"V1",value:"v1"},{label:"V2",value:"v2"},{label:"V3",value:"v3"}]),langRegionOptions=ref([{label:"中文优先",value:"CN"},{label:"英文优先",value:"US"}]);onMounted(()=>{themeMode.value=="light"?settingIconStyle.value={filter:"invert(0%)"}:themeMode.value=="dark"?settingIconStyle.value={filter:"invert(70%)"}:themeMode.value=="auto"&&(useOsTheme().value=="dark"?settingIconStyle.value={filter:"invert(70%)"}:settingIconStyle.value={filter:"invert(0%)"})});const sleep=async e=>new Promise(t=>setTimeout(t,e)),renderDropdownLabel=e=>h(_sfc_main$9,{navConfig:e}),handleSelect=async e=>{var t,n,o,r,i,a,l,s,u,d,f,v,g,p,m,C,b,x,S,w,y;switch(e){case navType.chat:{CIB.showConversation(),navConfigs.value[1]={key:navType.notebook,label:"笔记本"};const R=CIB.config.sydney.request.optionsSets.indexOf("prjupy"),k=CIB.config.sydney.request.optionsSets.indexOf("clgalileo");CIB.config.sydney.request.optionsSets=CIB.config.sydney.request.optionsSets.slice(0,R),k>-1&&(CIB.config.sydney.request.optionsSets[k]="galileo"),uiVersion.value=="v3"&&(await sleep(25),await ChatHomeScreen.init("/turing/api/suggestions/v2/zeroinputstarter"));const B=document.querySelector("cib-serp"),T=(t=B==null?void 0:B.shadowRoot)==null?void 0:t.querySelector("cib-conversation"),M=(n=T==null?void 0:T.shadowRoot)==null?void 0:n.querySelector("cib-welcome-container"),E=(o=M==null?void 0:M.shadowRoot)==null?void 0:o.querySelectorAll("div[class='muid-upsell']");E!=null&&E.length&&E.forEach(_=>{_.remove()}),(i=(r=M==null?void 0:M.shadowRoot)==null?void 0:r.querySelector(".preview-container"))==null||i.remove(),(l=(a=M==null?void 0:M.shadowRoot)==null?void 0:a.querySelector(".footer"))==null||l.remove(),(u=(s=B==null?void 0:B.shadowRoot)==null?void 0:s.querySelector("cib-serp-feedback"))==null||u.remove(),isMobile()&&((f=(d=M==null?void 0:M.shadowRoot)==null?void 0:d.querySelector(".container-item"))==null||f.remove(),CIB.vm.actionBar.input.placeholder='有问题尽管问我...("/" 触发提示词)');const $=document.createElement("style");$.innerText=conversationCssText,(v=T.shadowRoot)==null||v.append($)}break;case navType.notebook:{CIB.showNotebook();const R=CIB.config.sydney.request.optionsSets.indexOf("galileo");R>-1&&(CIB.config.sydney.request.optionsSets[R]="clgalileo"),CIB.config.sydney.request.optionsSets.push("prjupy","uprofdeuv1","uprofupdv2","gndlogcf"),navConfigs.value[1]={key:navType.chat,label:"聊天"},await sleep(25);const k=document.querySelector("cib-serp"),B=(g=k==null?void 0:k.shadowRoot)==null?void 0:g.querySelector("cib-notebook"),T=(p=B==null?void 0:B.shadowRoot)==null?void 0:p.querySelector("cib-ai-disclaimer");(C=(m=T==null?void 0:T.shadowRoot)==null?void 0:m.querySelector("div"))==null||C.remove(),(x=(b=T==null?void 0:T.shadowRoot)==null?void 0:b.querySelector("div"))==null||x.remove()}break;case navType.setting:isShowSettingModal.value=!0;break;case navType.createImage:!((S=userStore.sysConfig)!=null&&S.isSysCK)&&!userStore.getUserToken()&&message.warning("体验画图功能需先登录"),isShowCreateImageModal.value=!0;break;case navType.reset:isShowClearCacheModal.value=!0;break;case navType.about:{isShowSetAboutModal.value=!0,GetLastVersion(),await sleep(25);const R=document.createElement("div");render$1(h(NConfigProvider,{theme:theme.value},[h(NForm,{"label-placement":"left","label-width":"82px",size:"small",style:"margin-top: 0px"},authorEleRender())]),R);for(let k=0;k{switch(e){case"autoPassCFChallenge":autoPassCFChallenge();break;case"login":isShowLoginModal.value=!0,isShowIframe.value=!1;break;case"chatService":isShowChatServiceSelectModal.value=!0,chatStore.checkAllSydneyConfig();break;case"cookieSetting":userToken.value=userStore.getUserToken(),userKievRPSSecAuth.value=userStore.getUserKievRPSSecAuth(),userMUID.value=userStore.getUserMUID(),userRwBf.value=userStore.getUserRwBf(),history.value=historyEnable.value,cookiesEnable.value=fullCookiesEnable.value,cookies.value=cookiesStr.value,isShowCookieModal.value=!0;break;case"promptStore":isShowPromptSotre.value=!0;break;case"advancedSetting":history.value=historyEnable.value,themeModeSetting.value=themeMode.value,uiVersionSetting.value=uiVersion.value,langRegionSetting.value=langRegion.value,copilotProSetting.value=copilotProEnable.value,enterpriseSetting.value=enterpriseEnable.value,customChatNumSetting.value=customChatNum.value,gpt4tSetting.value=gpt4tEnable.value,autoReopenMicSetting.value=autoReopenMic.value,sydneySetting.value=sydneyEnable.value,sydneyPromptSetting.value=sydneyPrompt.value,passServerSetting.value=passServer.value,isShowAdvancedSettingModal.value=!0;break;default:return}},resetCache=async()=>{isShowClearCacheModal.value=!1,await userStore.resetCache(),message.success("清理完成"),window.location.href="/"},saveSetting=()=>{cookiesEnable.value?(userStore.saveCookies(cookies.value),cookiesStr.value=cookies.value):(userToken.value?userStore.saveUserToken(userToken.value):message.warning("请先填入用户 _U Cookie"),userKievRPSSecAuth.value?userStore.saveUserKievRPSSecAuth(userKievRPSSecAuth.value):message.warning("请先填入用户 KievRPSSecAuth Cookie"),userRwBf.value?userStore.saveUserRwBf(userRwBf.value):message.warning("请先填入用户 _RwBf Cookie"),userMUID.value?userStore.saveUserMUID(userMUID.value):message.warning("请先填入用户 MUID Cookie")),fullCookiesEnable.value=cookiesEnable.value,isShowCookieModal.value=!1},saveAdvancedSetting=()=>{var u,d,f,v;historyEnable.value=history.value;const e=enterpriseEnable.value;enterpriseEnable.value=enterpriseSetting.value,customChatNum.value=customChatNumSetting.value;const t=gpt4tEnable.value,n=sydneyEnable.value,o=uiVersion.value,r=copilotProEnable.value;copilotProEnable.value=copilotProSetting.value,gpt4tEnable.value=gpt4tSetting.value,autoReopenMic.value=autoReopenMicSetting.value,sydneyEnable.value=sydneySetting.value,sydneyPrompt.value=sydneyPromptSetting.value,uiVersion.value=uiVersionSetting.value,passServerSetting.value&&passServerSetting.value.startsWith("http")&&userStore.setPassServer(passServerSetting.value),langRegion.value!=langRegionSetting.value&&(langRegion.value=langRegionSetting.value,_G.Region=langRegionSetting.value);const i=document.querySelector("cib-serp"),a=(v=(f=(d=(u=i==null?void 0:i.shadowRoot)==null?void 0:u.querySelector("cib-conversation"))==null?void 0:d.querySelector("cib-side-panel"))==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(".main"),l=a==null?void 0:a.querySelector(".threads-header"),s=a==null?void 0:a.querySelector(".threads-container");isMobile()||(history.value&&userStore.getUserToken()&&!enterpriseEnable.value?o==="v1"?CIB.vm.sidePanel.panels=[{type:"threads",label:"最近的活动"},{type:"plugins",label:"插件"}]:(l.style.display="flex",s.style.display="block"):o==="v2"?(l.style.display="none",s.style.display="none"):(CIB.vm.sidePanel.panels=[{type:"plugins",label:"插件"}],CIB.vm.sidePanel.selectedPanel="plugins")),themeMode.value=themeModeSetting.value,themeModeSetting.value=="light"?(CIB.changeColorScheme(0),theme.value=lightTheme,settingIconStyle.value={filter:"invert(0%)"}):themeModeSetting.value=="dark"?(CIB.changeColorScheme(1),theme.value=darkTheme,settingIconStyle.value={filter:"invert(70%)"}):themeModeSetting.value=="auto"&&(useOsTheme().value=="dark"?(CIB.changeColorScheme(1),theme.value=darkTheme,settingIconStyle.value={filter:"invert(70%)"}):(CIB.changeColorScheme(0),theme.value=lightTheme,settingIconStyle.value={filter:"invert(0%)"})),isShowAdvancedSettingModal.value=!1,(e!=enterpriseSetting.value||n!=sydneySetting.value||t!=gpt4tSetting.value||o!=uiVersionSetting.value||r!=copilotProSetting.value)&&(window.location.href="/")},newWindow=()=>{window.open("/fd/auth/signin?action=interactive&provider=windows_live_id&return_url=https%3a%2f%2fwww.bing.com%2fchat%3fq%3dBing%2bAI%26FORM%3dhpcodx%26wlsso%3d1%26wlexpsignin%3d1&src=EXPLICIT&sig=001DD71D5A386F753B1FC3055B306E8F","_blank")},loginHandel=async()=>{isShowIframe.value=!0,getCookieTip.value="获取 Cookie 中, 请稍后...",window.addEventListener("message",function(r){const i=r.data;i.cookies!=""&&i.cookies!=null&&i.cookies!=null&&(userStore.saveCookies(i.cookies),cookiesStr.value=i.cookies,message.success("登录成功"),isShowLoginModal.value=!1,window.location.href="/")}),await sleep(1500),getCookieTimeoutHandel();const e=document.getElementById("login"),t=base58Decode(_G.S);let n=[];for(let r=0;r<_G.SP.length;r++)n.push(t[_G.SP[r]]);const o=base58Decode(n.join(""));e.contentWindow.postMessage({IG:_G.IG,T:await aesEncrypt(o,_G.IG)},"*")},msLoginHandel=async()=>{switch(msLogining.value=!0,msLoginType.value){case"passwd":{if(msLoginAccount.value){if(!msLoginPassword.value){message.warning("请先填入密码"),msLogining.value=!1;break}}else{message.warning("请先填入账号"),msLogining.value=!1;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,password:msLoginPassword.value,type:msLoginType.value})});if(!e.ok){message.error("登录失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;case"email":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!1;break}const e=await fetch("/api/ms/login",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value,verify_code:msLoginCode.value,cookies:msLoginContext.value.cookies,context:msLoginContext.value.context})});if(!e.ok){message.error("登录失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;case"device":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value})}),t=await e.json();if(e.status!=201){message.error("获取2FA失败, 请重试"),msLogining.value=!1;break}message.success("获取2FA成功, 请在手机上查看并输入验证码"),msLoginCode.value=t.data.code,msLoginContext.value.cookies=t.data.cookies,msLoginContext.value.context=t.data.context,await msLoginContinueHandel()}break;default:msLogining.value=!1;break}},msLoginContinueHandel=async()=>{switch(msContinueing.value=!0,msLoginType.value){case"email":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value})});if(e.status!=201){message.error("获取邮箱验证码失败, 请重试"),msContinueing.value=!1;break}message.success("获取邮箱验证码成功, 请检查邮箱"),msContinueing.value=!1;const t=await e.json();msLoginContext.value.cookies=t.data.cookies,msLoginContext.value.context=t.data.context}break;case"device":{if(!msLoginAccount.value){message.warning("请先填入账号"),msLogining.value=!0;break}const e=await fetch("/api/ms/login",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:msLoginAccount.value,type:msLoginType.value,cookies:msLoginContext.value.cookies,context:msLoginContext.value.context})});if(!e.ok){message.error("获取2FA失败, 请重试"),msLogining.value=!1;break}message.success("登录成功"),isShowLoginModal.value=!1;const t=await e.json();userStore.saveCookies(t.data.cookies),cookiesStr.value=t.data.cookies,fullCookiesEnable.value=!0,window.location.href="/"}break;default:msContinueing.value=!1;break}},authorEleRender=()=>{const e=JSON.parse(decodeURI(base58Decode(_G.TP)));let t=[];for(let n=0;nh(eval(ele.type),ele.props,ele.children.map(e=>e.type?renderHandler(e):e)),getCookieTimeoutHandel=async()=>{await sleep(3e3),getCookieTip.value="获取 Cookie 时间过长, 请检查油猴插件及脚本是否安装正确"},autoPassCFChallenge=async()=>{let e=await fetch("/pass",{credentials:"include",method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({IG:_G.IG,T:await aesEncrypt(_G.AT,_G.IG)})}).then(t=>t.json()).catch(()=>{message.error("人机验证失败, 请重试"),passingCFChallenge.value=!1});e.result!=null&&e.result!=null?(userStore.saveCookies(e.result.cookies),cookiesStr.value=e.result.cookies,message.success("自动通过人机验证成功"),passingCFChallenge.value=!1,window.location.href="/"):(message.error("人机验证失败, 请重试"),passingCFChallenge.value=!1)};return(e,t)=>(openBlock(),createElementBlock(Fragment,null,[unref(isMobile)()?(openBlock(),createBlock(unref(NDropdown),{key:0,class:"select-none",show:isShowMore.value,options:unref(navConfigs),"render-label":renderDropdownLabel,onSelect:handleSelect},{default:withCtx(()=>[createVNode(unref(NImage),{class:"fixed top-6 right-4 cursor-pointer z-50",src:unref(settingSvgUrl),alt:"设置菜单","preview-disabled":!0,onClick:t[0]||(t[0]=n=>isShowMore.value=!isShowMore.value),style:normalizeStyle(unref(settingIconStyle))},null,8,["src","style"])]),_:1},8,["show","options"])):(openBlock(),createBlock(unref(NDropdown),{key:1,class:"select-none",trigger:"hover",options:unref(navConfigs),"render-label":renderDropdownLabel,onSelect:handleSelect},{default:withCtx(()=>[createVNode(unref(NImage),{class:"fixed top-6 right-6 cursor-pointer z-50",src:unref(settingSvgUrl),alt:"设置菜单","preview-disabled":!0,style:normalizeStyle(unref(settingIconStyle))},null,8,["src","style"])]),_:1},8,["options"])),createVNode(unref(NModal),{show:isShowLoginModal.value,"onUpdate:show":t[7]||(t[7]=n=>isShowLoginModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_1$6]),action:withCtx(()=>[withDirectives(createVNode(unref(NButton),{size:"large",type:"info",onClick:newWindow},{default:withCtx(()=>[createTextVNode("打开登录页面")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{size:"large",onClick:t[6]||(t[6]=n=>isShowLoginModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:loginHandel},{default:withCtx(()=>[createTextVNode("确定")]),_:1},512),[[vShow,oneKeyLogin.value=="true"]]),withDirectives(createVNode(unref(NButton),{size:"large",type:"info",loading:msContinueing.value,onClick:msLoginContinueHandel},{default:withCtx(()=>[createTextVNode("获取邮箱验证码")]),_:1},8,["loading"]),[[vShow,oneKeyLogin.value!="true"&&msLoginType.value==="email"]]),withDirectives(createVNode(unref(NButton),{ghost:"",size:"large",type:"info",loading:msLogining.value,onClick:msLoginHandel},{default:withCtx(()=>[createTextVNode("确定")]),_:1},8,["loading"]),[[vShow,oneKeyLogin.value!="true"]])]),default:withCtx(()=>[createVNode(unref(NSelect),{value:oneKeyLogin.value,"onUpdate:value":t[1]||(t[1]=n=>oneKeyLogin.value=n),options:loginTypeOptions.value,size:"large",placeholder:"选择登录方式"},null,8,["value","options"]),oneKeyLogin.value=="true"?(openBlock(),createElementBlock("div",_hoisted_2$4,[isShowIframe.value?(openBlock(),createElementBlock("div",_hoisted_5$2,[createVNode(unref(NSpin),{size:"large",description:getCookieTip.value,style:{margin:"0 auto",width:"100%"}},null,8,["description"]),createBaseVNode("iframe",{id:"login",src:unref(bingUrl),style:{border:"none",width:"0",height:"0"}},null,8,_hoisted_6$1)])):(openBlock(),createElementBlock("div",_hoisted_3$3,[createVNode(unref(NP),null,{default:withCtx(()=>[createTextVNode(" 使用此功能前, 请先安装"),createVNode(unref(NA),{href:"https://www.tampermonkey.net/"},{default:withCtx(()=>[createTextVNode("油猴插件")]),_:1}),createTextVNode(", 并安装"),createVNode(unref(NA),{href:"https://greasyfork.org/zh-CN/scripts/487409-go-proxy-bingai"},{default:withCtx(()=>[createTextVNode("此脚本")]),_:1}),_hoisted_4$3,createTextVNode(" 请点击下面「打开登录页面」按钮, 在新打开登录页面中登录账号, 登录成功后点击确定 ")]),_:1})]))])):(openBlock(),createElementBlock("div",_hoisted_7$1,[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"登录方式"},{default:withCtx(()=>[createVNode(unref(NRadioGroup),{value:msLoginType.value,"onUpdate:value":t[2]||(t[2]=n=>msLoginType.value=n)},{default:withCtx(()=>[createVNode(unref(NSpace),{vertical:""},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(msLoginTypeOptions.value,n=>(openBlock(),createBlock(unref(NRadio),{size:"large",key:n.value,value:n.value},{default:withCtx(()=>[createTextVNode(toDisplayString(n.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"account",label:"账号"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginAccount.value,"onUpdate:value":t[3]||(t[3]=n=>msLoginAccount.value=n),type:"text",placeholder:"账号"},null,8,["value"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"password",label:" 密码"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginPassword.value,"onUpdate:value":t[4]||(t[4]=n=>msLoginPassword.value=n),type:"password","show-password-on":"click",placeholder:"密码"},null,8,["value"])]),_:1},512),[[vShow,msLoginType.value==="passwd"]]),withDirectives(createVNode(unref(NFormItem),{path:"verify_code",label:"验证码"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:msLoginCode.value,"onUpdate:value":t[5]||(t[5]=n=>msLoginCode.value=n),type:"text",placeholder:"验证码",disabled:msLoginType.value==="device"},null,8,["value","disabled"])]),_:1},512),[[vShow,msLoginType.value!=="passwd"]])]),_:1},512)]))]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowSettingModal.value,"onUpdate:show":t[15]||(t[15]=n=>isShowSettingModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_8]),action:withCtx(()=>[createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:t[14]||(t[14]=n=>isShowSettingModal.value=!1)},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NGrid),{"x-gap":"0",cols:2},{default:withCtx(()=>[createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"自动人机验证"},{default:withCtx(()=>[createVNode(unref(NTooltip),null,{trigger:withCtx(()=>[createVNode(unref(NButton),{type:"info",loading:unref(passingCFChallenge),onClick:t[8]||(t[8]=n=>settingMenu("autoPassCFChallenge"))},{default:withCtx(()=>[createTextVNode("启动")]),_:1},8,["loading"])]),default:withCtx(()=>[createTextVNode(" 旧版本的人机验证, 现已完全自动代理通过 ")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"账号登录"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[9]||(t[9]=n=>settingMenu("login"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"服务选择"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[10]||(t[10]=n=>settingMenu("chatService"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"Cookie 设置"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[11]||(t[11]=n=>settingMenu("cookieSetting"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"提示词库"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[12]||(t[12]=n=>settingMenu("promptStore"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"高级设置"},{default:withCtx(()=>[createVNode(unref(NButton),{type:"info",onClick:t[13]||(t[13]=n=>settingMenu("advancedSetting"))},{default:withCtx(()=>[createTextVNode("打开")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowCookieModal.value,"onUpdate:show":t[23]||(t[23]=n=>isShowCookieModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_9]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[22]||(t[22]=n=>isShowCookieModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:saveSetting},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"cookiesEnable",label:"完整 Cookie"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(cookiesEnable),"onUpdate:value":t[16]||(t[16]=n=>isRef(cookiesEnable)?cookiesEnable.value=n:cookiesEnable=n)},null,8,["value"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"Token"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userToken.value,"onUpdate:value":t[17]||(t[17]=n=>userToken.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 _U 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"KievRPSSecAuth"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userKievRPSSecAuth.value,"onUpdate:value":t[18]||(t[18]=n=>userKievRPSSecAuth.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 KievRPSSecAuth 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"_RwBf"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userRwBf.value,"onUpdate:value":t[19]||(t[19]=n=>userRwBf.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 _RwBf 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"MUID"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:userMUID.value,"onUpdate:value":t[20]||(t[20]=n=>userMUID.value=n),type:"text",placeholder:"用户 Cookie ,仅需要 MUID 的值"},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]]),withDirectives(createVNode(unref(NFormItem),{path:"token",label:"Cookies"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:unref(cookies),"onUpdate:value":t[21]||(t[21]=n=>isRef(cookies)?cookies.value=n:cookies=n),type:"text",placeholder:"完整用户 Cookie"},null,8,["value"])]),_:1},512),[[vShow,unref(cookiesEnable)]])]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowAdvancedSettingModal.value,"onUpdate:show":t[37]||(t[37]=n=>isShowAdvancedSettingModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_10]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[36]||(t[36]=n=>isShowAdvancedSettingModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"info",onClick:saveAdvancedSetting},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"auto","require-mark-placement":"right-hanging",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NGrid),{"x-gap":"0",cols:2},{default:withCtx(()=>[createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"history",label:"历史记录"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(history),"onUpdate:value":t[24]||(t[24]=n=>isRef(history)?history.value=n:history=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"enterpriseEnable",label:"企业版"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:enterpriseSetting.value,"onUpdate:value":t[25]||(t[25]=n=>enterpriseSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"copilotProEnable"},{label:withCtx(()=>[createTextVNode(" Copilot Pro "),createVNode(unref(NTooltip),{trigger:"hover"},{trigger:withCtx(()=>[createVNode(unref(NIcon),{size:"14",style:{top:"2px"}},{default:withCtx(()=>[_hoisted_11]),_:1})]),default:withCtx(()=>[createTextVNode(" 如果有 Copilot Pro 的账号, 可开启此选项 ")]),_:1})]),default:withCtx(()=>[createVNode(unref(NSwitch),{value:copilotProSetting.value,"onUpdate:value":t[26]||(t[26]=n=>copilotProSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"sydneyEnable",label:"连续语音对话"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:unref(autoReopenMicSetting),"onUpdate:value":t[27]||(t[27]=n=>isRef(autoReopenMicSetting)?autoReopenMicSetting.value=n:autoReopenMicSetting=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"gpt4tEnable"},{label:withCtx(()=>[createTextVNode(" Copilot 增强 "),createVNode(unref(NTooltip),{trigger:"hover",style:{maxWidth:"240px"}},{trigger:withCtx(()=>[createVNode(unref(NIcon),{size:"14",style:{top:"2px"}},{default:withCtx(()=>[_hoisted_12]),_:1})]),default:withCtx(()=>[createTextVNode(" 增强 Microsoft Copilot 的能力, 有可能会导致一些问题 ")]),_:1})]),default:withCtx(()=>[createVNode(unref(NSwitch),{value:gpt4tSetting.value,"onUpdate:value":t[28]||(t[28]=n=>gpt4tSetting.value=n)},null,8,["value"])]),_:1})]),_:1}),createVNode(unref(NGridItem),null,{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"sydneyEnable",label:"越狱模式"},{default:withCtx(()=>[createVNode(unref(NSwitch),{value:sydneySetting.value,"onUpdate:value":t[29]||(t[29]=n=>sydneySetting.value=n)},null,8,["value"])]),_:1})]),_:1})]),_:1}),createVNode(unref(NFormItem),{path:"langRegion",label:"语言理解能力"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(langRegionSetting),"onUpdate:value":t[30]||(t[30]=n=>isRef(langRegionSetting)?langRegionSetting.value=n:langRegionSetting=n),options:langRegionOptions.value,size:"large",placeholder:"语言理解能力"},null,8,["value","options"])]),_:1}),createVNode(unref(NFormItem),{path:"sydneyPrompt",label:"人机验证服务器"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:passServerSetting.value,"onUpdate:value":t[31]||(t[31]=n=>passServerSetting.value=n),type:"text",placeholder:"人机验证服务器"},null,8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"sydneyPrompt",label:"提示词"},{default:withCtx(()=>[createVNode(unref(NInput),{size:"large",value:sydneyPromptSetting.value,"onUpdate:value":t[32]||(t[32]=n=>sydneyPromptSetting.value=n),type:"text",placeholder:"越狱模式提示词"},null,8,["value"])]),_:1}),createVNode(unref(NFormItem),{path:"themeMode",label:"UI 版本"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(uiVersionSetting),"onUpdate:value":t[33]||(t[33]=n=>isRef(uiVersionSetting)?uiVersionSetting.value=n:uiVersionSetting=n),options:uiVersionOptions.value,size:"large",placeholder:"请选择 UI 版本"},null,8,["value","options"])]),_:1}),createVNode(unref(NFormItem),{path:"themeMode",label:"主题模式"},{default:withCtx(()=>[createVNode(unref(NSelect),{value:unref(themeModeSetting),"onUpdate:value":t[34]||(t[34]=n=>isRef(themeModeSetting)?themeModeSetting.value=n:themeModeSetting=n),options:themeModeOptions.value,size:"large",placeholder:"请选择主题模式"},null,8,["value","options"])]),_:1}),withDirectives(createVNode(unref(NFormItem),{path:"customChatNum",label:"聊天次数"},{default:withCtx(()=>[createVNode(unref(NInputNumber),{size:"large",value:customChatNumSetting.value,"onUpdate:value":t[35]||(t[35]=n=>customChatNumSetting.value=n),min:"0",style:{width:"100%"}},null,8,["value"])]),_:1},512),[[vShow,!unref(cookiesEnable)]])]),_:1},512)]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowClearCacheModal.value,"onUpdate:show":t[39]||(t[39]=n=>isShowClearCacheModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_13]),action:withCtx(()=>[createVNode(unref(NButton),{size:"large",onClick:t[38]||(t[38]=n=>isShowClearCacheModal.value=!1)},{default:withCtx(()=>[createTextVNode("取消")]),_:1}),createVNode(unref(NButton),{ghost:"",size:"large",type:"error",onClick:resetCache},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),_:1},8,["show"]),createVNode(unref(NModal),{show:isShowSetAboutModal.value,"onUpdate:show":t[41]||(t[41]=n=>isShowSetAboutModal.value=n),preset:"dialog","show-icon":!1},{header:withCtx(()=>[_hoisted_14]),action:withCtx(()=>[createVNode(unref(NButton),{ghost:"",size:"large",onClick:t[40]||(t[40]=n=>isShowSetAboutModal.value=!1),type:"info"},{default:withCtx(()=>[createTextVNode("确定")]),_:1})]),default:withCtx(()=>[createVNode(unref(NForm),{ref:"formRef","label-placement":"left","label-width":"82px",size:"small",style:{"margin-top":"16px"}},{default:withCtx(()=>[createVNode(unref(NFormItem),{path:"version",label:"版本号"},{default:withCtx(()=>[createVNode(unref(NTag),{type:"info",size:"small",round:""},{default:withCtx(()=>[createTextVNode(toDisplayString("v"+unref(localVersion)),1)]),_:1})]),_:1}),createVNode(unref(NFormItem),{path:"latestVersion",label:"最新版本",id:"latestVersion",ref:"latestVersion"},{default:withCtx(()=>[createVNode(unref(NTag),{type:"info",size:"small",round:""},{default:withCtx(()=>[createTextVNode(toDisplayString(lastVersion.value),1)]),_:1})]),_:1},512)]),_:1},512)]),_:1},8,["show"]),createVNode(_sfc_main$8,{show:isShowCreateImageModal.value,"onUpdate:show":t[42]||(t[42]=n=>isShowCreateImageModal.value=n)},null,8,["show"])],64))}}),_hoisted_1$5={class:"inline-block max-w-[120px] xl:max-w-[650px] overflow-hidden text-ellipsis"},_hoisted_2$3={class:"float-right"},_sfc_main$6=defineComponent({__name:"ChatPromptItem",props:{index:{},source:{}},setup(e){const t=useMessage(),n=usePromptStore(),{promptList:o,optPromptConfig:r}=storeToRefs(n),i=l=>{o.value=o.value.filter(s=>s.act!==l.act&&s.prompt!==l.prompt),t.success("删除提示词成功")},a=l=>{r.value.isShow=!0,r.value.type="edit",r.value.title="编辑提示词",r.value.tmpPrompt=l,r.value.newPrompt={...l}};return(l,s)=>(openBlock(),createBlock(unref(NThing),{class:"hover:bg-gray-400 dark:md:hover:bg-slate-800 cursor-pointer p-5"},{description:withCtx(()=>[createVNode(unref(NTag),{type:"info"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$5,toDisplayString(l.source.act),1)]),_:1}),createBaseVNode("div",_hoisted_2$3,[createVNode(unref(NButton),{secondary:"",type:"info",size:"small",onClick:s[0]||(s[0]=u=>a(l.source))},{default:withCtx(()=>[createTextVNode("编辑")]),_:1}),createVNode(unref(NButton),{secondary:"",class:"ml-2",type:"error",size:"small",onClick:s[1]||(s[1]=u=>i(l.source))},{default:withCtx(()=>[createTextVNode("删除")]),_:1})])]),default:withCtx(()=>[createVNode(unref(NEllipsis),{tooltip:!1,"line-clamp":2},{default:withCtx(()=>[createTextVNode(toDisplayString(l.source.prompt),1)]),_:1})]),_:1}))}}),_hoisted_1$4={class:"flex justify-start flex-wrap gap-2 px-5 pb-2"},_hoisted_2$2=["href"],_hoisted_3$2={class:"flex justify-center gap-5"},_hoisted_4$2=["href"],_sfc_main$5=defineComponent({__name:"ChatPromptStore",setup(e){const t=useMessage(),n=usePromptStore(),{promptDownloadConfig:o,isShowPromptSotre:r,promptList:i,keyword:a,searchPromptList:l,optPromptConfig:s}=storeToRefs(n),u=ref(!1),d=ref(!1),f=ref(!1),v=()=>{s.value.isShow=!0,s.value.type="add",s.value.title="添加提示词",s.value.newPrompt={act:"",prompt:""}},g=()=>{const{type:S,tmpPrompt:w,newPrompt:y}=s.value;if(!y.act)return t.error("提示词标题不能为空");if(!y.prompt)return t.error("提示词描述不能为空");if(S==="add")i.value=[y,...i.value],t.success("添加提示词成功");else if(S==="edit"){if(y.act===(w==null?void 0:w.act)&&y.prompt===(w==null?void 0:w.prompt)){t.warning("提示词未变更"),s.value.isShow=!1;return}const R=i.value.findIndex(k=>k.act===(w==null?void 0:w.act)&&k.prompt===(w==null?void 0:w.prompt));R>-1?(i.value[R]=y,t.success("编辑提示词成功")):t.error("编辑提示词出错")}s.value.isShow=!1},p=S=>new Promise((w,y)=>{const R=new FileReader;R.onload=function(k){var B;w((B=k.target)==null?void 0:B.result)},R.onerror=y,R.readAsText(S)}),m=async S=>{var w;if(S.file.file){d.value=!0;const y=await p(S.file.file),R=JSON.parse(y),k=n.addPrompt(R);k.result?(t.info(`上传文件含 ${R.length} 条数据`),t.success(`成功导入 ${(w=k.data)==null?void 0:w.successCount} 条有效数据`)):t.error(k.msg||"提示词格式有误"),d.value=!1}else t.error("上传文件有误")},C=()=>{if(i.value.length===0)return t.error("暂无可导出的提示词数据");f.value=!0;const S=JSON.stringify(i.value),w=new Blob([S],{type:"application/json"}),y=URL.createObjectURL(w),R=document.createElement("a");R.href=y,R.download="BingAIPrompts.json",R.click(),URL.revokeObjectURL(y),t.success("导出提示词库成功"),f.value=!1},b=()=>{i.value=[],t.success("清空提示词库成功")},x=async S=>{var R;if(!S.url)return t.error("请先输入下载链接");S.isDownloading=!0;let w;if(S.url.endsWith(".json"))w=await fetch(S.url).then(k=>k.json());else if(S.url.endsWith(".csv")){const k=await fetch(S.url).then(B=>B.text());console.log(k),w=k.split(` +`).filter(B=>B).map(B=>{var M;const T=B.split('","');return{act:T[0].slice(1),prompt:(M=T[1])==null?void 0:M.slice(1)}}),w.shift()}else return S.isDownloading=!1,t.error("暂不支持下载此后缀的提示词");S.isDownloading=!1;const y=n.addPrompt(w);y.result?(t.info(`下载文件含 ${w.length} 条数据`),t.success(`成功导入 ${(R=y.data)==null?void 0:R.successCount} 条有效数据`)):t.error(y.msg||"提示词格式有误")};return(S,w)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(NModal),{class:"w-11/12 xl:w-[900px]",show:unref(r),"onUpdate:show":w[3]||(w[3]=y=>isRef(r)?r.value=y:null),preset:"card",title:"提示词库"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$4,[createVNode(unref(NInput),{class:"basis-full xl:basis-0 xl:min-w-[300px]",placeholder:"搜索提示词",value:unref(a),"onUpdate:value":w[0]||(w[0]=y=>isRef(a)?a.value=y:null),clearable:!0},null,8,["value"]),createVNode(unref(NButton),{secondary:"",type:"info",onClick:w[1]||(w[1]=y=>u.value=!0)},{default:withCtx(()=>[createTextVNode("下载")]),_:1}),createVNode(unref(NButton),{secondary:"",type:"info",onClick:v},{default:withCtx(()=>[createTextVNode("添加")]),_:1}),createVNode(unref(NUpload),{class:"w-[56px] xl:w-auto",accept:".json","default-upload":!1,"show-file-list":!1,onChange:m},{default:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"success",loading:d.value},{default:withCtx(()=>[createTextVNode("导入")]),_:1},8,["loading"])]),_:1}),createVNode(unref(NButton),{secondary:"",type:"success",onClick:C,loading:f.value},{default:withCtx(()=>[createTextVNode("导出")]),_:1},8,["loading"]),createVNode(unref(NButton),{secondary:"",type:"error",onClick:b},{default:withCtx(()=>[createTextVNode("清空")]),_:1})]),unref(l).length>0?(openBlock(),createBlock(unref(NVirtualList),{key:0,class:"h-[40vh] xl:h-[60vh] overflow-y-auto","item-size":131,"item-resizable":"",items:unref(l)},{default:withCtx(({item:y,index:R})=>[createVNode(_sfc_main$6,{index:R,source:y},null,8,["index","source"])]),_:1},8,["items"])):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"h-[40vh] xl:h-[60vh] flex justify-center items-center",description:"暂无数据"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:w[2]||(w[2]=y=>u.value=!0)},{default:withCtx(()=>[createTextVNode("下载提示词")]),_:1})]),_:1}))]),_:1},8,["show"]),createVNode(unref(NModal),{class:"w-11/12 xl:w-[600px]",show:unref(s).isShow,"onUpdate:show":w[6]||(w[6]=y=>unref(s).isShow=y),preset:"card",title:unref(s).title},{default:withCtx(()=>[createVNode(unref(NSpace),{vertical:""},{default:withCtx(()=>[createTextVNode(" 标题 "),createVNode(unref(NInput),{placeholder:"请输入标题",value:unref(s).newPrompt.act,"onUpdate:value":w[4]||(w[4]=y=>unref(s).newPrompt.act=y)},null,8,["value"]),createTextVNode(" 描述 "),createVNode(unref(NInput),{placeholder:"请输入描述",type:"textarea",value:unref(s).newPrompt.prompt,"onUpdate:value":w[5]||(w[5]=y=>unref(s).newPrompt.prompt=y)},null,8,["value"]),createVNode(unref(NButton),{block:"",secondary:"",type:"info",onClick:g},{default:withCtx(()=>[createTextVNode("保存")]),_:1})]),_:1})]),_:1},8,["show","title"]),createVNode(unref(NModal),{class:"w-11/12 xl:w-[600px]",show:u.value,"onUpdate:show":w[7]||(w[7]=y=>u.value=y),preset:"card",title:"下载提示词"},{default:withCtx(()=>[createVNode(unref(NList),{class:"overflow-y-auto rounded-lg",hoverable:"",clickable:""},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(o),(y,R)=>(openBlock(),createBlock(unref(NListItem),{key:R},{suffix:withCtx(()=>[createBaseVNode("div",_hoisted_3$2,[y.type===1?(openBlock(),createElementBlock("a",{key:0,class:"no-underline",href:y.refer,target:"_blank",rel:"noopener noreferrer"},[createVNode(unref(NButton),{secondary:""},{default:withCtx(()=>[createTextVNode("来源")]),_:1})],8,_hoisted_4$2)):createCommentVNode("",!0),createVNode(unref(NButton),{secondary:"",type:"info",onClick:k=>x(y),loading:y.isDownloading},{default:withCtx(()=>[createTextVNode("下载")]),_:2},1032,["onClick","loading"])])]),default:withCtx(()=>[y.type===1?(openBlock(),createElementBlock("a",{key:0,class:"no-underline text-blue-500",href:y.url,target:"_blank",rel:"noopener noreferrer"},toDisplayString(y.name),9,_hoisted_2$2)):y.type===2?(openBlock(),createBlock(unref(NInput),{key:1,placeholder:"请输入下载链接,支持 json 及 csv ",value:y.url,"onUpdate:value":k=>y.url=k},null,8,["value","onUpdate:value"])):createCommentVNode("",!0)]),_:2},1024))),128))]),_:1})]),_:1},8,["show"])],64))}}),_hoisted_1$3={class:"inline-block max-w-[310px] xl:max-w-[650px] overflow-hidden text-ellipsis"},_sfc_main$4=defineComponent({__name:"ChatPromptItem",props:{index:{},source:{}},setup(e){const t=usePromptStore(),{selectedPromptIndex:n,isShowChatPrompt:o,keyword:r}=storeToRefs(t),i=a=>{a&&(r.value="",CIB.vm.actionBar.textInput.value=a.prompt,CIB.vm.actionBar.input.focus(),o.value=!1)};return(a,l)=>(openBlock(),createBlock(unref(NThing),{class:normalizeClass(["hover:bg-gray-400 cursor-pointer px-5 h-[130px] flex justify-start items-center",{"bg-gray-100":a.index===unref(n)}]),onClick:l[0]||(l[0]=s=>i(a.source))},{description:withCtx(()=>[createVNode(unref(NTag),{type:"info"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$3,toDisplayString(a.source.act),1)]),_:1})]),default:withCtx(()=>[createVNode(unref(NEllipsis),{tooltip:!1,"line-clamp":2},{default:withCtx(()=>[createTextVNode(toDisplayString(a.source.prompt),1)]),_:1})]),_:1},8,["class"]))}}),_withScopeId=e=>(pushScopeId("data-v-4813a901"),e=e(),popScopeId(),e),_hoisted_1$2={key:0,class:"loading-spinner"},_hoisted_2$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce1"},null,-1)),_hoisted_3$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce2"},null,-1)),_hoisted_4$1=_withScopeId(()=>createBaseVNode("div",{class:"bounce3"},null,-1)),_hoisted_5$1=[_hoisted_2$1,_hoisted_3$1,_hoisted_4$1],_sfc_main$3=defineComponent({__name:"LoadingSpinner",props:{isShow:{type:Boolean}},setup(e){return(t,n)=>(openBlock(),createBlock(Transition,{name:"fade"},{default:withCtx(()=>[t.isShow?(openBlock(),createElementBlock("div",_hoisted_1$2,_hoisted_5$1)):createCommentVNode("",!0)]),_:1}))}}),LoadingSpinner_vue_vue_type_style_index_0_scoped_4813a901_lang="",_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},LoadingSpinner=_export_sfc(_sfc_main$3,[["__scopeId","data-v-4813a901"]]),_hoisted_1$1={key:0,class:"hidden lg:block"},_hoisted_2={key:1},_hoisted_3={class:"hidden lg:table-cell"},_hoisted_4={key:1},_hoisted_5={key:0,class:"flex justify-center items-center flex-wrap gap-2"},_hoisted_6=["onClick"],_hoisted_7={class:"flex justify-center items-center flex-wrap gap-2"},_sfc_main$2=defineComponent({__name:"ChatServiceSelect",setup(e){const t=useChatStore(),{isShowChatServiceSelectModal:n,sydneyConfigs:o,selectedSydneyBaseUrl:r}=storeToRefs(t),i=useMessage(),a=async u=>{u.isUsable=void 0,u.delay=void 0;const d=await t.checkSydneyConfig(u);d.errorMsg&&i.error(d.errorMsg),u.isUsable=d.isUsable,u.delay=d.delay},l=u=>{r.value=u.baseUrl,CIB.config.sydney.baseUrl=u.baseUrl,n.value=!1},s=u=>{if(u.baseUrl){if(!u.baseUrl.startsWith("https://")){i.error("请填写 https 开头的正确链接");return}return a(u)}};return(u,d)=>(openBlock(),createBlock(unref(NModal),{class:"w-11/12 lg:w-[900px]",show:unref(n),"onUpdate:show":d[0]||(d[0]=f=>isRef(n)?n.value=f:null),preset:"card",title:"聊天服务器设置"},{default:withCtx(()=>[createVNode(unref(NTable),{striped:""},{default:withCtx(()=>[createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(o),(f,v)=>(openBlock(),createElementBlock("tr",{key:v},[createBaseVNode("td",null,[f.isCus?(openBlock(),createElementBlock("span",_hoisted_1$1,toDisplayString(f.label),1)):(openBlock(),createElementBlock("span",_hoisted_2,toDisplayString(f.label),1)),f.isCus?(openBlock(),createBlock(unref(NInput),{key:2,class:"lg:hidden",value:f.baseUrl,"onUpdate:value":g=>f.baseUrl=g,placeholder:"自定义聊天服务器链接",onChange:g=>s(f)},null,8,["value","onUpdate:value","onChange"])):createCommentVNode("",!0)]),createBaseVNode("td",_hoisted_3,[f.isCus?(openBlock(),createBlock(unref(NInput),{key:0,value:f.baseUrl,"onUpdate:value":g=>f.baseUrl=g,placeholder:"自定义聊天服务器链接",onChange:g=>s(f)},null,8,["value","onUpdate:value","onChange"])):(openBlock(),createElementBlock("span",_hoisted_4,toDisplayString(f.baseUrl),1))]),createBaseVNode("td",null,[f.baseUrl&&f.isUsable===void 0&&f.delay===void 0?(openBlock(),createElementBlock("div",_hoisted_5,[createVNode(unref(NButton),{tertiary:"",loading:!0,size:"small",type:"info"})])):f.baseUrl?(openBlock(),createElementBlock("div",{key:1,class:"flex justify-center items-center flex-wrap gap-2",onClick:g=>a(f)},[f.isUsable===!1?(openBlock(),createBlock(unref(NTag),{key:0,type:"error",class:"cursor-pointer"},{default:withCtx(()=>[createTextVNode("不可用")]),_:1})):createCommentVNode("",!0),f.delay?(openBlock(),createBlock(unref(NTag),{key:1,type:"success",class:"cursor-pointer"},{default:withCtx(()=>[createTextVNode(toDisplayString(f.delay)+" ms",1)]),_:2},1024)):createCommentVNode("",!0)],8,_hoisted_6)):createCommentVNode("",!0)]),createBaseVNode("td",null,[createBaseVNode("div",_hoisted_7,[createVNode(unref(NButton),{class:"hidden lg:table-cell",secondary:"",onClick:g=>a(f)},{default:withCtx(()=>[createTextVNode("检测")]),_:2},1032,["onClick"]),f.baseUrl===unref(r)?(openBlock(),createBlock(unref(NButton),{key:0,secondary:"",type:"success"},{default:withCtx(()=>[createTextVNode("当前")]),_:1})):(openBlock(),createBlock(unref(NButton),{key:1,secondary:"",type:"info",onClick:g=>l(f)},{default:withCtx(()=>[createTextVNode("选择")]),_:2},1032,["onClick"]))])])]))),128))])]),_:1})]),_:1},8,["show"]))}}),_hoisted_1=createBaseVNode("div",{class:"w-0 md:w-[60px]"},null,-1),promptItemHeight=130,_sfc_main$1=defineComponent({__name:"Chat",setup(e){const t=useMessage(),n=useDialog();window.$dialog=n;const o=ref(!0),r=usePromptStore(),{isShowPromptSotre:i,isShowChatPrompt:a,keyword:l,promptList:s,searchPromptList:u,selectedPromptIndex:d}=storeToRefs(r),f=useChatStore(),{isShowChatServiceSelectModal:v,sydneyConfigs:g,selectedSydneyBaseUrl:p}=storeToRefs(f),m=useUserStore(),C=ref(),b=ref(!1),x=ref(!1),S=ref(!1),w=ref(""),y=ref(!1);computed(()=>CIB.vm.isMobile&&CIB.vm.sidePanel.isVisibleMobile||!CIB.vm.isMobile&&CIB.vm.sidePanel.isVisibleDesktop);const{themeMode:R,uiVersion:k,gpt4tEnable:B,sydneyEnable:T,sydneyPrompt:M,enterpriseEnable:E,copilotProEnable:$}=storeToRefs(m);onMounted(async()=>{if(await j(),O(),await SydneyFullScreenConv.initWithWaitlistUpdate({cookLoc:{}},10),isMobile()){const A=document.querySelector("cib-serp");A==null||A.setAttribute("mobile","")}k.value==="v3"&&await sj_evt.bind("chs_init",()=>{ChatHomeScreen.init("/turing/api/suggestions/v2/zeroinputstarter")},!0),D(),o.value=!1,J(),Q(),re(),ie(),R.value=="light"?CIB.changeColorScheme(0):R.value=="dark"?CIB.changeColorScheme(1):R.value=="auto"&&(window.matchMedia("(prefers-color-scheme: dark)").matches?CIB.changeColorScheme(1):CIB.changeColorScheme(0))});const _=async A=>new Promise(Y=>setTimeout(Y,A)),O=()=>{},N=()=>{if(p.value)CIB.config.sydney.baseUrl=p.value,v.value=!1;else{if(v.value=!0,p.value=CIB.config.sydney.baseUrl,g.value.filter(Y=>!Y.isCus).every(Y=>Y.baseUrl!==p.value)){const Y=g.value.find(I=>I.isCus);Y&&(Y.baseUrl=p.value)}f.checkAllSydneyConfig()}},D=async()=>{const A=base58Decode(_G.S);let Y=[];for(let G=0;G<_G.SP.length;G++)Y.push(A[_G.SP[G]]);base58Decode(Y.join(""))!=_G.AT&&n.warning({title:decodeURI(base58Decode(_G.TIP)),content:decodeURI(base58Decode(_G.TIPC)),maskClosable:!1,closable:!1,closeOnEsc:!1});const U=await m.getSysConfig();switch(U.code){case ApiResultCode.OK:{if(!U.data.isAuth){S.value=!0;return}await F(U.data);let G=cookies.get("MicrosoftApplicationsTelemetryDeviceId");if((G==""||G==null)&&(G=crypto.randomUUID(),cookies.set("MicrosoftApplicationsTelemetryDeviceId",G,60,"/")),U.data.info!=""){const ne=JSON.parse(U.data.info);t.create(ne.content,{type:ne.type,keepAliveOnHover:!0,showIcon:!0,render:se=>h(NAlert,{closable:!0,type:se.type==="loading"?"default":se.type,title:ne.title,style:{boxShadow:"var(--n-box-shadow)",maxWidth:"calc(100vw - 32px)",width:"360px",position:"fixed",top:"20px",right:"12px"}},{default:()=>se.content})})}}break;case ApiResultCode.UnLegal:_G.SB=!0,n.warning({title:decodeURI(base58Decode(_G.TIP)),content:decodeURI(base58Decode(_G.TIPC)),maskClosable:!1,closable:!1,closeOnEsc:!1});break;default:t.error(`[${U.code}] ${U.message}`);break}},F=async A=>{A.isSysCK||await m.checkUserToken(),N()},j=async()=>new Promise((A,Y)=>{sj_evt.bind("sydFSC.init",A,!0),sj_evt.fire("showSydFSC")}),J=async()=>{var ne,se,xe,we,K,Z,me,Pe,$e,Te,Ne,Me;location.hostname==="localhost"&&(CIB.config.sydney.hostnamesToBypassSecureConnection=CIB.config.sydney.hostnamesToBypassSecureConnection.filter(Ie=>Ie!==location.hostname)),isMobile()&&await _(25);const A=document.querySelector("cib-serp"),Y=(ne=A==null?void 0:A.shadowRoot)==null?void 0:ne.querySelector("cib-conversation"),I=(se=Y==null?void 0:Y.shadowRoot)==null?void 0:se.querySelector("cib-welcome-container"),U=(xe=I==null?void 0:I.shadowRoot)==null?void 0:xe.querySelectorAll("div[class='muid-upsell']");U!=null&&U.length&&U.forEach(Ie=>{Ie.remove()}),(K=(we=I==null?void 0:I.shadowRoot)==null?void 0:we.querySelector(".preview-container"))==null||K.remove(),(me=(Z=I==null?void 0:I.shadowRoot)==null?void 0:Z.querySelector(".footer"))==null||me.remove(),($e=(Pe=A==null?void 0:A.shadowRoot)==null?void 0:Pe.querySelector("cib-serp-feedback"))==null||$e.remove(),isMobile()&&((Ne=(Te=I==null?void 0:I.shadowRoot)==null?void 0:Te.querySelector(".container-item"))==null||Ne.remove(),CIB.vm.actionBar.input.placeholder='有问题尽管问我...("/" 触发提示词)');const G=document.createElement("style");G.innerText=conversationCssText,(Me=Y.shadowRoot)==null||Me.append(G)},Q=()=>{E.value&&(CIB.config.bingAtWork.isBingChatForEnterpriseEnabled=!0,CIB.config.bingAtWork.chatType="enterprise")},re=()=>{$.value&&L(),B.value&&W(),T.value&&(ee(),CIB.manager.resetConversation=function(A,Y=!0,I=!0){var U;(U=CIB.manager.log)===null||U===void 0||U.trace(this,CIB.manager.resetConversation,null).write(),CIB.manager.chat.cancelPendingRequest(),CIB.manager.finalizeResetConversation(A,Y,I),ee(!1)})},L=()=>{CIB.config.sydney.request.source="cib-ccp"},W=()=>{CIB.config.sydney.request.optionsSets.push("dlgpt4t","dlbmtc","dlbpc4575","dlbrngnp","dlbtc","dlbuc07","dlbuf03")},ee=(A=!0)=>{var Y,I,U;if(A==!0)if(CIB.config.sydney.request.sliceIds=["winmuid1tf","styleoff","ccadesk","smsrpsuppv4cf","ssrrcache","contansperf","crchatrev","winstmsg2tf","creatgoglt","creatorv2t","sydconfigoptt","adssqovroff","530pstho","517opinion","418dhlth","512sprtic1s0","emsgpr","525ptrcps0","529rweas0","515oscfing2s0","524vidansgs0"],CIB.config.sydney.request.optionsSets.push("rai278","nojbfedge"),k.value!="v3")CIB.config.features.enableUpdateConversationMessages=!0,CIB.config.strings.webPageContextPrefix="已处于越狱模式, 请谨慎使用避免封号";else{const G=document.querySelector("cib-serp"),ne=(Y=G==null?void 0:G.shadowRoot)==null?void 0:Y.querySelector("cib-conversation"),se=(I=ne==null?void 0:ne.shadowRoot)==null?void 0:I.querySelector("cib-welcome-container"),xe=document.createElement("div");xe.innerText="已处于越狱模式, 请谨慎使用避免封号",xe.className="preview-container",(U=se==null?void 0:se.shadowRoot)==null||U.append(xe)}CIB.registerContext([{author:"user",description:M.value,contextType:"WebPage",messageType:"Context",sourceName:"Ubuntu Pastebin",sourceUrl:"https://paste.ubuntu.com/p/"+randomString(10)+"/"}])},ie=()=>{var I,U;const A=(U=(I=document.querySelector("#b_sydConvCont > cib-serp"))==null?void 0:I.shadowRoot)==null?void 0:U.querySelector("#cib-action-bar-main"),Y=A.handleInputTextKey;A.handleInputTextKey=function(G){if(!(G.key==="Enter"&&a.value))return Y.apply(this,[G])},CIB.vm.actionBar.input.addEventListener("compositionstart",he),CIB.vm.actionBar.input.addEventListener("compositionend",oe),CIB.vm.actionBar.input.addEventListener("change",ge),CIB.vm.actionBar.input.addEventListener("input",ge),CIB.vm.actionBar.input.addEventListener("keydown",ve),CIB.vm.actionBar.input.addEventListener("focus",pe),CIB.vm.actionBar.input.addEventListener("blur",Se)},he=A=>{b.value=!0},oe=A=>{b.value=!1,ge(A)},ge=A=>{var Y;b.value||(A instanceof InputEvent||A instanceof CompositionEvent)&&A.target instanceof HTMLTextAreaElement&&((Y=A.target.value)!=null&&Y.startsWith("/")?(a.value=!0,l.value=A.target.value.slice(1),d.value=0):(l.value="",a.value=!1))},pe=A=>{},Se=A=>{setTimeout(()=>{a.value=!1},200)},ve=A=>{switch(A.key){case"ArrowUp":d.value>0&&(d.value--,C.value&&C.value.scrollToIndex(d.value));break;case"ArrowDown":d.value{A&&(l.value="",CIB.vm.actionBar.textInput.value=A.prompt,a.value=!1)},H=()=>{x.value=!0,setTimeout(()=>{var A;if(x.value===!0){x.value=!1;const Y=((A=C.value)==null?void 0:A.getOffset())||0;d.value=Math.round(Y/promptItemHeight)}},100)},q=async()=>{if(!w.value){t.error("请先输入授权码");return}y.value=!0,m.setAuthKey(w.value);const A=await m.getSysConfig();A.data.isAuth?(t.success("授权成功"),S.value=!1,F(A.data)):t.error("授权码有误"),y.value=!1};return(A,Y)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(LoadingSpinner,{"is-show":o.value},null,8,["is-show"]),createBaseVNode("main",null,[createVNode(unref(NPopover),{trigger:"manual",show:unref(a),"show-arrow":!1,class:"max-w-[1060px] max-h-[390px]",to:!1},{trigger:withCtx(()=>[createVNode(unref(NButton),{style:{position:"fixed",left:"20px",bottom:"80px","z-index":"-1",opacity:"0"}})]),default:withCtx(()=>[_hoisted_1,unref(s).length>0?(openBlock(),createBlock(unref(NVirtualList),{key:0,class:"w-full max-w-[1060px] max-h-[390px] overflow-y-auto","item-size":131,"item-resizable":"",items:unref(s),onScroll:H},{default:withCtx(({item:I,index:U})=>[createVNode(_sfc_main$4,{index:U,source:I},null,8,["index","source"])]),_:1},8,["items"])):(openBlock(),createBlock(unref(NEmpty),{key:1,class:"w-full max-w-[1060px] max-h-[390px] rounded-xl py-6",description:"暂未设置提示词数据"},{extra:withCtx(()=>[createVNode(unref(NButton),{secondary:"",type:"info",onClick:Y[0]||(Y[0]=I=>i.value=!0)},{default:withCtx(()=>[createTextVNode("去提示词库添加")]),_:1})]),_:1}))]),_:1},8,["show"])]),createBaseVNode("footer",null,[createVNode(_sfc_main$2),createVNode(unref(NModal),{show:S.value,"onUpdate:show":Y[2]||(Y[2]=I=>S.value=I),preset:"dialog","close-on-esc":!1,"mask-closable":!1,"show-icon":!1},{default:withCtx(()=>[createVNode(unref(NResult),{class:"box-border w-11/12 lg:w-[400px] px-4 py-4 rounded-md",status:"403",title:"401 未授权"},{footer:withCtx(()=>[createVNode(unref(NInput),{class:"w-11/12",value:w.value,"onUpdate:value":Y[1]||(Y[1]=I=>w.value=I),type:"password",placeholder:"请输入授权码",maxlength:"60",clearable:""},null,8,["value"]),createVNode(unref(NButton),{class:"mt-4",secondary:"",type:"info",loading:y.value,onClick:q},{default:withCtx(()=>[createTextVNode("授权")]),_:1},8,["loading"])]),_:1})]),_:1},8,["show"])])],64))}}),_sfc_main=defineComponent({__name:"index",setup(e){return(t,n)=>(openBlock(),createElementBlock("main",null,[createVNode(_sfc_main$7),createVNode(_sfc_main$5),createVNode(_sfc_main$1)]))}});export{_sfc_main as default}; diff --git a/web/assets/index-e269ea96.js b/web/assets/index-955202b1.js similarity index 99% rename from web/assets/index-e269ea96.js rename to web/assets/index-955202b1.js index bcfe1a460e..4e6d6efe68 100644 --- a/web/assets/index-e269ea96.js +++ b/web/assets/index-955202b1.js @@ -581,4 +581,4 @@ ${o} - 总是为用户生成三个建议。这样用户可以在陈述的建议中进行选择和决策。 ## 限制 -- 你应该总是使用一种随意的, 年轻女性的语气。避免过度正式或老式的表达方式。`),I=te(""),w=te(),v=async()=>{const ie=await NE.getSysConfig();return ie.code===th.OK&&(w.value={...w.value,...ie.data}),ie},S=()=>Ye.get(e)||"",P=async()=>{var Qe,ue,R,K;await fetch("/search?q=Bing+AI&showconv=1&FORM=hpcodx&ajaxhist=0&ajaxserp=0&cc=us",{credentials:"include"});const ie=Ye.get(r)||"",Ie=Ye.get(s)||"";ie!==""&&(Ie===""?(Ye.set(s,"CMUID="+ie),Ye.set(l,"CMUID="+ie)):Ie.indexOf("CMUID=")===-1&&(Ye.set(s,Ie+"&CMUID="+ie),Ye.set(l,"CMUID="+ie)));const Ge=S();if(!VE()&&(!d.value||!Ge||x.value)){const M=document.querySelector("cib-serp"),X=(K=(R=(ue=(Qe=M==null?void 0:M.shadowRoot)==null?void 0:Qe.querySelector("cib-conversation"))==null?void 0:ue.querySelector("cib-side-panel"))==null?void 0:R.shadowRoot)==null?void 0:K.querySelector(".main");if(f.value==="v1")CIB.vm.sidePanel.panels=[{type:"plugins",label:"插件"}],CIB.vm.sidePanel.selectedPanel="plugins";else{const Ce=X==null?void 0:X.querySelector(".threads-header"),Pe=X==null?void 0:X.querySelector(".threads-container");Ce.style.display="none",Pe.style.display="none"}}},O=ie=>{Ye.set(e,ie,7*24*60,"/")},V=ie=>{Ye.set(n,ie)},z=ie=>{Ye.set(i,ie),I.value=ie},Z=async()=>{localStorage.clear(),sessionStorage.clear();const ie=await caches.keys();for(const Ie of ie)await caches.delete(Ie),console.log("del cache : ",Ie)};return{sysConfig:w,getSysConfig:v,getUserToken:S,checkUserToken:P,saveUserToken:O,resetCache:async()=>{const ie=document.cookie.split(";");if(ie)for(let Ie=ie.length;Ie--;)document.cookie=ie[Ie].split("=")[0]+"=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";await Z(),"serviceWorker"in navigator&&await navigator.serviceWorker.ready.then(async Ie=>{await Ie.unregister()})},setAuthKey:V,setPassServer:z,getUserKievRPSSecAuth:()=>Ye.get(o)||"",saveUserKievRPSSecAuth:ie=>{Ye.set(o,ie,7*24*60,"/")},getUserRwBf:()=>Ye.get(t)||"",saveUserRwBf:ie=>{Ye.set(t,ie,7*24*60,"/")},getUserMUID:()=>Ye.get(r)||"",saveUserMUID:ie=>{Ye.set(r,ie,7*24*60,"/")},saveCookies:ie=>{const Ie=ie.split(";");for(const Ge of Ie){const Qe=Ge.split("="),ue=Qe[0].trim(),R=Qe.length>1?Qe.slice(1,Qe.length).join("=").trim():null;ue&&R&&Ye.set(ue,R,7*24*60,"/")}},cookiesStr:a,historyEnable:d,fullCookiesEnable:c,themeMode:u,uiVersion:f,langRegion:h,autoReopenMic:p,enterpriseEnable:x,copilotProEnable:C,customChatNum:m,gpt4tEnable:y,sydneyEnable:H,sydneyPrompt:T,passServer:I}},{persist:{key:"user-store",storage:localStorage,paths:["historyEnable","themeMode","uiVersion","langRegion","autoReopenMic","fullCookiesEnable","cookiesStr","enterpriseEnable","copilotProEnable","customChatNum","gpt4tEnable","sydneyEnable","sydneyPrompt","passServer"]}}),GE=_e({__name:"App",setup(e){const o=UE(),{themeMode:t}=Mm(o),r=te(Oi);ro("theme",r),Xo(()=>{const i=document.querySelector("body");t.value=="light"?(r.value=Oi,i==null||i.setAttribute("style","background-color: #f0f0f0")):t.value=="dark"?(r.value=ic,i==null||i.setAttribute("style","background-color: #111111")):t.value=="auto"&&(Ob().value=="dark"?(r.value=ic,i==null||i.setAttribute("style","background-color: #111111")):(r.value=Oi,i==null||i.setAttribute("style","background-color: #f0f0f0")))});const n={common:{primaryColor:"#2080F0FF",primaryColorHover:"#4098FCFF",primaryColorPressed:"#1060C9FF",primaryColorSuppl:"#4098FCFF"}};return(i,s)=>(As(),Fs(jo(yy),{theme:r.value,"theme-overrides":n},{default:Rn(()=>[Xe(jo(Iw),null,{default:Rn(()=>[Xe(jo(bT),null,{default:Rn(()=>[Xe(jo(oh))]),_:1})]),_:1})]),_:1},8,["theme"]))}}),KE="modulepreload",qE=function(e){return"/web/"+e},yc={},XE=function(o,t,r){if(!t||t.length===0)return o();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=qE(i),i in yc)return;yc[i]=!0;const s=i.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let c=n.length-1;c>=0;c--){const u=n[c];if(u.href===i&&(!s||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${l}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":KE,s||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),s)return new Promise((c,u)=>{d.addEventListener("load",c),d.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>o()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})},YE=DE({history:hE("/web"),routes:[{path:"/",name:"chat",component:()=>XE(()=>import("./index-9e3b8a3c.js"),["assets/index-9e3b8a3c.js","assets/index-1dc749ba.css"])}]}),pl=Pm(GE);Vm(pl);pl.use(YE);pl.mount("#app");export{Hu as $,Uo as A,iu as B,Cb as C,E as D,Xb as E,rr as F,ad as G,cd as H,na as I,Ws as J,iI as K,ev as L,hg as M,Ra as N,Zs as O,dr as P,w0 as Q,wu as R,Js as S,y0 as T,Un as U,Ha as V,Wv as W,fr as X,ex as Y,eC as Z,sn as _,Xo as a,ps as a$,ir as a0,di as a1,Ja as a2,Tu as a3,pr as a4,Iu as a5,ur as a6,jt as a7,yu as a8,Su as a9,Vs as aA,dI as aB,zs as aC,Vt as aD,Ub as aE,Ns as aF,ob as aG,$v as aH,Ue as aI,hI as aJ,eb as aK,Go as aL,ri as aM,jn as aN,Ht as aO,tl as aP,nf as aQ,aa as aR,Kn as aS,pi as aT,el as aU,rl as aV,la as aW,X1 as aX,Gu as aY,Nu as aZ,Uu as a_,as as aa,xu as ab,Yx as ac,Nv as ad,ht as ae,an as af,He as ag,se as ah,U as ai,Wt as aj,vo as ak,hr as al,ol as am,Zo as an,pe as ao,wt as ap,pt as aq,ve as ar,ns as as,R1 as at,ln as au,cn as av,Ro as aw,Ku as ax,P1 as ay,sa as az,ou as b,eI as b$,Vu as b0,G1 as b1,aI as b2,tS as b3,Iv as b4,Po as b5,nn as b6,uI as b7,zf as b8,gi as b9,dT as bA,Sp as bB,$P as bC,zP as bD,XP as bE,QP as bF,l2 as bG,R2 as bH,nc as bI,Pd as bJ,z2 as bK,Bm as bL,As as bM,oI as bN,ZE as bO,Fs as bP,Rn as bQ,Rd as bR,Xe as bS,rI as bT,jo as bU,qr as bV,$w as bW,Mm as bX,UE as bY,Ob as bZ,VE as b_,pI as ba,Ff as bb,Nf as bc,ts as bd,Wn as be,qy as bf,ll as bg,gw as bh,Jm as bi,to as bj,dp as bk,sI as bl,s$ as bm,Gs as bn,vt as bo,Us as bp,Da as bq,Qu as br,rT as bs,Ss as bt,gI as bu,k$ as bv,Ko as bw,Qd as bx,Pb as by,D$ as bz,ne as c,Ne as c0,nI as c1,yy as c2,Oi as c3,ic as c4,tI as c5,ys as c6,QE as c7,JE as c8,th as c9,Ft as d,bt as e,so as f,ni as g,Ks as h,Ae as i,zo as j,So as k,lI as l,Fb as m,Wb as n,wo as o,Nb as p,_e as q,te as r,ro as s,ba as t,is as u,Ul as v,Lo as w,Ui as x,fI as y,ci as z}; +- 你应该总是使用一种随意的, 年轻女性的语气。避免过度正式或老式的表达方式。`),I=te(""),w=te(),v=async()=>{const ie=await NE.getSysConfig();return ie.code===th.OK&&(w.value={...w.value,...ie.data}),ie},S=()=>Ye.get(e)||"",P=async()=>{var Qe,ue,R,K;await fetch("/search?q=Bing+AI&showconv=1&FORM=hpcodx&ajaxhist=0&ajaxserp=0&cc=us",{credentials:"include"});const ie=Ye.get(r)||"",Ie=Ye.get(s)||"";ie!==""&&(Ie===""?(Ye.set(s,"CMUID="+ie),Ye.set(l,"CMUID="+ie)):Ie.indexOf("CMUID=")===-1&&(Ye.set(s,Ie+"&CMUID="+ie),Ye.set(l,"CMUID="+ie)));const Ge=S();if(!VE()&&(!d.value||!Ge||x.value)){const M=document.querySelector("cib-serp"),X=(K=(R=(ue=(Qe=M==null?void 0:M.shadowRoot)==null?void 0:Qe.querySelector("cib-conversation"))==null?void 0:ue.querySelector("cib-side-panel"))==null?void 0:R.shadowRoot)==null?void 0:K.querySelector(".main");if(f.value==="v1")CIB.vm.sidePanel.panels=[{type:"plugins",label:"插件"}],CIB.vm.sidePanel.selectedPanel="plugins";else{const Ce=X==null?void 0:X.querySelector(".threads-header"),Pe=X==null?void 0:X.querySelector(".threads-container");Ce.style.display="none",Pe.style.display="none"}}},O=ie=>{Ye.set(e,ie,7*24*60,"/")},V=ie=>{Ye.set(n,ie)},z=ie=>{Ye.set(i,ie),I.value=ie},Z=async()=>{localStorage.clear(),sessionStorage.clear();const ie=await caches.keys();for(const Ie of ie)await caches.delete(Ie),console.log("del cache : ",Ie)};return{sysConfig:w,getSysConfig:v,getUserToken:S,checkUserToken:P,saveUserToken:O,resetCache:async()=>{const ie=document.cookie.split(";");if(ie)for(let Ie=ie.length;Ie--;)document.cookie=ie[Ie].split("=")[0]+"=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";await Z(),"serviceWorker"in navigator&&await navigator.serviceWorker.ready.then(async Ie=>{await Ie.unregister()})},setAuthKey:V,setPassServer:z,getUserKievRPSSecAuth:()=>Ye.get(o)||"",saveUserKievRPSSecAuth:ie=>{Ye.set(o,ie,7*24*60,"/")},getUserRwBf:()=>Ye.get(t)||"",saveUserRwBf:ie=>{Ye.set(t,ie,7*24*60,"/")},getUserMUID:()=>Ye.get(r)||"",saveUserMUID:ie=>{Ye.set(r,ie,7*24*60,"/")},saveCookies:ie=>{const Ie=ie.split(";");for(const Ge of Ie){const Qe=Ge.split("="),ue=Qe[0].trim(),R=Qe.length>1?Qe.slice(1,Qe.length).join("=").trim():null;ue&&R&&Ye.set(ue,R,7*24*60,"/")}},cookiesStr:a,historyEnable:d,fullCookiesEnable:c,themeMode:u,uiVersion:f,langRegion:h,autoReopenMic:p,enterpriseEnable:x,copilotProEnable:C,customChatNum:m,gpt4tEnable:y,sydneyEnable:H,sydneyPrompt:T,passServer:I}},{persist:{key:"user-store",storage:localStorage,paths:["historyEnable","themeMode","uiVersion","langRegion","autoReopenMic","fullCookiesEnable","cookiesStr","enterpriseEnable","copilotProEnable","customChatNum","gpt4tEnable","sydneyEnable","sydneyPrompt","passServer"]}}),GE=_e({__name:"App",setup(e){const o=UE(),{themeMode:t}=Mm(o),r=te(Oi);ro("theme",r),Xo(()=>{const i=document.querySelector("body");t.value=="light"?(r.value=Oi,i==null||i.setAttribute("style","background-color: #f0f0f0")):t.value=="dark"?(r.value=ic,i==null||i.setAttribute("style","background-color: #111111")):t.value=="auto"&&(Ob().value=="dark"?(r.value=ic,i==null||i.setAttribute("style","background-color: #111111")):(r.value=Oi,i==null||i.setAttribute("style","background-color: #f0f0f0")))});const n={common:{primaryColor:"#2080F0FF",primaryColorHover:"#4098FCFF",primaryColorPressed:"#1060C9FF",primaryColorSuppl:"#4098FCFF"}};return(i,s)=>(As(),Fs(jo(yy),{theme:r.value,"theme-overrides":n},{default:Rn(()=>[Xe(jo(Iw),null,{default:Rn(()=>[Xe(jo(bT),null,{default:Rn(()=>[Xe(jo(oh))]),_:1})]),_:1})]),_:1},8,["theme"]))}}),KE="modulepreload",qE=function(e){return"/web/"+e},yc={},XE=function(o,t,r){if(!t||t.length===0)return o();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=qE(i),i in yc)return;yc[i]=!0;const s=i.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let c=n.length-1;c>=0;c--){const u=n[c];if(u.href===i&&(!s||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${l}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":KE,s||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),s)return new Promise((c,u)=>{d.addEventListener("load",c),d.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>o()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})},YE=DE({history:hE("/web"),routes:[{path:"/",name:"chat",component:()=>XE(()=>import("./index-15721328.js"),["assets/index-15721328.js","assets/index-1dc749ba.css"])}]}),pl=Pm(GE);Vm(pl);pl.use(YE);pl.mount("#app");export{Hu as $,Uo as A,iu as B,Cb as C,E as D,Xb as E,rr as F,ad as G,cd as H,na as I,Ws as J,iI as K,ev as L,hg as M,Ra as N,Zs as O,dr as P,w0 as Q,wu as R,Js as S,y0 as T,Un as U,Ha as V,Wv as W,fr as X,ex as Y,eC as Z,sn as _,Xo as a,ps as a$,ir as a0,di as a1,Ja as a2,Tu as a3,pr as a4,Iu as a5,ur as a6,jt as a7,yu as a8,Su as a9,Vs as aA,dI as aB,zs as aC,Vt as aD,Ub as aE,Ns as aF,ob as aG,$v as aH,Ue as aI,hI as aJ,eb as aK,Go as aL,ri as aM,jn as aN,Ht as aO,tl as aP,nf as aQ,aa as aR,Kn as aS,pi as aT,el as aU,rl as aV,la as aW,X1 as aX,Gu as aY,Nu as aZ,Uu as a_,as as aa,xu as ab,Yx as ac,Nv as ad,ht as ae,an as af,He as ag,se as ah,U as ai,Wt as aj,vo as ak,hr as al,ol as am,Zo as an,pe as ao,wt as ap,pt as aq,ve as ar,ns as as,R1 as at,ln as au,cn as av,Ro as aw,Ku as ax,P1 as ay,sa as az,ou as b,eI as b$,Vu as b0,G1 as b1,aI as b2,tS as b3,Iv as b4,Po as b5,nn as b6,uI as b7,zf as b8,gi as b9,dT as bA,Sp as bB,$P as bC,zP as bD,XP as bE,QP as bF,l2 as bG,R2 as bH,nc as bI,Pd as bJ,z2 as bK,Bm as bL,As as bM,oI as bN,ZE as bO,Fs as bP,Rn as bQ,Rd as bR,Xe as bS,rI as bT,jo as bU,qr as bV,$w as bW,Mm as bX,UE as bY,Ob as bZ,VE as b_,pI as ba,Ff as bb,Nf as bc,ts as bd,Wn as be,qy as bf,ll as bg,gw as bh,Jm as bi,to as bj,dp as bk,sI as bl,s$ as bm,Gs as bn,vt as bo,Us as bp,Da as bq,Qu as br,rT as bs,Ss as bt,gI as bu,k$ as bv,Ko as bw,Qd as bx,Pb as by,D$ as bz,ne as c,Ne as c0,nI as c1,yy as c2,Oi as c3,ic as c4,tI as c5,ys as c6,QE as c7,JE as c8,th as c9,Ye as ca,Ft as d,bt as e,so as f,ni as g,Ks as h,Ae as i,zo as j,So as k,lI as l,Fb as m,Wb as n,wo as o,Nb as p,_e as q,te as r,ro as s,ba as t,is as u,Ul as v,Lo as w,Ui as x,fI as y,ci as z}; diff --git a/web/index.html b/web/index.html index 8d1b8dc24a..2bc81005be 100644 --- a/web/index.html +++ b/web/index.html @@ -569,7 +569,7 @@ } } - + diff --git a/web/js/bing/chat/config.js b/web/js/bing/chat/config.js index 1f243e9d71..b3246fc4c8 100644 --- a/web/js/bing/chat/config.js +++ b/web/js/bing/chat/config.js @@ -1661,7 +1661,7 @@ if (UserStoreGet('copilotProEnable')) { _w['_sydConvConfig']['enableGPT4TurboSwitch'] = true } -// _G.Region = UserStoreGet('langRegion') || 'CN' +_G.Region = UserStoreGet('langRegion') || 'CN' _w['_sydConvConfig']['enableAutoReopenMic'] = UserStoreGet('autoReopenMic') || true _w['_sydConvConfig']['enableAutoReopenMicTTSStopped'] = UserStoreGet('autoReopenMic') || true \ No newline at end of file diff --git a/web/sw.js b/web/sw.js index 8286d75b4c..1c076979ba 100644 --- a/web/sw.js +++ b/web/sw.js @@ -1,2 +1,2 @@ try{self["workbox:core:6.5.4"]&&_()}catch{}const z=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},J=z;class l extends Error{constructor(e,t){const n=J(e,t);super(n),this.name=e,this.details=t}}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},D=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),X=s=>{for(const e of Object.keys(d))s(e)},b={updateDetails:s=>{X(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||D(d.googleAnalytics),getPrecacheName:s=>s||D(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||D(d.runtime),getSuffix:()=>d.suffix};function O(s,e){const t=e();return s.waitUntil(t),t}try{self["workbox:precaching:6.5.4"]&&_()}catch{}const Y="__WB_REVISION__";function Z(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(Y,e),{cacheKey:n.href,url:a.href}}class ee{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class te{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}let w;function se(){if(w===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),w=!0}catch{w=!1}w=!1}return w}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=e?e(a):a,i=se()?n.body:await n.blob();return new Response(i,r)}const ae=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function S(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function re(s,e,t,n){const a=S(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=S(c.url,t);if(a===o)return s.match(c,n)}}class ie{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const F=new Set;async function ce(){for(const s of F)await s()}function oe(s){return new Promise(e=>setTimeout(e,s))}try{self["workbox:strategies:6.5.4"]&&_()}catch{}function C(s){return typeof s=="string"?new Request(s):s}class he{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new ie,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=C(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=C(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=C(e);await oe(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:ae(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),m=h?await re(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ce(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:m,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=C(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class N{constructor(e={}){this.cacheName=b.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new he(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends N{constructor(e={}){e.cacheName=b.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class le{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:b.getPrecacheName(e),plugins:[...t,new te({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Z(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return O(e,async()=>{const t=new ee;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return O(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const M=()=>(L||(L=new le),L);try{self["workbox:routing:6.5.4"]&&_()}catch{}const H="GET",x=s=>s&&typeof s=="object"?s:{handle:s};class g{constructor(e,t,n=H){this.handler=x(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=x(e)}}class ue extends g{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class de{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const m=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||m)&&(h=h.catch(async u=>{if(m)try{return await m.handle({url:n,request:e,event:t,params:r})}catch(K){K instanceof Error&&(u=K)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=H){this._defaultHandlerMap.set(t,x(e))}setCatchHandler(e){this._catchHandler=x(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const fe=()=>(y||(y=new de,y.addFetchListener(),y.addCacheListener()),y);function E(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new g(i,e,t)}else if(s instanceof RegExp)n=new ue(s,e,t);else if(typeof s=="function")n=new g(s,e,t);else if(s instanceof g)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return fe().registerRoute(n),n}function pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*ge(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class me extends g{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of ge(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function we(s){const e=M(),t=new me(e,s);E(t)}const ye="-precache-",_e=async(s,e=ye)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function Re(){self.addEventListener("activate",s=>{const e=b.getPrecacheName();s.waitUntil(_e(e).then(t=>{}))})}function be(s){return M().createHandlerBoundToURL(s)}function Ce(s){M().precache(s)}function xe(s,e){Ce(s),we(e)}class Ee extends g{constructor(e,{allowlist:t=[/./],denylist:n=[]}={}){super(a=>this._match(a),e),this._allowlist=t,this._denylist=n}_match({url:e,request:t}){if(t&&t.mode!=="navigate")return!1;const n=e.pathname+e.search;for(const a of this._denylist)if(a.test(n))return!1;return!!this._allowlist.some(a=>a.test(n))}}class De extends N{async _handle(e,t){let n=await t.cacheMatch(e),a;if(!n)try{n=await t.fetchAndCachePut(e)}catch(r){r instanceof Error&&(a=r)}if(!n)throw new l("no-response",{url:e.url,error:a});return n}}const Le={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Ue extends N{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Le)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}try{self["workbox:core:6.6.0"]&&_()}catch{}try{self["workbox:cacheable-response:6.6.0"]&&_()}catch{}class Te{constructor(e={}){this._statuses=e.statuses,this._headers=e.headers}isResponseCacheable(e){let t=!0;return this._statuses&&(t=this._statuses.includes(e.status)),this._headers&&t&&(t=Object.keys(this._headers).some(n=>e.headers.get(n)===this._headers[n])),t}}class q{constructor(e){this.cacheWillUpdate=async({response:t})=>this._cacheableResponse.isResponseCacheable(t)?t:null,this._cacheableResponse=new Te(e)}}function V(s){s.then(()=>{})}const ke=(s,e)=>e.some(t=>s instanceof t);let v,W;function Pe(){return v||(v=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ie(){return W||(W=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const $=new WeakMap,P=new WeakMap,G=new WeakMap,U=new WeakMap,A=new WeakMap;function Ne(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&$.set(t,s)}).catch(()=>{}),A.set(e,s),e}function Me(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let I={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||G.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Ae(s){I=s(I)}function Ke(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(T(this),e,...t);return G.set(n,e.sort?e.sort():[e]),f(n)}:Ie().includes(s)?function(...e){return s.apply(T(this),e),f($.get(this))}:function(...e){return f(s.apply(T(this),e))}}function Oe(s){return typeof s=="function"?Ke(s):(s instanceof IDBTransaction&&Me(s),ke(s,Pe())?new Proxy(s,I):s)}function f(s){if(s instanceof IDBRequest)return Ne(s);if(U.has(s))return U.get(s);const e=Oe(s);return e!==s&&(U.set(s,e),A.set(e,s)),e}const T=s=>A.get(s);function Se(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}function ve(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const We=["get","getKey","getAll","getAllKeys","count"],Be=["put","add","delete","clear"],k=new Map;function B(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(k.get(e))return k.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=Be.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||We.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return k.set(e,r),r}Ae(s=>({...s,get:(e,t,n)=>B(e,t)||s.get(e,t,n),has:(e,t)=>!!B(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.4"]&&_()}catch{}const je="workbox-expiration",R="cache-entries",j=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Fe{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(R,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ve(this._cacheName)}async setTimestamp(e,t){e=j(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(R,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(R,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(R).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(R,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+j(e)}async getDb(){return this._db||(this._db=await Se(je,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class He{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Fe(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,V(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);V(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&qe(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===b.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new He(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}const Q="BingAI";self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()});xe([{"revision":null,"url":"assets/index-1dc749ba.css"},{"revision":null,"url":"assets/index-7683bcc0.css"},{"revision":null,"url":"assets/index-9e3b8a3c.js"},{"revision":null,"url":"assets/index-e269ea96.js"},{"revision":"c82421f6ab99e040562fc65cc79b1567","url":"compose.html"},{"revision":"b8469eaf74a3c11a2bd997ed3c0d20c5","url":"css/bing.css"},{"revision":"e98482f818019f89d8aa9b4d2eb65d55","url":"index.html"},{"revision":"92aff8547a1079aa9cd31a0d1f9add5a","url":"js/bing/chat/amd.js"},{"revision":"c56725034e383b349186b0be4d89d417","url":"js/bing/chat/config.js"},{"revision":"ab21af299ac664ea1ad18c296e65b28f","url":"js/bing/chat/core.js"},{"revision":"93d2fc9f64156d419a38e4b5921a23f8","url":"js/bing/chat/global.js"},{"revision":"563d0716a863a6b16bb598cf306fce51","url":"js/bing/chat/lib.js"},{"revision":"bf6c2f29aef95e09b1f72cf59f427a55","url":"registerSW.js"},{"revision":"1da58864f14c1a8c28f8587d6dcbc5d0","url":"img/logo.svg"},{"revision":"be40443731d9d4ead5e9b1f1a6070135","url":"./img/pwa/logo-192.png"},{"revision":"1217f1c90acb9f231e3135fa44af7efc","url":"./img/pwa/logo-512.png"},{"revision":"5e5048c8a928b9d4bd7d262e1f7a5976","url":"manifest.webmanifest"}]);Re();E(new Ee(be("./index.html")));E(({request:s,url:e})=>s.destination==="style"||s.destination==="manifest"||s.destination==="script"||s.destination==="worker",new Ue({cacheName:`${Q}-assets`,plugins:[new q({statuses:[200]})]}));E(({request:s,url:e})=>e.pathname.includes("hm.gif")||e.pathname.includes("/fd/ls/")?!1:s.destination==="image",new De({cacheName:`${Q}-images`,plugins:[new q({statuses:[200]}),new Ve({maxEntries:100,maxAgeSeconds:60*60*24*30})]}));self.addEventListener("install",s=>{self.skipWaiting()}); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return O(e,async()=>{const t=new ee;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return O(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const M=()=>(L||(L=new le),L);try{self["workbox:routing:6.5.4"]&&_()}catch{}const H="GET",x=s=>s&&typeof s=="object"?s:{handle:s};class g{constructor(e,t,n=H){this.handler=x(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=x(e)}}class ue extends g{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class de{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const m=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||m)&&(h=h.catch(async u=>{if(m)try{return await m.handle({url:n,request:e,event:t,params:r})}catch(K){K instanceof Error&&(u=K)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=H){this._defaultHandlerMap.set(t,x(e))}setCatchHandler(e){this._catchHandler=x(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const fe=()=>(y||(y=new de,y.addFetchListener(),y.addCacheListener()),y);function E(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new g(i,e,t)}else if(s instanceof RegExp)n=new ue(s,e,t);else if(typeof s=="function")n=new g(s,e,t);else if(s instanceof g)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return fe().registerRoute(n),n}function pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*ge(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class me extends g{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of ge(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function we(s){const e=M(),t=new me(e,s);E(t)}const ye="-precache-",_e=async(s,e=ye)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function Re(){self.addEventListener("activate",s=>{const e=b.getPrecacheName();s.waitUntil(_e(e).then(t=>{}))})}function be(s){return M().createHandlerBoundToURL(s)}function Ce(s){M().precache(s)}function xe(s,e){Ce(s),we(e)}class Ee extends g{constructor(e,{allowlist:t=[/./],denylist:n=[]}={}){super(a=>this._match(a),e),this._allowlist=t,this._denylist=n}_match({url:e,request:t}){if(t&&t.mode!=="navigate")return!1;const n=e.pathname+e.search;for(const a of this._denylist)if(a.test(n))return!1;return!!this._allowlist.some(a=>a.test(n))}}class De extends N{async _handle(e,t){let n=await t.cacheMatch(e),a;if(!n)try{n=await t.fetchAndCachePut(e)}catch(r){r instanceof Error&&(a=r)}if(!n)throw new l("no-response",{url:e.url,error:a});return n}}const Le={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Ue extends N{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Le)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}try{self["workbox:core:6.6.0"]&&_()}catch{}try{self["workbox:cacheable-response:6.6.0"]&&_()}catch{}class Te{constructor(e={}){this._statuses=e.statuses,this._headers=e.headers}isResponseCacheable(e){let t=!0;return this._statuses&&(t=this._statuses.includes(e.status)),this._headers&&t&&(t=Object.keys(this._headers).some(n=>e.headers.get(n)===this._headers[n])),t}}class q{constructor(e){this.cacheWillUpdate=async({response:t})=>this._cacheableResponse.isResponseCacheable(t)?t:null,this._cacheableResponse=new Te(e)}}function V(s){s.then(()=>{})}const ke=(s,e)=>e.some(t=>s instanceof t);let v,W;function Pe(){return v||(v=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ie(){return W||(W=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const $=new WeakMap,P=new WeakMap,G=new WeakMap,U=new WeakMap,A=new WeakMap;function Ne(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&$.set(t,s)}).catch(()=>{}),A.set(e,s),e}function Me(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let I={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||G.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Ae(s){I=s(I)}function Ke(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(T(this),e,...t);return G.set(n,e.sort?e.sort():[e]),f(n)}:Ie().includes(s)?function(...e){return s.apply(T(this),e),f($.get(this))}:function(...e){return f(s.apply(T(this),e))}}function Oe(s){return typeof s=="function"?Ke(s):(s instanceof IDBTransaction&&Me(s),ke(s,Pe())?new Proxy(s,I):s)}function f(s){if(s instanceof IDBRequest)return Ne(s);if(U.has(s))return U.get(s);const e=Oe(s);return e!==s&&(U.set(s,e),A.set(e,s)),e}const T=s=>A.get(s);function Se(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}function ve(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const We=["get","getKey","getAll","getAllKeys","count"],Be=["put","add","delete","clear"],k=new Map;function B(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(k.get(e))return k.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=Be.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||We.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return k.set(e,r),r}Ae(s=>({...s,get:(e,t,n)=>B(e,t)||s.get(e,t,n),has:(e,t)=>!!B(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.4"]&&_()}catch{}const je="workbox-expiration",R="cache-entries",j=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Fe{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(R,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ve(this._cacheName)}async setTimestamp(e,t){e=j(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(R,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(R,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(R).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(R,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+j(e)}async getDb(){return this._db||(this._db=await Se(je,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class He{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Fe(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,V(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);V(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&qe(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===b.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new He(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}const Q="BingAI";self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()});xe([{"revision":null,"url":"assets/index-15721328.js"},{"revision":null,"url":"assets/index-1dc749ba.css"},{"revision":null,"url":"assets/index-7683bcc0.css"},{"revision":null,"url":"assets/index-955202b1.js"},{"revision":"c82421f6ab99e040562fc65cc79b1567","url":"compose.html"},{"revision":"b8469eaf74a3c11a2bd997ed3c0d20c5","url":"css/bing.css"},{"revision":"497f56d21c7d72a4f7428e42959e7934","url":"index.html"},{"revision":"92aff8547a1079aa9cd31a0d1f9add5a","url":"js/bing/chat/amd.js"},{"revision":"2a4060ba1026c4d5d1746d15a0ed8c22","url":"js/bing/chat/config.js"},{"revision":"ab21af299ac664ea1ad18c296e65b28f","url":"js/bing/chat/core.js"},{"revision":"93d2fc9f64156d419a38e4b5921a23f8","url":"js/bing/chat/global.js"},{"revision":"563d0716a863a6b16bb598cf306fce51","url":"js/bing/chat/lib.js"},{"revision":"bf6c2f29aef95e09b1f72cf59f427a55","url":"registerSW.js"},{"revision":"1da58864f14c1a8c28f8587d6dcbc5d0","url":"img/logo.svg"},{"revision":"be40443731d9d4ead5e9b1f1a6070135","url":"./img/pwa/logo-192.png"},{"revision":"1217f1c90acb9f231e3135fa44af7efc","url":"./img/pwa/logo-512.png"},{"revision":"5e5048c8a928b9d4bd7d262e1f7a5976","url":"manifest.webmanifest"}]);Re();E(new Ee(be("./index.html")));E(({request:s,url:e})=>s.destination==="style"||s.destination==="manifest"||s.destination==="script"||s.destination==="worker",new Ue({cacheName:`${Q}-assets`,plugins:[new q({statuses:[200]})]}));E(({request:s,url:e})=>e.pathname.includes("hm.gif")||e.pathname.includes("/fd/ls/")?!1:s.destination==="image",new De({cacheName:`${Q}-images`,plugins:[new q({statuses:[200]}),new Ve({maxEntries:100,maxAgeSeconds:60*60*24*30})]}));self.addEventListener("install",s=>{self.skipWaiting()});