build-dxf 0.1.165 → 0.1.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as getDefaultExportFromCjs,C as Component,V as Variable,L as LineSegment,Q as Quadtree,P as Point,u as uuid,m as mToMm,a as mergeChainsLine,W as WH,R as Rectangle,D as DEFAULT_WALL_WIDTH,b as Lines,c as WallHole,d as LineSegmentUtils,e as clippingLineUserData,f as mmTom,h as LineDashed,i as LinePipeline,j as PointSpatialHash,B as Box2,k as cloneUserData,l as Pipeline,n as WallGroupManager,o as PointUtils,H as HeightQuery,p as drawText,q as WhiteModel,T as ThreeVJia,S as SelectLocalFile,M as MiniCircles,r as CommandManager}from"./build.js";import*as THREE from"three";import{Vector3,InstancedBufferGeometry,Float32BufferAttribute,InstancedInterleavedBuffer,InterleavedBufferAttribute,WireframeGeometry,Box3,Sphere,ShaderMaterial,ShaderLib,UniformsUtils,Vector2,UniformsLib,Mesh,Vector4,Line3,Matrix4,MathUtils,Group}from"three";import"clipper-lib";import"dxf-writer";import{i as isMobileRef,b as isMobile,D as DomEventRegister,a as DomContainer}from"./DomEventRegister.js";import"three/addons/controls/OrbitControls.js";import{defineComponent,useModel,ref,computed,watch,nextTick,onMounted,onUnmounted,openBlock,createElementBlock,normalizeClass,createElementVNode,normalizeStyle,createStaticVNode,toDisplayString,renderSlot,createCommentVNode,mergeModels,warn,getCurrentInstance,unref,getCurrentScope,onScopeDispose,shallowRef,watchEffect,readonly,isRef,reactive,inject,onBeforeUnmount,onBeforeMount,provide,createBlock,Teleport,mergeProps,withDirectives,cloneVNode,Comment,Fragment,Text,createVNode,withCtx,toRef,Transition,vShow,onDeactivated,markRaw,useAttrs as useAttrs$1,useSlots,resolveDynamicComponent,withModifiers,onActivated,onUpdated,createTextVNode,toRaw,vModelCheckbox,toRefs,renderList,resolveComponent,normalizeProps,guardReactiveProps,createSlots,shallowReactive,isVNode,render as render$1,createApp,h,vModelText,TransitionGroup}from"vue";import{CSS2DObject}from"three/addons/renderers/CSS2DRenderer.js";const _hoisted_1$d={class:"flex flex-row"},_hoisted_2$6={class:"flex text-nowrap text-[12px] items-center pointer-events-none"},_hoisted_3$3={key:1,class:"p-[5px]"},_sfc_main$7=/* @__PURE__ */defineComponent({__name:"DragContainer",props:/* @__PURE__ */mergeModels({name:{},title:{},position:{}},{showContent:{default:!0},showContentModifiers:{},showTitle:{default:!0},showTitleModifiers:{}}),emits:/* @__PURE__ */mergeModels(["clickIcon"],["update:showContent","update:showTitle"]),setup(__props,{emit:__emit}){function setEditorToolPosition(left,top,rect=elRef.value.getBoundingClientRect(),toolBarRect=toolBarRef.value.getBoundingClientRect()){const maxX=rect.width-toolBarRect.width,maxY=rect.height-toolBarRect.height;left=Math.max(0,Math.min(left,maxX)),top=Math.max(0,Math.min(top,maxY)),toolBarPosition.value={left:left,top:top}}function dragMoveHelper(e){if(isMobileRef.value&&e instanceof MouseEvent)return;let offsetX=0,offsetY=0;if(isdrag.value=!0,e instanceof MouseEvent)offsetX=e.offsetX,offsetY=e.offsetY;else if(e instanceof TouchEvent){const rect2=e.target.getBoundingClientRect(),touch=e.touches[0];offsetX=touch.pageX-rect2.left,offsetY=touch.pageY-rect2.top}const cusor=document.body.style.cursor;document.body.style.cursor="move";const rect=elRef.value.getBoundingClientRect(),toolBarRect=toolBarRef.value.getBoundingClientRect(),move=e2=>{setEditorToolPosition(e2.pageX-rect.left-offsetX,e2.pageY-rect.top-offsetY,rect,toolBarRect),e2.stopPropagation(),e2.preventDefault(),document.body.style.cursor="move"},end=()=>{document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",end),document.body.style.cursor=cusor,isdrag.value=!1},touchmove=e2=>{if(e2.touches.length){const touch=e2.touches[0];setEditorToolPosition(touch.pageX-rect.left-offsetX,touch.pageY-rect.top-offsetY,rect,toolBarRect),e2.stopPropagation(),document.body.style.cursor="move",e2.stopPropagation(),e2.preventDefault()}},touchend=()=>{document.removeEventListener("touchmove",touchmove),document.removeEventListener("touchend",touchend),document.body.style.cursor=cusor,isdrag.value=!1};isMobileRef.value?(document.addEventListener("touchmove",touchmove,{passive:!1}),document.addEventListener("touchend",touchend)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",end)),e.stopPropagation(),e.preventDefault()}function onClickIcon(e){emits("clickIcon"),e.stopPropagation()}const props=__props,emits=__emit,showContent=useModel(__props,"showContent"),showTitle=useModel(__props,"showTitle"),elRef=ref(),toolBarRef=ref(),toolBarPosition=ref({left:props.position?.x??10,top:props.position?.y??100}),resizeObserver=new ResizeObserver(()=>setEditorToolPosition(toolBarPosition.value.left,toolBarPosition.value.top)),isdrag=ref(!1),isPc=computed(()=>!isMobileRef.value);if(watch(showContent,()=>{showContent.value&&nextTick(()=>setEditorToolPosition(toolBarPosition.value.left,toolBarPosition.value.top))}),props.name&&!props.position&&localStorage.getItem(props.name)){watch(toolBarPosition,()=>localStorage.setItem(props.name,JSON.stringify(toolBarPosition.value)));const{left:left,top:top}=JSON.parse(localStorage.getItem(props.name)??"{}");toolBarPosition.value={left:left,top:top}}return onMounted(()=>{nextTick(()=>resizeObserver.observe(elRef.value))}),onUnmounted(()=>{resizeObserver.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{onClick:_cache[1]||(_cache[1]=e=>e.stopPropagation()),ref_key:"elRef",ref:elRef,class:normalizeClass([{"pointer-events-none":isdrag.value},"editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-20 flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"])},[createElementVNode("div",{ref_key:"toolBarRef",ref:toolBarRef,style:normalizeStyle({left:toolBarPosition.value.left+"px",top:toolBarPosition.value.top+"px"}),class:normalizeClass(["overflow-hidden pointer-events-auto w-fit transition-[border-radius] text-[#333] absolute z-11 bg-white select-none max-w-full",{"rounded-[8px]":showContent.value&&isPc.value}]),onMousedown:_cache[0]||(_cache[0]=e=>e.stopPropagation())},[showTitle.value?(openBlock(),createElementBlock("div",{key:0,onTouchstart:dragMoveHelper,onMousedown:dragMoveHelper,class:normalizeClass([{"border-b-[#eee] border-b":showContent.value},"flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])},[createElementVNode("div",_hoisted_1$d,[_cache[2]||(_cache[2]=createStaticVNode('<div class="p-[2px_5px] size-[20px] flex items-center pointer-events-none"><svg fill="#aaa" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M352 128a134.4 134.4 0 0 1 128.832 96H921.6a38.4 38.4 0 0 1 0 76.8H480.832a134.4 134.4 0 0 1-257.664 0H102.4a38.4 38.4 0 1 1 0-76.8h120.768A134.4 134.4 0 0 1 352 128z m0 76.8a57.6 57.6 0 1 0 0 115.2 57.6 57.6 0 0 0 0-115.2z"></path><path d="M64 467.2m38.4 0l819.2 0q38.4 0 38.4 38.4l0 0q0 38.4-38.4 38.4l-819.2 0q-38.4 0-38.4-38.4l0 0q0-38.4 38.4-38.4Z"></path><path d="M672 614.4a134.4 134.4 0 0 1 128.832 96H921.6a38.4 38.4 0 0 1 0 76.8h-120.768a134.4 134.4 0 0 1-257.664 0H102.4a38.4 38.4 0 0 1 0-76.8h440.768A134.4 134.4 0 0 1 672 614.4z m0 76.8a57.6 57.6 0 1 0 0 115.2 57.6 57.6 0 0 0 0-115.2z"></path></svg></div>',1)),createElementVNode("h5",_hoisted_2$6,toDisplayString(__props.title),1)]),createElementVNode("div",{onMousedown:onClickIcon,onTouchstart:onClickIcon,class:"ml-[20px] cursor-pointer flex items-center p-[0px_5px]"},[renderSlot(_ctx.$slots,"icon",{},()=>[_cache[3]||(_cache[3]=createElementVNode("svg",{fill:"#666",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},[createElementVNode("path",{d:"M23.079385 23.079385a78.769231 78.769231 0 0 1 111.379692 0L512 400.541538 889.540923 23.079385a78.769231 78.769231 0 0 1 103.975385-6.537847l7.404307 6.537847a78.769231 78.769231 0 0 1 0 111.379692L623.458462 512l377.462153 377.540923a78.769231 78.769231 0 0 1 6.537847 103.975385l-6.537847 7.404307a78.769231 78.769231 0 0 1-111.379692 0L512 623.458462l-377.540923 377.462153a78.769231 78.769231 0 0 1-103.975385 6.537847l-7.404307-6.537847a78.769231 78.769231 0 0 1 0-111.379692L400.541538 512 23.079385 134.459077A78.769231 78.769231 0 0 1 16.541538 30.483692z"})],-1))])],32)],34)):createCommentVNode("",!0),showContent.value?(openBlock(),createElementBlock("div",_hoisted_3$3,[renderSlot(_ctx.$slots,"default")])):createCommentVNode("",!0)],38)],2))}}),__vite_glob_0_0=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_1=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='279'%20height='279'%20viewBox='0%200%20279%20279'%3e%3cdefs%3e%3cstyle%3e%20.cls-1,%20.cls-2%20{%20fill:%20none;%20stroke:%20%23555;%20stroke-width:%2010px;%20}%20.cls-2%20{%20fill-rule:%20evenodd;%20}%20%3c/style%3e%3c/defs%3e%3ccircle%20id='椭圆_1'%20data-name='椭圆%201'%20class='cls-1'%20cx='139.5'%20cy='139.5'%20r='150'/%3e%3cpath%20id='直线_1'%20data-name='直线%201'%20class='cls-2'%20d='M35.281,156.783v-1.048H245.814v1.048H35.281Z'/%3e%3cpath%20id='直线_2'%20data-name='直线%202'%20class='cls-2'%20d='M140.024,38.423h1.047v118.36h-1.047V38.423Z'/%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_2=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5569'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M522.1888%20811.3152a412.1088%20412.1088%200%200%200-114.5344-269.7728l-244.48%20269.7728h359.0144zM450.816%20493.824c83.5072%2085.3504%20132.7104%20197.4784%20136.5504%20317.4912h417.5872v63.232H18.9952L676.1472%20149.4016l48.9472%2041.7792-274.2784%20302.6432z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_3=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769133028297'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5962'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M23.079385%2023.079385a78.769231%2078.769231%200%200%201%20111.379692%200L512%20400.541538%20889.540923%2023.079385a78.769231%2078.769231%200%200%201%20103.975385-6.537847l7.404307%206.537847a78.769231%2078.769231%200%200%201%200%20111.379692L623.458462%20512l377.462153%20377.540923a78.769231%2078.769231%200%200%201%206.537847%20103.975385l-6.537847%207.404307a78.769231%2078.769231%200%200%201-111.379692%200L512%20623.458462l-377.540923%20377.462153a78.769231%2078.769231%200%200%201-103.975385%206.537847l-7.404307-6.537847a78.769231%2078.769231%200%200%201%200-111.379692L400.541538%20512%2023.079385%20134.459077A78.769231%2078.769231%200%200%201%2016.541538%2030.483692z'%20fill='%23000000'%20p-id='5963'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_4=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_5=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8193'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M426.666667%20255.872c0%2031.232-8.405333%2060.544-23.04%2085.76L512%20451.498667l287.061333-287.061334a85.333333%2085.333333%200%200%201%20120.661334%200l-516.693334%20516.693334a170.666667%20170.666667%200%201%201-60.330666-60.330667l108.970666-108.970667-108.970666-108.970666A170.666667%20170.666667%200%201%201%20426.666667%20255.872z%20m-85.333334%200a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z%20m578.389334%20603.392a85.333333%2085.333333%200%200%201-120.661334%200l-226.858666-226.858667%2060.373333-60.330666%20287.146667%20287.146666zM682.666667%20469.205333h85.333333v85.333334h-85.333333v-85.333334z%20m170.666666%200h85.333334v85.333334h-85.333334v-85.333334z%20m-597.333333%200h85.333333v85.333334H256v-85.333334z%20m-170.666667%200h85.333334v85.333334H85.333333v-85.333334z%20m170.666667%20384a85.333333%2085.333333%200%201%200%200-170.666666%2085.333333%2085.333333%200%200%200%200%20170.666666z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_6=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_7=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_8=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_9=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1767852327874'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1652'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M264.90827%20999.628849H986.622027a12.339175%2012.339175%200%200%200%2012.390375-12.185576V268.238312h-211.506777a36.966326%2036.966326%200%200%201-37.375925-36.607927V24.373199H264.90827A12.595175%2012.595175%200%200%200%20255.999488%2027.957192a12.083176%2012.083176%200%200%200-3.583993%208.601583v950.884498c0%206.707187%205.529589%2012.185576%2012.441575%2012.185576z'%20fill='%23FFFFFF'%20p-id='1653'%3e%3c/path%3e%3cpath%20d='M993.892412%20243.76476L775.16645%2029.493189v202.137196a12.287975%2012.287975%200%200%200%2012.390375%2012.134375h206.335587z'%20fill='%23FFFFFF'%20p-id='1654'%3e%3c/path%3e%3cpath%20d='M1013.041174%20228.046392L791.294417%2010.754026a37.427125%2037.427125%200%200%200-26.521547-10.751978H264.90827c-20.633559%200-37.375925%2016.383967-37.375925%2036.556727v950.884498c0%2020.17276%2016.742367%2036.556727%2037.375925%2036.556727H986.622027c20.633559%200%2037.324725-16.383967%2037.324725-36.556727V253.90234c0-9.727981-3.942392-18.995162-10.956778-25.855948zM775.06405%2029.390789l218.828362%20214.373971h-206.335587a12.339175%2012.339175%200%200%201-12.492775-12.134375V29.390789z%20m211.609177%20970.23806H264.90827a12.595175%2012.595175%200%200%201-8.857582-3.583993%2012.083176%2012.083176%200%200%201-3.583993-8.601583V36.558775c0-6.707187%205.529589-12.185576%2012.441575-12.185576h485.27263v207.257186c0%2020.22396%2016.742367%2036.607927%2037.375925%2036.607927h211.455577v719.204961a12.339175%2012.339175%200%200%201-12.339175%2012.185576z'%20fill='%23605E5C'%20opacity='.64'%20p-id='1655'%3e%3c/path%3e%3cpath%20d='M972.798054%20358.401331a51.199898%2051.199898%200%200%201%2051.199898%2051.199898v352.716094a51.199898%2051.199898%200%200%201-51.199898%2051.199898H51.199898a51.199898%2051.199898%200%200%201-51.199898-51.199898V409.601229a51.199898%2051.199898%200%200%201%2051.199898-51.199898h921.598156z%20m2.252796%2025.804749H53.145494a25.599949%2025.599949%200%200%200-25.599949%2025.599948v355.17369a25.599949%2025.599949%200%200%200%2025.599949%2025.599949h921.905356a25.599949%2025.599949%200%200%200%2025.599949-25.599949V409.806028a25.599949%2025.599949%200%200%200-25.599949-25.599948z'%20fill='%230563B2'%20p-id='1656'%3e%3c/path%3e%3cpath%20d='M53.145494%20384.20608h921.905356a25.599949%2025.599949%200%200%201%2025.599949%2025.599948v355.17369a25.599949%2025.599949%200%200%201-25.599949%2025.599949H53.145494a25.599949%2025.599949%200%200%201-25.599949-25.599949V409.806028a25.599949%2025.599949%200%200%201%2025.599949-25.599948z'%20fill='%23FFFFFF'%20p-id='1657'%3e%3c/path%3e%3cpath%20d='M326.604147%20396.698855v129.94534c-19.81436-26.265547-43.315113-39.167922-70.963058-39.167922-34.099132%200-61.286277%2012.441575-80.639839%2037.324725-18.431963%2023.039954-27.187146%2052.070296-27.187146%2087.091026%200%2036.403127%209.215982%2066.355067%2027.647945%2089.395021%2019.81436%2024.88315%2047.462305%2037.324725%2082.943834%2037.324726%2031.334337%200%2055.295889-10.598379%2071.884656-31.795137v25.34395h48.844703V396.698855H326.604147z%20m-58.521483%20133.170933c16.588767%200%2030.873538%206.911986%2041.932716%2020.735959%2011.980776%2014.745571%2018.431963%2035.02073%2018.431963%2060.364679v3.686393c0%2023.039954-5.06879%2042.393515-14.74557%2057.139085-11.059178%2016.127968-27.187146%2024.422351-47.462305%2024.422352-23.500753%200-40.550319-8.294383-51.148698-24.883151-9.215982-13.823972-13.363173-33.638333-13.363173-59.443081s4.607991-45.15831%2014.284771-58.521483c11.059178-15.667169%2028.108744-23.500753%2052.070296-23.500753zM416.613567%20493.92746l82.022236%20111.513377L406.015188%20732.160584h61.747076l59.903881-88.012624%2059.443081%2088.012624h61.747076l-92.620614-126.719747%2082.022235-111.513377h-61.286277l-49.305501%2072.806255-49.766301-72.806255zM769.278461%20403.150042c-21.196758%200-37.785524%205.529589-48.844702%2017.510365-11.519977%2011.519977-17.049566%2027.647945-17.049566%2047.923104v25.343949h-52.991894v42.854314h52.991894V732.160584h52.531095v-195.37881h60.825479v-42.854314h-60.825479v-23.961552c0-7.833584%201.382397-13.363173%205.06879-17.049566%203.686393-3.686393%208.755182-5.529589%2015.667169-5.529589h43.315113v-44.236711h-50.687899z'%20fill='%230563B2'%20p-id='1658'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_10=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_11=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_12=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_13=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_14=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_15=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_16=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_17=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1759051895215'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1800'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M272.5888%20886.784v70.8608H203.2128V886.784h69.376z%20m416.256-256.6144l270.6944%20152.5248-270.6944%20148.1216v-114.8928H64.4608v-70.8608h624.384v-114.8928z%20m-416.256-26.88v70.912H203.2128v-70.912h69.376z%20m0-141.7216V532.48H203.2128V461.568h69.376z%20m-34.7136-398.336L385.024%20319.7952H272.5888V390.656H203.2128V319.8464H90.7776l147.0976-256.6656z'%20fill='%23444444'%20p-id='1801'%3e%3c/path%3e%3cpath%20d='M566.272%2073.3184l173.2608%20264.192V512h71.8848V337.5104l173.2608-264.192H898.048l-122.2656%20197.2224-122.88-197.2224H566.272z'%20fill='%230077FF'%20p-id='1802'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_18=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_19=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1779330751027'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10579'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M80%20448h160v128h-160v-128zM784%20448h160v128h-160v-128z'%20fill='%23D9D9D9'%20p-id='10580'%3e%3c/path%3e%3cpath%20d='M880%20672v-48H736V576h-80v-48H736v-32h-80V448H736v-48h144V352h-704v48H288V448h80v48H288v32h80V576H288v48H176V672h704zM128%20624H32v-224h96v-96h800v96h64v224h-64v54.4l-1.6%2041.6H128v-96zM240%20448h-160v128h160v-128z%20m704%200h-160v128h160v-128z%20m-544%200h96v48h-96V448z%20m224%200h-96v48h96V448z%20m-224%2080h96V576h-96v-48z%20m224%200h-96V576h96v-48z'%20fill='%23262626'%20p-id='10581'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_20=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769079533165'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4803'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M352%20128a134.4%20134.4%200%200%201%20128.832%2096H921.6a38.4%2038.4%200%200%201%200%2076.8H480.832a134.4%20134.4%200%200%201-257.664%200H102.4a38.4%2038.4%200%201%201%200-76.8h120.768A134.4%20134.4%200%200%201%20352%20128z%20m0%2076.8a57.6%2057.6%200%201%200%200%20115.2%2057.6%2057.6%200%200%200%200-115.2z'%20fill='%23666666'%20p-id='4804'%3e%3c/path%3e%3cpath%20d='M64%20467.2m38.4%200l819.2%200q38.4%200%2038.4%2038.4l0%200q0%2038.4-38.4%2038.4l-819.2%200q-38.4%200-38.4-38.4l0%200q0-38.4%2038.4-38.4Z'%20fill='%23666666'%20p-id='4805'%3e%3c/path%3e%3cpath%20d='M672%20614.4a134.4%20134.4%200%200%201%20128.832%2096H921.6a38.4%2038.4%200%200%201%200%2076.8h-120.768a134.4%20134.4%200%200%201-257.664%200H102.4a38.4%2038.4%200%200%201%200-76.8h440.768A134.4%20134.4%200%200%201%20672%20614.4z%20m0%2076.8a57.6%2057.6%200%201%200%200%20115.2%2057.6%2057.6%200%200%200%200-115.2z'%20fill='%23666666'%20p-id='4806'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_21=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1782447219271'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1817'%20width='16'%20height='16'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M904.17152%2081.92a49.01888%2049.01888%200%200%201%2029.40928%2088.23808v642.16064a63.744%2063.744%200%200%201-24.50432%20122.5728%2063.72352%2063.72352%200%200%201-33.98656-117.6576h-0.32768l-0.01024-49.01888H139.43808v44.10368a63.744%2063.744%200%200%201-24.51456%20122.5728%2063.72352%2063.72352%200%200%201-33.97632-117.6576h-0.33792v-647.0656a49.01888%2049.01888%200%201%201%2058.83904%200l-0.01024%2068.61824h735.31392v-68.62848A48.9472%2048.9472%200%200%201%20855.1936%20133.12l-0.04096-2.18112A49.01888%2049.01888%200%200%201%20904.17152%2081.92zM114.92352%20846.6432a24.51456%2024.51456%200%201%200%200%2049.02912%2024.51456%2024.51456%200%200%200%200-49.01888z%20m794.15296%200a24.51456%2024.51456%200%201%200%200%2049.02912%2024.51456%2024.51456%200%200%200%200-49.01888zM266.88512%20376.05376H139.43808v333.34272h127.44704V376.04352z%20m205.89568%200H325.71392v333.34272H472.7808V376.04352z%20m205.88544%200H531.59936v333.34272h147.06688V376.04352z%20m196.08576%200H737.49504v333.34272h137.25696V376.04352z%20m0-78.4384H139.43808v19.6096h735.31392v-19.6096z'%20fill='%23050505'%20p-id='1818'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_22=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769568667919'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11114'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20617.386667c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v182.954667a32%2032%200%200%201-32.213333%2031.829333%2032%2032%200%200%201-32.170667-31.829333v-182.954667A32%2032%200%200%201%20512%20617.386667zM96.170667%20297.216c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v365.909334a32%2032%200%200%201-32.213333%2031.829333%2032%2032%200%200%201-32.170667-31.829333V329.045333a32%2032%200%200%201%2032.170667-31.829333zM927.829333%20297.216c17.792%200%2032.213333%2014.250667%2032.213334%2031.829333v365.909334a32%2032%200%200%201-32.213334%2031.829333%2032%2032%200%200%201-32.170666-31.829333V329.045333a32%2032%200%200%201%2032.170666-31.829333zM396.8%20580.992a32.426667%2032.426667%200%200%201%2045.525333%200%2031.658667%2031.658667%200%200%201%200%2045.056l-46.208%2045.696a32.426667%2032.426667%200%200%201-45.482666%200%2031.616%2031.616%200%200%201%200-45.056l46.208-45.653333zM581.674667%20580.949333a32.426667%2032.426667%200%200%201%2045.482666%200l46.208%2045.738667a31.658667%2031.658667%200%200%201%200%2045.056%2032.426667%2032.426667%200%200%201-45.482666%200l-46.208-45.738667a31.616%2031.616%200%200%201%200-45.056zM214.485333%20441.6a32.426667%2032.426667%200%200%201%2043.093334%202.133333c9.941333%209.898667%2011.904%2024.576%206.058666%2036.437334h109.781334a32%2032%200%200%201%2032.170666%2031.829333%2032%2032%200%200%201-32.170666%2031.872H263.637333a31.573333%2031.573333%200%200%201-6.101333%2036.437333%2032.426667%2032.426667%200%200%201-43.050667%202.133334l-2.432-2.133334-46.208-45.781333a31.616%2031.616%200%200%201%200-45.013333L212.053333%20443.733333l2.432-2.133333zM766.464%20443.733333a32.426667%2032.426667%200%200%201%2045.482667%200l46.208%2045.781334%202.218666%202.389333a31.616%2031.616%200%200%201-2.218666%2042.666667L811.946667%20580.266667l-2.432%202.133333a32.426667%2032.426667%200%200%201-43.093334-2.133333%2031.573333%2031.573333%200%200%201-6.101333-36.437334H650.666667a32%2032%200%200%201-32.170667-31.872%2032%2032%200%200%201%2032.170667-31.829333h109.781333a31.488%2031.488%200%200%201%206.058667-36.437333zM512%20466.304c25.514667%200%2046.208%2020.48%2046.208%2045.738667%200%2025.258667-20.693333%2045.696-46.208%2045.696s-46.208-20.48-46.208-45.696c0-25.258667%2020.693333-45.738667%2046.208-45.738667zM350.848%20352.256a32.426667%2032.426667%200%200%201%2045.482667%200.085333l46.08%2045.696a31.658667%2031.658667%200%200%201-0.128%2045.098667%2032.426667%2032.426667%200%200%201-45.482667-0.085333L350.72%20397.312a31.616%2031.616%200%200%201%200.128-45.056zM627.882667%20352.298667a32.426667%2032.426667%200%200%201%2045.482666%200%2031.616%2031.616%200%200%201%200%2045.056l-46.208%2045.653333a32.426667%2032.426667%200%200%201-45.482666%200%2031.616%2031.616%200%200%201%200-45.013333l46.208-45.696zM512%20160c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v182.954667A32%2032%200%200%201%20512%20406.613333a32%2032%200%200%201-32.170667-31.829333V191.829333A32%2032%200%200%201%20512%20160z'%20p-id='11115'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue";"production"===process.env.NODE_ENV||Object.freeze({}),"production"===process.env.NODE_ENV||Object.freeze([]);const NOOP=()=>{},hasOwnProperty$e=Object.prototype.hasOwnProperty,hasOwn=(val,key)=>hasOwnProperty$e.call(val,key),isArray$1=Array.isArray,isFunction$1=val=>"function"==typeof val,isString=val=>"string"==typeof val,isObject$2=val=>null!==val&&"object"==typeof val,cacheStringFunction=(Object.prototype.toString,fn2=>{const cache=/* @__PURE__ */Object.create(null);return str=>cache[str]||(cache[str]=fn2(str))}),camelizeRE=/-\w/g;cacheStringFunction(str=>str.replace(camelizeRE,c=>c.slice(1).toUpperCase())),cacheStringFunction(str=>str.charAt(0).toUpperCase()+str.slice(1));var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$g=Object.prototype,hasOwnProperty$d=objectProto$g.hasOwnProperty,nativeObjectToString$1=objectProto$g.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;var nativeObjectToString=Object.prototype.toString;var symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?function(value){var isOwn=hasOwnProperty$d.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString$1.call(value);return unmasked&&(isOwn?value[symToStringTag$1]=tag:delete value[symToStringTag$1]),result}(value):function(value){return nativeObjectToString.call(value)}(value)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var isArray=Array.isArray,symbolProto$2=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function isObject$1(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isFunction(value){if(!isObject$1(value))return!1;var tag=baseGetTag(value);return"[object Function]"==tag||"[object GeneratorFunction]"==tag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}var uid,coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"";var funcToString$2=Function.prototype.toString;function toSource(func){if(null!=func){try{return funcToString$2.call(func)}catch(e){}try{return func+""}catch(e){}}return""}var reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$e=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$c=objectProto$e.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(value){return!(!isObject$1(value)||(func=value,maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value));var func}function getNative(object,key){var value=function(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(value)?value:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=/* @__PURE__ */function(){function object(){}return function(proto){if(!isObject$1(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=void 0,result}}();var nativeNow=Date.now;var func,count,lastCalled,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:(value=string,function(){return value}),writable:!0});var value}:function(value){return value},setToString=(func=baseSetToString,count=0,lastCalled=0,function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)});var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function eq(value,other){return value===other||value!=value&&other!=other}var hasOwnProperty$b=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];hasOwnProperty$b.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=void 0;void 0===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}var nativeMax=Math.max;function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}var objectProto$c=Object.prototype;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto$c)}function baseIsArguments(value){return isObjectLike(value)&&"[object Arguments]"==baseGetTag(value)}var objectProto$b=Object.prototype,hasOwnProperty$a=objectProto$b.hasOwnProperty,propertyIsEnumerable$1=objectProto$b.propertyIsEnumerable,isArguments=baseIsArguments(/* @__PURE__ */function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$a.call(value,"callee")&&!propertyIsEnumerable$1.call(value,"callee")};var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer$1=freeModule$2&&freeModule$2.exports===freeExports$2?root.Buffer:void 0,isBuffer=(Buffer$1?Buffer$1.isBuffer:void 0)||function(){return!1},typedArrayTags={};function baseUnary(func){return function(value){return func(value)}}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule$1&&freeModule$1.exports===freeExports$1&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]},hasOwnProperty$9=Object.prototype.hasOwnProperty;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?function(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty$9.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function overArg(func,transform){return function(arg){return func(transform(arg))}}var nativeKeys=overArg(Object.keys,Object),hasOwnProperty$8=Object.prototype.hasOwnProperty;function keys(object){return isArrayLike(object)?arrayLikeKeys(object):function(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty$8.call(object,key)&&"constructor"!=key&&result.push(key);return result}(object)}var hasOwnProperty$7=Object.prototype.hasOwnProperty;function baseKeysIn(object){if(!isObject$1(object))return function(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty$7.call(object,key))&&result.push(key);return result}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;var nativeCreate=getNative(Object,"create");var hasOwnProperty$6=Object.prototype.hasOwnProperty;var hasOwnProperty$5=Object.prototype.hasOwnProperty;function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?void 0:result}return hasOwnProperty$6.call(data,key)?data[key]:void 0},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty$5.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this};var splice=Array.prototype.splice;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]},ListCache.prototype.has=function(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this};var Map$1=getNative(root,"Map");function getMapData(map,key){var value,type,data=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?data["string"==typeof key?"string":"hash"]:data.map}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this};function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError("Expected a function");var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(func){var result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache;return result}(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result});function castPath(value,object){return isArray(value)?value:function(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object)}(value,object)?[value]:stringToPath(function(value){return null==value?"":baseToString(value)}(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function flatten(array){return(null==array?0:array.length)?baseFlatten(array,1):[]}function flatRest(func){return setToString(function(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),function(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}(func,this,otherArgs)}}(func,void 0,flatten),func+"")}var getPrototype=overArg(Object.getPrototypeOf,Object),funcProto=Function.prototype,objectProto$5=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$4=objectProto$5.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty$4.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map$1||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(object){return null==object?[]:(object=Object(object),function(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}(nativeGetSymbols$1(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;var getSymbolsIn=Object.getOwnPropertySymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView&&"[object DataView]"!=getTag(new DataView(new ArrayBuffer(1)))||Map$1&&"[object Map]"!=getTag(new Map$1)||Promise$1&&"[object Promise]"!=getTag(Promise$1.resolve())||Set$1&&"[object Set]"!=getTag(new Set$1)||WeakMap$1&&"[object WeakMap]"!=getTag(new WeakMap$1))&&(getTag=function(value){var result=baseGetTag(value),Ctor="[object Object]"==result?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return"[object DataView]";case mapCtorString:return"[object Map]";case promiseCtorString:return"[object Promise]";case setCtorString:return"[object Set]";case weakMapCtorString:return"[object WeakMap]"}return result});var hasOwnProperty$3=Object.prototype.hasOwnProperty;var Uint8Array$1=root.Uint8Array;function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer)),result}var reFlags=/\w*$/;var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function initCloneByTag(object,tag,isDeep){var symbol,regexp,result,Ctor=object.constructor;switch(tag){case"[object ArrayBuffer]":return cloneArrayBuffer(object);case"[object Boolean]":case"[object Date]":return new Ctor(+object);case"[object DataView]":return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}(object,isDeep);case"[object Map]":case"[object Set]":return new Ctor;case"[object Number]":case"[object String]":return new Ctor(object);case"[object RegExp]":return(result=new(regexp=object).constructor(regexp.source,reFlags.exec(regexp))).lastIndex=regexp.lastIndex,result;case"[object Symbol]":return symbol=object,symbolValueOf$1?Object(symbolValueOf$1.call(symbol)):{}}}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&"[object Map]"==getTag(value)};var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&"[object Set]"==getTag(value)},cloneableTags={};function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),void 0!==result)return result;if(!isObject$1(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty$3.call(array,"index")&&(result.index=array.index,result.input=array.input),result}(value),!isDeep)return function(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}(value,result)}else{var tag=getTag(value),isFunc="[object Function]"==tag||"[object GeneratorFunction]"==tag;if(isBuffer(value))return function(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}(value,isDeep);if("[object Object]"==tag||"[object Arguments]"==tag||isFunc&&!object){if(result=isFlat||isFunc?{}:function(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&©Object(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,function(object,source){return object&©Object(source,keys(source),object)}(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}):isMap(value)&&value.forEach(function(subValue,key2){result.set(key2,baseClone(subValue,bitmask,customizer,key2,value,stack))});var props=isArr?void 0:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return function(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););}(props||value,function(subValue,key2){props&&(subValue=value[key2=subValue]),assignValue(result,key2,baseClone(subValue,bitmask,customizer,key2,value,stack))}),result}cloneableTags["[object Arguments]"]=cloneableTags["[object Array]"]=cloneableTags["[object ArrayBuffer]"]=cloneableTags["[object DataView]"]=cloneableTags["[object Boolean]"]=cloneableTags["[object Date]"]=cloneableTags["[object Float32Array]"]=cloneableTags["[object Float64Array]"]=cloneableTags["[object Int8Array]"]=cloneableTags["[object Int16Array]"]=cloneableTags["[object Int32Array]"]=cloneableTags["[object Map]"]=cloneableTags["[object Number]"]=cloneableTags["[object Object]"]=cloneableTags["[object RegExp]"]=cloneableTags["[object Set]"]=cloneableTags["[object String]"]=cloneableTags["[object Symbol]"]=cloneableTags["[object Uint8Array]"]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags["[object Uint16Array]"]=cloneableTags["[object Uint32Array]"]=!0,cloneableTags["[object Error]"]=cloneableTags["[object Function]"]=cloneableTags["[object WeakMap]"]=!1;function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(key=othIndex,!seen.has(key)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex);var key})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set2){var index=-1,result=Array(set2.size);return set2.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$2=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty$1=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array$1(object),new Uint8Array$1(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty$1.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty$1.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$2.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasIn(object,path){return null!=object&&function(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}(object,path,baseHasIn)}function fromPairs(pairs){for(var index=-1,length=null==pairs?0:pairs.length,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result}function parent(object,path){return path.length<2?object:baseGet(object,function(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}(path,0,-1))}function isEqual(value,other){return baseIsEqual(value,other)}function isNil(value){return null==value}var hasOwnProperty=Object.prototype.hasOwnProperty;function baseUnset(object,path){var index=-1,length=(path=castPath(path,object)).length;if(!length)return!0;for(var isRootPrimitive=null==object||"object"!=typeof object&&"function"!=typeof object;++index<length;){var key=path[index];if("string"==typeof key){if("__proto__"===key&&!hasOwnProperty.call(object,"__proto__"))return!1;if("constructor"===key&&index+1<length&&"string"==typeof path[index+1]&&"prototype"===path[index+1]){if(isRootPrimitive&&0===index)continue;return!1}}}var obj=parent(object,path);return null==obj||delete obj[toKey(function(array){var length=null==array?0:array.length;return length?array[length-1]:void 0}(path))]}function customOmitClone(value){return isPlainObject(value)?void 0:value}var omit=flatRest(function(object,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,7,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result});function baseSet(object,path,value,customizer){if(!isObject$1(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if("__proto__"===key||"constructor"===key||"prototype"===key)return object;if(index!=lastIndex){var objValue=nested[key];void 0===(newValue=void 0)&&(newValue=isObject$1(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}function basePick(object,paths){return function(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}(object,paths,function(value,path){return hasIn(object,path)})}var pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)});const isUndefined=val=>void 0===val,isBoolean=val=>"boolean"==typeof val,isNumber=val=>"number"==typeof val,isElement=e=>"undefined"!=typeof Element&&e instanceof Element,isPropAbsent=prop=>isNil(prop),keysOf=arr=>Object.keys(arr),epPropKey="__epPropKey",buildProp=(prop,key)=>{if(!isObject$2(prop)||isObject$2(val=prop)&&val.__epPropKey)return prop;var val;const{values:values,required:required,default:defaultValue,type:type,validator:validator}=prop,epProp={type:type,required:!!required,validator:values||validator?val=>{let valid=!1,allowedValues=[];if(values&&(allowedValues=Array.from(values),hasOwn(prop,"default")&&allowedValues.push(defaultValue),valid||=allowedValues.includes(val)),validator&&(valid||=validator(val)),!valid&&allowedValues.length>0){const allowValuesText=[...new Set(allowedValues)].map(value=>JSON.stringify(value)).join(", ");warn(`Invalid prop: validation failed${key?` for prop "${key}"`:""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`)}return valid}:void 0,[epPropKey]:!0};return hasOwn(prop,"default")&&(epProp.default=defaultValue),epProp},buildProps=props=>fromPairs(Object.entries(props).map(([key,option])=>[key,buildProp(option,key)])),teleportProps=buildProps({to:{type:[String,Object],required:!0},disabled:Boolean});var ElementPlusError=class extends Error{constructor(m){super(m),this.name="ElementPlusError"}};function debugWarn(scope,message2){{const error=isString(scope)?new ElementPlusError(`[${scope}] ${message2}`):scope;console.warn(error)}}const DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/;function computedEager(fn2,options){const result=shallowRef();return watchEffect(()=>{result.value=fn2()},{...options,flush:null!=void 0?void 0:"sync"}),readonly(result)}function tryOnScopeDispose(fn2){return!!getCurrentScope()&&(onScopeDispose(fn2),!0)}function toValue(r){return"function"==typeof r?r():unref(r)}const isClient="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const toString=Object.prototype.toString,noop=()=>{},isIOS=/* @__PURE__ */getIsIOS();function getIsIOS(){var _a,_b;return isClient&&(null==(_a=null==window?void 0:window.navigator)?void 0:_a.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(null==(_b=null==window?void 0:window.navigator)?void 0:_b.maxTouchPoints)>2&&/iPad|Macintosh/.test(null==window?void 0:window.navigator.userAgent))}const defaultWindow=isClient?window:void 0;isClient&&window.document;function unrefElement(elRef){var _a;const plain=toValue(elRef);return null!=(_a=null==plain?void 0:plain.$el)?_a:plain}function useEventListener(...args){let target,events,listeners,options;if("string"==typeof args[0]||Array.isArray(args[0])?([events,listeners,options]=args,target=defaultWindow):[target,events,listeners,options]=args,!target)return noop;Array.isArray(events)||(events=[events]),Array.isArray(listeners)||(listeners=[listeners]);const cleanups=[],cleanup=()=>{cleanups.forEach(fn2=>fn2()),cleanups.length=0},stopWatch=watch(()=>[unrefElement(target),toValue(options)],([el,options2])=>{if(cleanup(),!el)return;const optionsClone=(val=options2,"[object Object]"===toString.call(val)?{...options2}:options2);var val;cleanups.push(...events.flatMap(event=>listeners.map(listener=>((el,event,listener,options2)=>(el.addEventListener(event,listener,options2),()=>el.removeEventListener(event,listener,options2)))(el,event,listener,optionsClone))))},{immediate:!0,flush:"post"}),stop=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(stop),stop}let _iOSWorkaround=!1;function onClickOutside(target,handler,options={}){const{window:window2=defaultWindow,ignore:ignore=[],capture:capture=!0,detectIframe:detectIframe=!1}=options;if(!window2)return noop;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(window2.document.body.children).forEach(el=>el.addEventListener("click",noop)),window2.document.documentElement.addEventListener("click",noop));let shouldListen=!0;const shouldIgnore=event=>toValue(ignore).some(target2=>{if("string"==typeof target2)return Array.from(window2.document.querySelectorAll(target2)).some(el=>el===event.target||event.composedPath().includes(el));{const el=unrefElement(target2);return el&&(event.target===el||event.composedPath().includes(el))}});const listener=event=>{const el=unrefElement(target);null!=event.target&&(el instanceof Element||!function(target2){const vm=toValue(target2);return vm&&16===vm.$.subTree.shapeFlag}(target)||!function(target2,event){const vm=toValue(target2),children=vm.$.subTree&&vm.$.subTree.children;return!(null==children||!Array.isArray(children))&&children.some(child=>child.el===event.target||event.composedPath().includes(child.el))}(target,event))&&el&&el!==event.target&&!event.composedPath().includes(el)&&(0===event.detail&&(shouldListen=!shouldIgnore(event)),shouldListen?handler(event):shouldListen=!0)};let isProcessingClick=!1;const cleanup=[useEventListener(window2,"click",event=>{isProcessingClick||(isProcessingClick=!0,setTimeout(()=>{isProcessingClick=!1},0),listener(event))},{passive:!0,capture:capture}),useEventListener(window2,"pointerdown",e=>{const el=unrefElement(target);shouldListen=!shouldIgnore(e)&&!(!el||e.composedPath().includes(el))},{passive:!0}),detectIframe&&useEventListener(window2,"blur",event=>{setTimeout(()=>{var _a;const el=unrefElement(target);"IFRAME"!==(null==(_a=window2.document.activeElement)?void 0:_a.tagName)||(null==el?void 0:el.contains(window2.document.activeElement))||handler(event)},0)})].filter(Boolean);return()=>cleanup.forEach(fn2=>fn2())}function useSupported(callback){const isMounted=function(){const isMounted=ref(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}();return computed(()=>(isMounted.value,Boolean(callback())))}function useResizeObserver(target,callback,options={}){const{window:window2=defaultWindow,...observerOptions}=options;let observer;const isSupported=useSupported(()=>window2&&"ResizeObserver"in window2),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{const _targets=toValue(target);return Array.isArray(_targets)?_targets.map(el=>unrefElement(el)):[unrefElement(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window2){observer=new ResizeObserver(callback);for(const _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:"post"}),stop=()=>{cleanup(),stopWatch()};return tryOnScopeDispose(stop),{isSupported:isSupported,stop:stop}}const useDeprecated=({from:from,replacement:replacement,scope:scope,version:version,ref:ref2,type:type="API"},condition)=>{watch(()=>unref(condition),val=>{val&&debugWarn(scope,`[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.\nFor more detail, please visit: ${ref2}\n`)},{immediate:!0})},isHTMLElement=e=>"undefined"!=typeof Element&&e instanceof Element,isFocusable=element=>{if(element.tabIndex>0||0===element.tabIndex&&null!==element.getAttribute("tabIndex"))return!0;if(element.tabIndex<0||element.hasAttribute("disabled")||"true"===element.getAttribute("aria-disabled"))return!1;switch(element.nodeName){case"A":return!!element.href&&"ignore"!==element.rel;case"INPUT":return!("hidden"===element.type||"file"===element.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},focusElement=(el,options)=>{if(!el||!el.focus)return;let cleanup=!1;!isHTMLElement(el)||isFocusable(el)||el.getAttribute("tabindex")||(el.setAttribute("tabindex","-1"),cleanup=!0),el.focus(options),isHTMLElement(el)&&cleanup&&el.removeAttribute("tabindex")},isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);function addUnit(value,defaultUnit="px"){return value||0===value?isNumber(value)||isString(val=value)&&!Number.isNaN(Number(val))?`${value}${defaultUnit}`:isString(value)?value:void debugWarn("utils/dom/style","binding value must be a string or number"):"";var val}var en_default={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value",alphaDescription:"alpha {alpha}, current color is {color}",hueLabel:"pick hue value",hueDescription:"hue {hue}, current color is {color}",svLabel:"pick saturation and brightness value",svDescription:"saturation {saturation}, brightness {brightness}, current color is {color}",predefineDescription:"select {value} as the color"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum",selectAllLabel:"Select all rows",selectRowLabel:"Select this row",expandRowLabel:"Expand this row",collapseRowLabel:"Collapse this row",sortLabel:"Sort by {column}",filterLabel:"Filter by {column}"},tag:{close:"Close this tag"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const buildTranslator=locale=>(path,option)=>translate(path,option,unref(locale)),translate=(path,option,locale)=>get(locale,path,path).replace(/\{(\w+)\}/g,(_,key)=>`${option?.[key]??`{${key}}`}`),localeContextKey=/* @__PURE__ */Symbol("localeContextKey"),useLocale=localeOverrides=>{const locale=localeOverrides||inject(localeContextKey,ref());return(locale=>({lang:computed(()=>unref(locale).name),locale:isRef(locale)?locale:ref(locale),t:buildTranslator(locale)}))(computed(()=>locale.value||en_default))},_bem=(namespace,block,blockSuffix,element,modifier)=>{let cls=`${namespace}-${block}`;return blockSuffix&&(cls+=`-${blockSuffix}`),element&&(cls+=`__${element}`),modifier&&(cls+=`--${modifier}`),cls},namespaceContextKey=/* @__PURE__ */Symbol("namespaceContextKey"),useGetDerivedNamespace=namespaceOverrides=>{const derivedNamespace=namespaceOverrides||(getCurrentInstance()?inject(namespaceContextKey,ref("el")):ref("el"));return computed(()=>unref(derivedNamespace)||"el")},useNamespace=(block,namespaceOverrides)=>{const namespace=useGetDerivedNamespace(namespaceOverrides);return{namespace:namespace,b:(blockSuffix="")=>_bem(namespace.value,block,blockSuffix,"",""),e:element=>element?_bem(namespace.value,block,"",element,""):"",m:modifier=>modifier?_bem(namespace.value,block,"","",modifier):"",be:(blockSuffix,element)=>blockSuffix&&element?_bem(namespace.value,block,blockSuffix,element,""):"",em:(element,modifier)=>element&&modifier?_bem(namespace.value,block,"",element,modifier):"",bm:(blockSuffix,modifier)=>blockSuffix&&modifier?_bem(namespace.value,block,blockSuffix,"",modifier):"",bem:(blockSuffix,element,modifier)=>blockSuffix&&element&&modifier?_bem(namespace.value,block,blockSuffix,element,modifier):"",is:(name,...args)=>{const state=!(args.length>=1)||args[0];return name&&state?`is-${name}`:""},cssVar:object=>{const styles={};for(const key in object)object[key]&&(styles[`--${namespace.value}-${key}`]=object[key]);return styles},cssVarName:name=>`--${namespace.value}-${name}`,cssVarBlock:object=>{const styles={};for(const key in object)object[key]&&(styles[`--${namespace.value}-${block}-${key}`]=object[key]);return styles},cssVarBlockName:name=>`--${namespace.value}-${block}-${name}`}},composeEventHandlers=(theirsHandler,oursHandler,{checkForDefaultPrevented:checkForDefaultPrevented=!0}={})=>event=>{const shouldPrevent=theirsHandler?.(event);if(!1===checkForDefaultPrevented||!shouldPrevent)return oursHandler?.(event)},whenMouse=handler=>e=>"mouse"===e.pointerType?handler(e):void 0,getEventCode=event=>{if(event.code&&"Unidentified"!==event.code)return event.code;const key=getEventKey(event);return key?Object.values(EVENT_CODE).includes(key)?key:" "===key?EVENT_CODE.space:"":""},getEventKey=event=>{let key=event.key&&"Unidentified"!==event.key?event.key:"";if(!key&&"keyup"===event.type&&isClient&&/android/i.test(window.navigator.userAgent)){const target=event.target;key=target.value.charAt(target.selectionStart-1)}return key},_prop=buildProp({type:Boolean,default:null}),_event=buildProp({type:Function}),useProp=name=>{const vm=getCurrentInstance();return computed(()=>vm?.proxy?.$props?.[name])};var L="top",W="bottom",T="right",P="left",me="auto",Q=[L,W,T,P],Y="start",Z="end",je="viewport",ee="popper",De=Q.reduce(function(e,t){return e.concat([t+"-"+Y,t+"-"+Z])},[]),Ee=[].concat(Q,[me]).reduce(function(e,t){return e.concat([t,t+"-"+Y,t+"-"+Z])},[]),it=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function V(e){return e?(e.nodeName||"").toLowerCase():null}function B(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function G(e){return e instanceof B(e).Element||e instanceof Element}function R(e){return e instanceof B(e).HTMLElement||e instanceof HTMLElement}function Ae(e){return"undefined"!=typeof ShadowRoot&&(e instanceof B(e).ShadowRoot||e instanceof ShadowRoot)}var ke={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},a=t.elements[n];!R(a)||!V(a)||(Object.assign(a.style,r),Object.keys(o).forEach(function(c){var s=o[c];!1===s?a.removeAttribute(c):a.setAttribute(c,!0===s?"":s)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],a=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]).reduce(function(i,f){return i[f]="",i},{});!R(o)||!V(o)||(Object.assign(o.style,s),Object.keys(a).forEach(function(i){o.removeAttribute(i)}))})}},requires:["computeStyles"]};function C(e){return e.split("-")[0]}var J=Math.max,ve=Math.min,te=Math.round;function Le(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function at(){return!/^((?!chrome|android).)*safari/i.test(Le())}function ne(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&R(e)&&(o=e.offsetWidth>0&&te(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&te(r.height)/e.offsetHeight||1);var s=(G(e)?B(e):window).visualViewport,i=!at()&&n,f=(r.left+(i&&s?s.offsetLeft:0))/o,u=(r.top+(i&&s?s.offsetTop:0))/a,m=r.width/o,h2=r.height/a;return{width:m,height:h2,top:u,right:f+m,bottom:u+h2,left:f,x:f,y:u}}function Pe(e){var t=ne(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function st(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return B(e).getComputedStyle(e)}function Rt(e){return["table","td","th"].indexOf(V(e))>=0}function N(e){return((G(e)?e.ownerDocument:e.document)||window.document).documentElement}function ye(e){return"html"===V(e)?e:e.assignedSlot||e.parentNode||(Ae(e)?e.host:null)||N(e)}function ft(e){return R(e)&&"fixed"!==I(e).position?e.offsetParent:null}function se(e){for(var t=B(e),n=ft(e);n&&Rt(n)&&"static"===I(n).position;)n=ft(n);return n&&("html"===V(n)||"body"===V(n)&&"static"===I(n).position)?t:n||function(e){var t=/firefox/i.test(Le());if(/Trident/i.test(Le())&&R(e)&&"fixed"===I(e).position)return null;var o=ye(e);for(Ae(o)&&(o=o.host);R(o)&&["html","body"].indexOf(V(o))<0;){var a=I(o);if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||t&&"filter"===a.willChange||t&&a.filter&&"none"!==a.filter)return o;o=o.parentNode}return null}(e)||t}function Me(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function fe(e,t,n){return J(e,ve(t,n))}function ut(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pt(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var lt={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,c=n.modifiersData.popperOffsets,s=C(n.placement),i=Me(s),u=[P,T].indexOf(s)>=0?"height":"width";if(a&&c){var m=function(e,t){return ut("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pt(e,Q))}(o.padding,n),h2=Pe(a),l="y"===i?L:P,g="y"===i?W:T,p=n.rects.reference[u]+n.rects.reference[i]-c[i]-n.rects.popper[u],y=c[i]-n.rects.reference[i],b=se(a),x=b?"y"===i?b.clientHeight||0:b.clientWidth||0:0,O=p/2-y/2,d=m[l],v=x-h2[u]-m[g],w=x/2-h2[u]/2+O,$=fe(d,w,v),j=i;n.modifiersData[r]=((t={})[j]=$,t.centerOffset=$-w,t)}},effect:function(e){var t=e.state,r=e.options.element,o=void 0===r?"[data-popper-arrow]":r;null!=o&&("string"==typeof o&&!(o=t.elements.popper.querySelector(o))||st(t.elements.popper,o)&&(t.elements.arrow=o))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function re(e){return e.split("-")[1]}var It={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,m=e.isFixed,h2=c.x,l=void 0===h2?0:h2,g=c.y,p=void 0===g?0:g,y="function"==typeof u?u({x:l,y:p}):{x:l,y:p};l=y.x,p=y.y;var b=c.hasOwnProperty("x"),x=c.hasOwnProperty("y"),O=P,d=L,v=window;if(f){var w=se(n),$="clientHeight",j="clientWidth";if(w===B(n)&&("static"!==I(w=N(n)).position&&"absolute"===s&&($="scrollHeight",j="scrollWidth")),o===L||(o===P||o===T)&&a===Z)d=W,p-=(m&&w===v&&v.visualViewport?v.visualViewport.height:w[$])-r.height,p*=i?1:-1;if(o===P||(o===L||o===W)&&a===Z)O=T,l-=(m&&w===v&&v.visualViewport?v.visualViewport.width:w[j])-r.width,l*=i?1:-1}var k,A=Object.assign({position:s},f&&It),H=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:te(n*o)/o||0,y:te(r*o)/o||0}}({x:l,y:p},B(n)):{x:l,y:p};return l=H.x,p=H.y,i?Object.assign({},A,((k={})[d]=x?"0":"",k[O]=b?"0":"",k.transform=(v.devicePixelRatio||1)<=1?"translate("+l+"px, "+p+"px)":"translate3d("+l+"px, "+p+"px, 0)",k)):Object.assign({},A,((t={})[d]=x?p+"px":"",t[O]=b?l+"px":"",t.transform="",t))}var We={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,a=n.adaptive,c=void 0===a||a,s=n.roundOffsets,i=void 0===s||s,f={placement:C(t.placement),variation:re(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,dt(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,dt(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ge={passive:!0};var Te={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=void 0===o||o,c=r.resize,s=void 0===c||c,i=B(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(u){u.addEventListener("scroll",n.update,ge)}),s&&i.addEventListener("resize",n.update,ge),function(){a&&f.forEach(function(u){u.removeEventListener("scroll",n.update,ge)}),s&&i.removeEventListener("resize",n.update,ge)}},data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(e){return e.replace(/left|right|bottom|top/g,function(t){return _t[t]})}var zt={start:"end",end:"start"};function ht(e){return e.replace(/start|end/g,function(t){return zt[t]})}function Be(e){var t=B(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Re(e){return ne(N(e)).left+Be(e).scrollLeft}function He(e){var t=I(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function mt(e){return["html","body","#document"].indexOf(V(e))>=0?e.ownerDocument.body:R(e)&&He(e)?e:mt(ye(e))}function ce(e,t){var n;void 0===t&&(t=[]);var r=mt(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=B(r),c=o?[a].concat(a.visualViewport||[],He(r)?r:[]):r,s=t.concat(c);return o?s:s.concat(ce(ye(c)))}function Se(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function vt(e,t,n){return t===je?Se(function(e,t){var n=B(e),r=N(e),o=n.visualViewport,a=r.clientWidth,c=r.clientHeight,s=0,i=0;if(o){a=o.width,c=o.height;var f=at();(f||!f&&"fixed"===t)&&(s=o.offsetLeft,i=o.offsetTop)}return{width:a,height:c,x:s+Re(e),y:i}}(e,n)):G(t)?function(e,t){var n=ne(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Se(function(e){var t,n=N(e),r=Be(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=J(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=J(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Re(e),i=-r.scrollTop;return"rtl"===I(o||n).direction&&(s+=J(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}(N(e)))}function Kt(e,t,n,r){var o="clippingParents"===t?function(e){var t=ce(ye(e)),r=["absolute","fixed"].indexOf(I(e).position)>=0&&R(e)?se(e):e;return G(r)?t.filter(function(o){return G(o)&&st(o,r)&&"body"!==V(o)}):[]}(e):[].concat(t),a=[].concat(o,[n]),c=a[0],s=a.reduce(function(i,f){var u=vt(e,f,r);return i.top=J(u.top,i.top),i.right=ve(u.right,i.right),i.bottom=ve(u.bottom,i.bottom),i.left=J(u.left,i.left),i},vt(e,c,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function yt(e){var i,t=e.reference,n=e.element,r=e.placement,o=r?C(r):null,a=r?re(r):null,c=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2;switch(o){case L:i={x:c,y:t.y-n.height};break;case W:i={x:c,y:t.y+t.height};break;case T:i={x:t.x+t.width,y:s};break;case P:i={x:t.x-n.width,y:s};break;default:i={x:t.x,y:t.y}}var f=o?Me(o):null;if(null!=f){var u="y"===f?"height":"width";switch(a){case Y:i[f]=i[f]-(t[u]/2-n[u]/2);break;case Z:i[f]=i[f]+(t[u]/2-n[u]/2)}}return i}function oe(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,a=n.strategy,c=void 0===a?e.strategy:a,s=n.boundary,i=void 0===s?"clippingParents":s,f=n.rootBoundary,u=void 0===f?je:f,m=n.elementContext,h2=void 0===m?ee:m,l=n.altBoundary,g=void 0!==l&&l,p=n.padding,y=void 0===p?0:p,b=ut("number"!=typeof y?y:pt(y,Q)),x=h2===ee?"reference":ee,O=e.rects.popper,d=e.elements[g?x:h2],v=Kt(G(d)?d:d.contextElement||N(e.elements.popper),i,u,c),w=ne(e.elements.reference),$=yt({reference:w,element:O,placement:o}),j=Se(Object.assign({},O,$)),D=h2===ee?j:w,E={top:v.top-D.top+b.top,bottom:D.bottom-v.bottom+b.bottom,left:v.left-D.left+b.left,right:D.right-v.right+b.right},A=e.modifiersData.offset;if(h2===ee&&A){var H=A[o];Object.keys(E).forEach(function(k){var F=[T,W].indexOf(k)>=0?1:-1,U=[L,W].indexOf(k)>=0?"y":"x";E[k]+=H[U]*F})}return E}var gt={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,c=n.altAxis,s=void 0===c||c,i=n.fallbackPlacements,f=n.padding,u=n.boundary,m=n.rootBoundary,h2=n.altBoundary,l=n.flipVariations,g=void 0===l||l,p=n.allowedAutoPlacements,y=t.options.placement,b=C(y),O=i||(b===y||!g?[be(y)]:function(e){if(C(e)===me)return[];var t=be(e);return[ht(e),t,ht(t)]}(y)),d=[y].concat(O).reduce(function(z,q){return z.concat(C(q)===me?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,c=n.padding,s=n.flipVariations,i=n.allowedAutoPlacements,f=void 0===i?Ee:i,u=re(r),m=u?s?De:De.filter(function(g){return re(g)===u}):Q,h2=m.filter(function(g){return f.indexOf(g)>=0});0===h2.length&&(h2=m);var l=h2.reduce(function(g,p){return g[p]=oe(e,{placement:p,boundary:o,rootBoundary:a,padding:c})[C(p)],g},{});return Object.keys(l).sort(function(g,p){return l[g]-l[p]})}(t,{placement:q,boundary:u,rootBoundary:m,padding:f,flipVariations:g,allowedAutoPlacements:p}):q)},[]),v=t.rects.reference,w=t.rects.popper,$=/* @__PURE__ */new Map,j=!0,D=d[0],E=0;E<d.length;E++){var A=d[E],H=C(A),k=re(A)===Y,F=[L,W].indexOf(H)>=0,U=F?"width":"height",M=oe(t,{placement:A,boundary:u,rootBoundary:m,altBoundary:h2,padding:f}),S=F?k?T:P:k?W:L;v[U]>w[U]&&(S=be(S));var ue=be(S),_=[];if(a&&_.push(M[H]<=0),s&&_.push(M[S]<=0,M[ue]<=0),_.every(function(z){return z})){D=A,j=!1;break}$.set(A,_)}if(j)for(var xe=function(z){var q=d.find(function(de){var ae=$.get(de);if(ae)return ae.slice(0,z).every(function(K){return K})});if(q)return D=q,"break"},ie=g?3:1;ie>0;ie--){if("break"===xe(ie))break}t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function wt(e){return[L,T,W,P].some(function(t){return e[t]>=0})}var xt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,c=oe(t,{elementContext:"reference"}),s=oe(t,{altBoundary:!0}),i=bt(c,r),f=bt(s,o,a),u=wt(i),m=wt(f);t.modifiersData[n]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m})}};var Ot={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=void 0===o?[0,0]:o,c=Ee.reduce(function(u,m){return u[m]=function(e,t,n){var r=C(e),o=[P,L].indexOf(r)>=0?-1:1,a="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=a[0],s=a[1];return c=c||0,s=(s||0)*o,[P,T].indexOf(r)>=0?{x:s,y:c}:{x:c,y:s}}(m,t.rects,a),u},{}),s=c[t.placement],i=s.x,f=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=c}};var Ve={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=yt({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var $t={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=void 0===o||o,c=n.altAxis,s=void 0!==c&&c,i=n.boundary,f=n.rootBoundary,u=n.altBoundary,m=n.padding,h2=n.tether,l=void 0===h2||h2,g=n.tetherOffset,p=void 0===g?0:g,y=oe(t,{boundary:i,rootBoundary:f,padding:m,altBoundary:u}),b=C(t.placement),x=re(t.placement),O=!x,d=Me(b),v=function(e){return"x"===e?"y":"x"}(d),w=t.modifiersData.popperOffsets,$=t.rects.reference,j=t.rects.popper,D="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,E="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(w){if(a){var k,F="y"===d?L:P,U="y"===d?W:T,M="y"===d?"height":"width",S=w[d],ue=S+y[F],_=S-y[U],pe=l?-j[M]/2:0,xe=x===Y?$[M]:j[M],ie=x===Y?-j[M]:-$[M],le=t.elements.arrow,z=l&&le?Pe(le):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},de=q[F],ae=q[U],K=fe(0,$[M],z[M]),Et=O?$[M]/2-pe-K-de-E.mainAxis:xe-K-de-E.mainAxis,At=O?-$[M]/2+pe+K+ae+E.mainAxis:ie+K+ae+E.mainAxis,Oe=t.elements.arrow&&se(t.elements.arrow),kt=Oe?"y"===d?Oe.clientTop||0:Oe.clientLeft||0:0,Ce=null!=(k=null==A?void 0:A[d])?k:0,Pt=S+At-Ce,qe=fe(l?ve(ue,S+Et-Ce-kt):ue,S,l?J(_,Pt):_);w[d]=qe,H[d]=qe-S}if(s){var Ie,Mt="x"===d?L:P,Wt="x"===d?W:T,X=w[v],he="y"===v?"height":"width",Ne=X+y[Mt],Fe=X-y[Wt],$e=-1!==[L,P].indexOf(b),Ue=null!=(Ie=null==A?void 0:A[v])?Ie:0,_e=$e?Ne:X-$[he]-j[he]-Ue+E.altAxis,ze=$e?X+$[he]+j[he]-Ue-E.altAxis:Fe,Xe=l&&$e?function(e,t,n){var r=fe(e,t,n);return r>n?n:r}(_e,X,ze):fe(l?_e:Ne,X,l?ze:Fe);w[v]=Xe,H[v]=Xe-X}t.modifiersData[r]=H}},requiresIfExists:["offset"]};function pn(e,t,n){void 0===n&&(n=!1);var r=R(t),o=R(t)&&function(e){var t=e.getBoundingClientRect(),n=te(t.width)/e.offsetWidth||1,r=te(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=N(t),c=ne(e,o,n),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(r||!r&&!n)&&(("body"!==V(t)||He(a))&&(s=function(e){return e!==B(e)&&R(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):Be(e)}(t)),R(t)?((i=ne(t,!0)).x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=Re(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function ln(e){var t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Set,r=[];function o(a){n.add(a.name),[].concat(a.requires||[],a.requiresIfExists||[]).forEach(function(s){if(!n.has(s)){var i=t.get(s);i&&o(i)}}),r.push(a)}return e.forEach(function(a){t.set(a.name,a)}),e.forEach(function(a){n.has(a.name)||o(a)}),r}function hn(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var jt={placement:"bottom",modifiers:[],strategy:"absolute"};function Dt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&"function"==typeof r.getBoundingClientRect)})}function we(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,a=void 0===o?jt:o;return function(c,s,i){void 0===i&&(i=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},jt,a),modifiersData:{},elements:{reference:c,popper:s},attributes:{},styles:{}},u=[],m=!1,h2={state:f,setOptions:function(p){var y="function"==typeof p?p(f.options):p;g(),f.options=Object.assign({},a,f.options,y),f.scrollParents={reference:G(c)?ce(c):c.contextElement?ce(c.contextElement):[],popper:ce(s)};var b=function(e){var t=ln(e);return it.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}(function(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}([].concat(r,f.options.modifiers)));return f.orderedModifiers=b.filter(function(x){return x.enabled}),f.orderedModifiers.forEach(function(p){var y=p.name,b=p.options,x=void 0===b?{}:b,O=p.effect;if("function"==typeof O){var d=O({state:f,name:y,instance:h2,options:x}),v=function(){};u.push(d||v)}}),h2.update()},forceUpdate:function(){if(!m){var p=f.elements,y=p.reference,b=p.popper;if(Dt(y,b)){f.rects={reference:pn(y,se(b),"fixed"===f.options.strategy),popper:Pe(b)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(j){return f.modifiersData[j.name]=Object.assign({},j.data)});for(var x=0;x<f.orderedModifiers.length;x++)if(!0!==f.reset){var O=f.orderedModifiers[x],d=O.fn,v=O.options,w=void 0===v?{}:v,$=O.name;"function"==typeof d&&(f=d({state:f,options:w,name:$,instance:h2})||f)}else f.reset=!1,x=-1}}},update:hn(function(){return new Promise(function(p){h2.forceUpdate(),p(f)})}),destroy:function(){g(),m=!0}};if(!Dt(c,s))return h2;function g(){u.forEach(function(p){return p()}),u=[]}return h2.setOptions(i).then(function(p){!m&&i.onFirstUpdate&&i.onFirstUpdate(p)}),h2}}we(),we({defaultModifiers:[Te,Ve,We,ke]});var wn=we({defaultModifiers:[Te,Ve,We,ke,Ot,gt,$t,lt,xt]});const usePopper=(referenceElementRef,popperElementRef,opts={})=>{const stateUpdater={name:"updateState",enabled:!0,phase:"write",fn:({state:state})=>{const derivedState=function(state){const elements=Object.keys(state.elements);return{styles:fromPairs(elements.map(element=>[element,state.styles[element]||{}])),attributes:fromPairs(elements.map(element=>[element,state.attributes[element]]))}}(state);Object.assign(states.value,derivedState)},requires:["computeStyles"]},options=computed(()=>{const{onFirstUpdate:onFirstUpdate,placement:placement,strategy:strategy,modifiers:modifiers}=unref(opts);return{onFirstUpdate:onFirstUpdate,placement:placement||"bottom",strategy:strategy||"absolute",modifiers:[...modifiers||[],stateUpdater,{name:"applyStyles",enabled:!1}]}}),instanceRef=shallowRef(),states=ref({styles:{popper:{position:unref(options).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),destroy=()=>{instanceRef.value&&(instanceRef.value.destroy(),instanceRef.value=void 0)};return watch(options,newOptions=>{const instance=unref(instanceRef);instance&&instance.setOptions(newOptions)},{deep:!0}),watch([referenceElementRef,popperElementRef],([referenceElement,popperElement])=>{destroy(),referenceElement&&popperElement&&(instanceRef.value=wn(referenceElement,popperElement,unref(options)))}),onBeforeUnmount(()=>{destroy()}),{state:computed(()=>({...unref(instanceRef)?.state||{}})),styles:computed(()=>unref(states).styles),attributes:computed(()=>unref(states).attributes),update:()=>unref(instanceRef)?.update(),forceUpdate:()=>unref(instanceRef)?.forceUpdate(),instanceRef:computed(()=>unref(instanceRef))}};function useTimeout(){let timeoutHandle;const cancelTimeout=()=>window.clearTimeout(timeoutHandle);return tryOnScopeDispose(()=>cancelTimeout()),{registerTimeout:(fn2,delay)=>{cancelTimeout(),timeoutHandle=window.setTimeout(fn2,delay)},cancelTimeout:cancelTimeout}}const defaultIdInjection={prefix:Math.floor(1e4*Math.random()),current:0},ID_INJECTION_KEY=/* @__PURE__ */Symbol("elIdInjection"),useIdInjection=()=>getCurrentInstance()?inject(ID_INJECTION_KEY,defaultIdInjection):defaultIdInjection,useId=deterministicId=>{const idInjection=useIdInjection();isClient||idInjection!==defaultIdInjection||debugWarn("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const namespace=useGetDerivedNamespace();return computedEager(()=>unref(deterministicId)||`${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`)};let registeredEscapeHandlers=[];const cachedHandler=event=>{getEventCode(event)===EVENT_CODE.esc&®isteredEscapeHandlers.forEach(registeredHandler=>registeredHandler(event))},usePopperContainerId=()=>{const namespace=useGetDerivedNamespace(),idInjection=useIdInjection(),id=computed(()=>`${namespace.value}-popper-container-${idInjection.prefix}`);return{id:id,selector:computed(()=>`#${id.value}`)}},usePopperContainer=()=>{const{id:id,selector:selector}=usePopperContainerId();return onBeforeMount(()=>{isClient&&(document.body.querySelector(selector.value)||(id=>{const container=document.createElement("div");container.id=id,document.body.appendChild(container)})(id.value))}),{id:id,selector:selector}},useDelayedToggleProps=buildProps({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),FORWARD_REF_INJECTION_KEY=/* @__PURE__ */Symbol("elForwardRef"),initial={current:0},zIndex=ref(0),ZINDEX_INJECTION_KEY=/* @__PURE__ */Symbol("elZIndexContextKey"),zIndexContextKey=/* @__PURE__ */Symbol("zIndexContextKey"),useZIndex=zIndexOverrides=>{const increasingInjection=getCurrentInstance()?inject(ZINDEX_INJECTION_KEY,initial):initial,zIndexInjection=zIndexOverrides||(getCurrentInstance()?inject(zIndexContextKey,void 0):void 0),initialZIndex=computed(()=>{const zIndexFromInjection=unref(zIndexInjection);return isNumber(zIndexFromInjection)?zIndexFromInjection:2e3}),currentZIndex=computed(()=>initialZIndex.value+zIndex.value);return isClient||inject(ZINDEX_INJECTION_KEY)||debugWarn("ZIndexInjection","Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed\nusage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })"),{initialZIndex:initialZIndex,currentZIndex:currentZIndex,nextZIndex:()=>(increasingInjection.current++,zIndex.value=increasingInjection.current,currentZIndex.value)}};const useSizeProp=buildProp({type:String,values:["","default","small","large"],required:!1}),SIZE_INJECTION_KEY=/* @__PURE__ */Symbol("size");const emptyValuesContextKey=/* @__PURE__ */Symbol("emptyValuesContextKey"),useEmptyValuesProps=buildProps({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:val=>(val=isFunction$1(val)?val():val,isArray$1(val)?val.every(item=>!item):!val)}}),ariaProps=buildProps({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),useAriaProps=arias=>pick(ariaProps,arias),withPropsDefaultsSetter=target=>{const _p=target.props,props=isArray$1(_p)?fromPairs(_p.map(key=>[key,{}])):_p;target.setPropsDefaults=defaults=>{if(props){for(const[key,value]of Object.entries(defaults)){const prop=props[key];hasOwn(props,key)&&(isPlainObject(prop)?props[key]={...prop,default:value}:props[key]={type:prop,default:value})}target.props=props}}},withInstall=(main,extra)=>{if(main.install=app=>{for(const comp of[main,...Object.values(extra??{})])app.component(comp.name,comp)},extra)for(const[key,comp]of Object.entries(extra))main[key]=comp;return withPropsDefaultsSetter(main),main},withNoopInstall=component=>(component.install=NOOP,withPropsDefaultsSetter(component),component);const ElTeleport=withInstall(/* @__PURE__ */defineComponent({__name:"teleport",props:teleportProps,setup:__props=>(_ctx,_cache)=>_ctx.disabled?renderSlot(_ctx.$slots,"default",{key:0}):(openBlock(),createBlock(Teleport,{key:1,to:_ctx.to},[renderSlot(_ctx.$slots,"default")],8,["to"]))}));var arrow_down_default=/* @__PURE__ */defineComponent({name:"ArrowDown",__name:"arrow-down",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),circle_check_default=/* @__PURE__ */defineComponent({name:"CircleCheck",__name:"circle-check",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),circle_close_filled_default=/* @__PURE__ */defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),circle_close_default=/* @__PURE__ */defineComponent({name:"CircleClose",__name:"circle-close",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),close_default=/* @__PURE__ */defineComponent({name:"Close",__name:"close",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),hide_default=/* @__PURE__ */defineComponent({name:"Hide",__name:"hide",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),info_filled_default=/* @__PURE__ */defineComponent({name:"InfoFilled",__name:"info-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),loading_default=/* @__PURE__ */defineComponent({name:"Loading",__name:"loading",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),success_filled_default=/* @__PURE__ */defineComponent({name:"SuccessFilled",__name:"success-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),view_default=/* @__PURE__ */defineComponent({name:"View",__name:"view",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),warning_filled_default=/* @__PURE__ */defineComponent({name:"WarningFilled",__name:"warning-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))});const iconPropType=[String,Object,Function],TypeComponents={Close:close_default,SuccessFilled:success_filled_default,InfoFilled:info_filled_default,WarningFilled:warning_filled_default,CircleCloseFilled:circle_close_filled_default},TypeComponentsMap={primary:info_filled_default,success:success_filled_default,warning:warning_filled_default,error:circle_close_filled_default,info:info_filled_default},ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default};const ElIcon=withInstall(/* @__PURE__ */defineComponent({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:buildProps({size:{type:[Number,String]},color:{type:String}}),setup(__props){const props=__props,ns=useNamespace("icon"),style=computed(()=>{const{size:size,color:color}=props,fontSize=addUnit(size);return fontSize||color?{fontSize:fontSize,"--color":color}:{}});return(_ctx,_cache)=>(openBlock(),createElementBlock("i",mergeProps({class:unref(ns).b(),style:style.value},_ctx.$attrs),[renderSlot(_ctx.$slots,"default")],16))}})),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),POPPER_INJECTION_KEY=/* @__PURE__ */Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=/* @__PURE__ */Symbol("popperContent");var arrow_default=/* @__PURE__ */defineComponent({name:"ElPopperArrow",inheritAttrs:!1,__name:"arrow",setup(__props,{expose:__expose}){const ns=useNamespace("popper"),{arrowRef:arrowRef,arrowStyle:arrowStyle}=inject(POPPER_CONTENT_INJECTION_KEY,void 0);return onBeforeUnmount(()=>{arrowRef.value=void 0}),__expose({arrowRef:arrowRef}),(_ctx,_cache)=>(openBlock(),createElementBlock("span",{ref_key:"arrowRef",ref:arrowRef,class:normalizeClass(unref(ns).e("arrow")),style:normalizeStyle(unref(arrowStyle)),"data-popper-arrow":""},null,6))}});const popperTriggerProps=buildProps({virtualRef:{type:Object},virtualTriggering:Boolean,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onContextmenu:{type:Function},id:String,open:Boolean}),NAME="ElOnlyChild",OnlyChild=/* @__PURE__ */defineComponent({name:NAME,setup(_,{slots:slots,attrs:attrs}){const forwardRefDirective=(setForwardRef=inject(FORWARD_REF_INJECTION_KEY)?.setForwardRef??NOOP,{mounted(el){setForwardRef(el)},updated(el){setForwardRef(el)},unmounted(){setForwardRef(null)}});var setForwardRef;return()=>{const defaultSlot=slots.default?.(attrs);if(!defaultSlot)return null;const[firstLegitNode,length]=findFirstLegitChild(defaultSlot);return firstLegitNode?(length>1&&debugWarn(NAME,"requires exact only one valid child."),withDirectives(cloneVNode(firstLegitNode,attrs),[[forwardRefDirective]])):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(node){if(!node)return[null,0];const children=node,len=children.filter(c=>c.type!==Comment).length;for(const child of children){if(isObject$2(child))switch(child.type){case Comment:continue;case Text:case"svg":return[wrapTextContent(child),len];case Fragment:return findFirstLegitChild(child.children);default:return[child,len]}return[wrapTextContent(child),len]}return[null,0]}function wrapTextContent(s){const ns=useNamespace("only-child");return createVNode("span",{class:ns.e("content")},[s])}var trigger_default$1=/* @__PURE__ */defineComponent({name:"ElPopperTrigger",inheritAttrs:!1,__name:"trigger",props:popperTriggerProps,setup(__props,{expose:__expose}){const props=__props,{role:role,triggerRef:triggerRef}=inject(POPPER_INJECTION_KEY,void 0);var forwardRef;forwardRef=triggerRef,provide(FORWARD_REF_INJECTION_KEY,{setForwardRef:el=>{forwardRef.value=el}});const ariaControls=computed(()=>ariaHaspopup.value?props.id:void 0),ariaDescribedby=computed(()=>{if(role&&"tooltip"===role.value)return props.open&&props.id?props.id:void 0}),ariaHaspopup=computed(()=>{if(role&&"tooltip"!==role.value)return role.value}),ariaExpanded=computed(()=>ariaHaspopup.value?`${props.open}`:void 0);let virtualTriggerAriaStopWatch;const TRIGGER_ELE_EVENTS=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return onMounted(()=>{watch(()=>props.virtualRef,virtualEl=>{virtualEl&&(triggerRef.value=unrefElement(virtualEl))},{immediate:!0}),watch(triggerRef,(el,prevEl)=>{virtualTriggerAriaStopWatch?.(),virtualTriggerAriaStopWatch=void 0,isElement(prevEl)&&TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&prevEl.removeEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),isElement(el)&&(TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&el.addEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),isFocusable(el)&&(virtualTriggerAriaStopWatch=watch([ariaControls,ariaDescribedby,ariaHaspopup,ariaExpanded],watches=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((key,idx)=>{isNil(watches[idx])?el.removeAttribute(key):el.setAttribute(key,watches[idx])})},{immediate:!0}))),isElement(prevEl)&&isFocusable(prevEl)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(key=>prevEl.removeAttribute(key))},{immediate:!0})}),onBeforeUnmount(()=>{if(virtualTriggerAriaStopWatch?.(),virtualTriggerAriaStopWatch=void 0,triggerRef.value&&isElement(triggerRef.value)){const el=triggerRef.value;TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&el.removeEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),triggerRef.value=void 0}}),__expose({triggerRef:triggerRef}),(_ctx,_cache)=>__props.virtualTriggering?createCommentVNode("v-if",!0):(openBlock(),createBlock(unref(OnlyChild),mergeProps({key:0},_ctx.$attrs,{"aria-controls":ariaControls.value,"aria-describedby":ariaDescribedby.value,"aria-expanded":ariaExpanded.value,"aria-haspopup":ariaHaspopup.value}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Array,default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:Object,default:()=>({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,...popperArrowProps,id:String,style:{type:[String,Array,Object]},className:{type:[String,Array,Object]},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:[String,Array,Object]},popperStyle:{type:[String,Array,Object]},referenceEl:{type:Object},triggerTargetEl:{type:Object},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...useAriaProps(["ariaLabel"]),loop:Boolean}),popperContentEmits={mouseenter:evt=>evt instanceof MouseEvent,mouseleave:evt=>evt instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},formContextKey=/* @__PURE__ */Symbol("formContextKey"),formItemContextKey=/* @__PURE__ */Symbol("formItemContextKey"),useFormSize=(fallback,ignore={})=>{const emptyRef=ref(void 0),size=ignore.prop?emptyRef:useProp("size"),globalConfig2=ignore.global?emptyRef:(()=>{const injectedSize=inject(SIZE_INJECTION_KEY,{});return computed(()=>unref(injectedSize.size)||"")})(),form=ignore.form?{size:void 0}:inject(formContextKey,void 0),formItem=ignore.formItem?{size:void 0}:inject(formItemContextKey,void 0);return computed(()=>size.value||unref(fallback)||formItem?.size||form?.size||globalConfig2.value||"")},useFormDisabled=fallback=>{const disabled=useProp("disabled"),form=inject(formContextKey,void 0);return computed(()=>disabled.value??unref(fallback)??form?.disabled??!1)},useFormItem=()=>({form:inject(formContextKey,void 0),formItem:inject(formItemContextKey,void 0)}),useFormItemInputId=(props,{formItemContext:formItemContext,disableIdGeneration:disableIdGeneration,disableIdManagement:disableIdManagement})=>{disableIdGeneration||(disableIdGeneration=ref(!1)),disableIdManagement||(disableIdManagement=ref(!1));const instance=getCurrentInstance(),inputId=ref();let idUnwatch;const isLabeledByFormItem=computed(()=>!!(!props.label&&!props.ariaLabel&&formItemContext&&formItemContext.inputIds&&formItemContext.inputIds?.length<=1));return onMounted(()=>{idUnwatch=watch([toRef(props,"id"),disableIdGeneration],([id,disableIdGeneration2])=>{const newId=id??(disableIdGeneration2?void 0:useId().value);newId!==inputId.value&&(formItemContext?.removeInputId&&!(()=>{let parent2=instance?.parent;for(;parent2;){if("ElFormItem"===parent2.type.name)return!1;if("ElLabelWrap"===parent2.type.name)return!0;parent2=parent2.parent}return!1})()&&(inputId.value&&formItemContext.removeInputId(inputId.value),disableIdManagement?.value||disableIdGeneration2||!newId||formItemContext.addInputId(newId)),inputId.value=newId)},{immediate:!0})}),onUnmounted(()=>{idUnwatch&&idUnwatch(),formItemContext?.removeInputId&&inputId.value&&formItemContext.removeInputId(inputId.value)}),{isLabeledByFormItem:isLabeledByFormItem,inputId:inputId}},FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},FOCUS_TRAP_INJECTION_KEY=/* @__PURE__ */Symbol("elFocusTrap"),focusReason=ref(),lastUserFocusTimestamp=ref(0),lastAutomatedFocusTimestamp=ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=element=>{const nodes=[],walker=document.createTreeWalker(element,NodeFilter.SHOW_ELEMENT,{acceptNode:node=>{const isHiddenInput="INPUT"===node.tagName&&"hidden"===node.type;return node.disabled||node.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node.tabIndex>=0||node===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes},getVisibleElement=(elements,container)=>{for(const element of elements)if(!isHidden(element,container))return element},isHidden=(element,container)=>{if("hidden"===getComputedStyle(element).visibility)return!0;for(;element;){if(container&&element===container)return!1;if("none"===getComputedStyle(element).display)return!0;element=element.parentElement}return!1},tryFocus=(element,shouldSelect)=>{if(element){const prevFocusedElement=document.activeElement;focusElement(element,{preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),element!==prevFocusedElement&&(element=>element instanceof HTMLInputElement&&"select"in element)(element)&&shouldSelect&&element.select()}};function removeFromStack(list,item){const copy=[...list],idx=list.indexOf(item);return-1!==idx&©.splice(idx,1),copy}const focusableStack=(()=>{let stack=[];return{push:layer=>{const currentLayer=stack[0];currentLayer&&layer!==currentLayer&¤tLayer.pause(),stack=removeFromStack(stack,layer),stack.unshift(layer)},remove:layer=>{stack=removeFromStack(stack,layer),stack[0]?.resume?.()}}})(),notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},createFocusOutPreventedEvent=detail=>new CustomEvent("focus-trap.focusout-prevented",{...FOCUSOUT_PREVENTED_OPTS,detail:detail});var _plugin_vue_export_helper_default=(sfc,props)=>{const target=sfc.__vccOpts||sfc;for(const[key,val]of props)target[key]=val;return target};var focus_trap_default$1=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:["focusAfterTrapped","focusAfterReleased","focusin","focusout","focusout-prevented","release-requested"],setup(props,{emit:emit}){const forwardRef=ref();let lastFocusBeforeTrapped,lastFocusAfterTrapped;const{focusReason:focusReason2}=(onMounted(()=>{0===focusReasonUserCount&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason:focusReason,lastUserFocusTimestamp:lastUserFocusTimestamp,lastAutomatedFocusTimestamp:lastAutomatedFocusTimestamp});var handler;handler=event=>{props.trapped&&!focusLayer.paused&&emit("release-requested",event)},onMounted(()=>{0===registeredEscapeHandlers.length&&document.addEventListener("keydown",cachedHandler),isClient&®isteredEscapeHandlers.push(handler)}),onBeforeUnmount(()=>{registeredEscapeHandlers=registeredEscapeHandlers.filter(registeredHandler=>registeredHandler!==handler),0===registeredEscapeHandlers.length&&isClient&&document.removeEventListener("keydown",cachedHandler)});const focusLayer={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},onKeydown=e=>{if(!props.loop&&!props.trapped)return;if(focusLayer.paused)return;const{altKey:altKey,ctrlKey:ctrlKey,metaKey:metaKey,currentTarget:currentTarget,shiftKey:shiftKey}=e,{loop:loop}=props,isTabbing=getEventCode(e)===EVENT_CODE.tab&&!altKey&&!ctrlKey&&!metaKey,currentFocusingEl=document.activeElement;if(isTabbing&¤tFocusingEl){const container=currentTarget,[first,last2]=(container=>{const focusable=obtainAllFocusableElements(container);return[getVisibleElement(focusable,container),getVisibleElement(focusable.reverse(),container)]})(container);if(first&&last2)if(shiftKey||currentFocusingEl!==last2){if(shiftKey&&[first,container].includes(currentFocusingEl)){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||(e.preventDefault(),loop&&tryFocus(last2,!0))}}else{const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||(e.preventDefault(),loop&&tryFocus(first,!0))}else if(currentFocusingEl===container){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||e.preventDefault()}}};provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:forwardRef,onKeydown:onKeydown}),watch(()=>props.focusTrapEl,focusTrapEl=>{focusTrapEl&&(forwardRef.value=focusTrapEl)},{immediate:!0}),watch([forwardRef],([forwardRef2],[oldForwardRef])=>{forwardRef2&&(forwardRef2.addEventListener("keydown",onKeydown),forwardRef2.addEventListener("focusin",onFocusIn),forwardRef2.addEventListener("focusout",onFocusOut)),oldForwardRef&&(oldForwardRef.removeEventListener("keydown",onKeydown),oldForwardRef.removeEventListener("focusin",onFocusIn),oldForwardRef.removeEventListener("focusout",onFocusOut))});const trapOnFocus=e=>{emit("focusAfterTrapped",e)},releaseOnFocus=e=>emit("focusAfterReleased",e),onFocusIn=e=>{const trapContainer=unref(forwardRef);if(!trapContainer)return;const target=e.target,relatedTarget=e.relatedTarget,isFocusedInTrap=target&&trapContainer.contains(target);props.trapped||relatedTarget&&trapContainer.contains(relatedTarget)||(lastFocusBeforeTrapped=relatedTarget),isFocusedInTrap&&emit("focusin",e),focusLayer.paused||props.trapped&&(isFocusedInTrap?lastFocusAfterTrapped=target:tryFocus(lastFocusAfterTrapped,!0))},onFocusOut=e=>{const trapContainer=unref(forwardRef);if(!focusLayer.paused&&trapContainer)if(props.trapped){const relatedTarget=e.relatedTarget;isNil(relatedTarget)||trapContainer.contains(relatedTarget)||setTimeout(()=>{if(!focusLayer.paused&&props.trapped){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||tryFocus(lastFocusAfterTrapped,!0)}},0)}else{const target=e.target;target&&trapContainer.contains(target)||emit("focusout",e)}};async function startTrap(){await nextTick();const trapContainer=unref(forwardRef);if(trapContainer){focusableStack.push(focusLayer);const prevFocusedElement=trapContainer.contains(document.activeElement)?lastFocusBeforeTrapped:document.activeElement;if(lastFocusBeforeTrapped=prevFocusedElement,!trapContainer.contains(prevFocusedElement)){const focusEvent=new Event("focus-trap.focus-after-trapped",FOCUS_AFTER_TRAPPED_OPTS);trapContainer.addEventListener("focus-trap.focus-after-trapped",trapOnFocus),trapContainer.dispatchEvent(focusEvent),focusEvent.defaultPrevented||nextTick(()=>{let focusStartEl=props.focusStartEl;isString(focusStartEl)||(tryFocus(focusStartEl),document.activeElement!==focusStartEl&&(focusStartEl="first")),"first"===focusStartEl&&((elements,shouldSelect=!1)=>{const prevFocusedElement=document.activeElement;for(const element of elements)if(tryFocus(element,shouldSelect),document.activeElement!==prevFocusedElement)return})(obtainAllFocusableElements(trapContainer),!0),document.activeElement!==prevFocusedElement&&"container"!==focusStartEl||tryFocus(trapContainer)})}}}function stopTrap(){const trapContainer=unref(forwardRef);if(trapContainer){trapContainer.removeEventListener("focus-trap.focus-after-trapped",trapOnFocus);const releasedEvent=new CustomEvent("focus-trap.focus-after-released",{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:focusReason2.value}});trapContainer.addEventListener("focus-trap.focus-after-released",releaseOnFocus),trapContainer.dispatchEvent(releasedEvent),releasedEvent.defaultPrevented||"keyboard"!=focusReason2.value&&lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value&&!trapContainer.contains(document.activeElement)||tryFocus(lastFocusBeforeTrapped??document.body),trapContainer.removeEventListener("focus-trap.focus-after-released",releaseOnFocus),focusableStack.remove(focusLayer),lastFocusBeforeTrapped=null,lastFocusAfterTrapped=null}}return onMounted(()=>{props.trapped&&startTrap(),watch(()=>props.trapped,trapped=>{trapped?startTrap():stopTrap()})}),onBeforeUnmount(()=>{props.trapped&&stopTrap(),forwardRef.value&&(forwardRef.value.removeEventListener("keydown",onKeydown),forwardRef.value.removeEventListener("focusin",onFocusIn),forwardRef.value.removeEventListener("focusout",onFocusOut),forwardRef.value=void 0),lastFocusBeforeTrapped=null,lastFocusAfterTrapped=null}),{onKeydown:onKeydown}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default",{handleKeydown:_ctx.onKeydown})}]]);const buildPopperOptions=(props,modifiers=[])=>{const{placement:placement,strategy:strategy,popperOptions:popperOptions}=props,options={placement:placement,strategy:strategy,...popperOptions,modifiers:[...genModifiers(props),...modifiers]};return function(options,modifiers){modifiers&&(options.modifiers=[...options.modifiers,...modifiers??[]])}(options,popperOptions?.modifiers),options};function genModifiers(options){const{offset:offset,gpuAcceleration:gpuAcceleration,fallbackPlacements:fallbackPlacements}=options;return[{name:"offset",options:{offset:[0,offset??12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:fallbackPlacements}},{name:"computeStyles",options:{gpuAcceleration:gpuAcceleration}}]}const usePopperContent=props=>{const{popperInstanceRef:popperInstanceRef,contentRef:contentRef,triggerRef:triggerRef,role:role}=inject(POPPER_INJECTION_KEY,void 0),arrowRef=ref(),arrowOffset=computed(()=>props.arrowOffset),eventListenerModifier=computed(()=>({name:"eventListeners",enabled:!!props.visible})),arrowModifier=computed(()=>{const arrowEl=unref(arrowRef),offset=unref(arrowOffset)??0;return{name:"arrow",enabled:(value=arrowEl,!(void 0===value)),options:{element:arrowEl,padding:offset}};var value}),options=computed(()=>({onFirstUpdate:()=>{update()},...buildPopperOptions(props,[unref(arrowModifier),unref(eventListenerModifier)])})),computedReference=computed(()=>($el=>{if(isClient)return unrefElement($el)})(props.referenceEl)||unref(triggerRef)),{attributes:attributes,state:state,styles:styles,update:update,forceUpdate:forceUpdate,instanceRef:instanceRef}=usePopper(computedReference,contentRef,options);return watch(instanceRef,instance=>popperInstanceRef.value=instance,{flush:"sync"}),onMounted(()=>{watch(()=>unref(computedReference)?.getBoundingClientRect?.(),()=>{update()})}),onBeforeUnmount(()=>{popperInstanceRef.value=void 0}),{attributes:attributes,arrowRef:arrowRef,contentRef:contentRef,instanceRef:instanceRef,state:state,styles:styles,role:role,forceUpdate:forceUpdate,update:update}};var content_default$1=/* @__PURE__ */defineComponent({name:"ElPopperContent",__name:"content",props:popperContentProps,emits:popperContentEmits,setup(__props,{expose:__expose,emit:__emit}){const emit=__emit,props=__props,{focusStartRef:focusStartRef,trapped:trapped,onFocusAfterReleased:onFocusAfterReleased,onFocusAfterTrapped:onFocusAfterTrapped,onFocusInTrap:onFocusInTrap,onFocusoutPrevented:onFocusoutPrevented,onReleaseRequested:onReleaseRequested}=((props,emit)=>{const trapped=ref(!1),focusStartRef=ref();return onBeforeUnmount(()=>{focusStartRef.value=void 0}),{focusStartRef:focusStartRef,trapped:trapped,onFocusAfterReleased:event=>{"pointer"!==event.detail?.focusReason&&(focusStartRef.value="first",emit("blur"))},onFocusAfterTrapped:()=>{emit("focus")},onFocusInTrap:event=>{props.visible&&!trapped.value&&(event.target&&(focusStartRef.value=event.target),trapped.value=!0)},onFocusoutPrevented:event=>{props.trapping||("pointer"===event.detail.focusReason&&event.preventDefault(),trapped.value=!1)},onReleaseRequested:()=>{trapped.value=!1,emit("close")}}})(props,emit),{attributes:attributes,arrowRef:arrowRef,contentRef:contentRef,styles:styles,instanceRef:instanceRef,role:role,update:update}=usePopperContent(props),{ariaModal:ariaModal,arrowStyle:arrowStyle,contentAttrs:contentAttrs,contentClass:contentClass,contentStyle:contentStyle,updateZIndex:updateZIndex}=((props,{attributes:attributes,styles:styles,role:role})=>{const{nextZIndex:nextZIndex}=useZIndex(),ns=useNamespace("popper"),contentAttrs=computed(()=>unref(attributes).popper),contentZIndex=ref(isNumber(props.zIndex)?props.zIndex:nextZIndex()),contentClass=computed(()=>[ns.b(),ns.is("pure",props.pure),ns.is(props.effect),props.popperClass]),contentStyle=computed(()=>[{zIndex:unref(contentZIndex)},unref(styles).popper,props.popperStyle||{}]);return{ariaModal:computed(()=>"dialog"===role.value?"false":void 0),arrowStyle:computed(()=>unref(styles).arrow||{}),contentAttrs:contentAttrs,contentClass:contentClass,contentStyle:contentStyle,contentZIndex:contentZIndex,updateZIndex:()=>{contentZIndex.value=isNumber(props.zIndex)?props.zIndex:nextZIndex()}}})(props,{styles:styles,attributes:attributes,role:role}),formItemContext=inject(formItemContextKey,void 0);let triggerTargetAriaStopWatch;provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:arrowStyle,arrowRef:arrowRef}),formItemContext&&provide(formItemContextKey,{...formItemContext,addInputId:NOOP,removeInputId:NOOP});const updatePopper=(shouldUpdateZIndex=!0)=>{update(),shouldUpdateZIndex&&updateZIndex()},togglePopperAlive=()=>{updatePopper(!1),props.visible&&props.focusOnShow?trapped.value=!0:!1===props.visible&&(trapped.value=!1)};return onMounted(()=>{watch(()=>props.triggerTargetEl,(triggerTargetEl,prevTriggerTargetEl)=>{triggerTargetAriaStopWatch?.(),triggerTargetAriaStopWatch=void 0;const el=unref(triggerTargetEl||contentRef.value),prevEl=unref(prevTriggerTargetEl||contentRef.value);isElement(el)&&(triggerTargetAriaStopWatch=watch([role,()=>props.ariaLabel,ariaModal,()=>props.id],watches=>{["role","aria-label","aria-modal","id"].forEach((key,idx)=>{isNil(watches[idx])?el.removeAttribute(key):el.setAttribute(key,watches[idx])})},{immediate:!0})),prevEl!==el&&isElement(prevEl)&&["role","aria-label","aria-modal","id"].forEach(key=>{prevEl.removeAttribute(key)})},{immediate:!0}),watch(()=>props.visible,togglePopperAlive,{immediate:!0})}),onBeforeUnmount(()=>{triggerTargetAriaStopWatch?.(),triggerTargetAriaStopWatch=void 0,contentRef.value=void 0}),__expose({popperContentRef:contentRef,popperInstanceRef:instanceRef,updatePopper:updatePopper,contentStyle:contentStyle}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",mergeProps({ref_key:"contentRef",ref:contentRef},unref(contentAttrs),{style:unref(contentStyle),class:unref(contentClass),tabindex:"-1",onMouseenter:_cache[0]||(_cache[0]=e=>_ctx.$emit("mouseenter",e)),onMouseleave:_cache[1]||(_cache[1]=e=>_ctx.$emit("mouseleave",e))}),[createVNode(unref(focus_trap_default$1),{loop:__props.loop,trapped:unref(trapped),"trap-on-focus-in":!0,"focus-trap-el":unref(contentRef),"focus-start-el":unref(focusStartRef),onFocusAfterTrapped:unref(onFocusAfterTrapped),onFocusAfterReleased:unref(onFocusAfterReleased),onFocusin:unref(onFocusInTrap),onFocusoutPrevented:unref(onFocusoutPrevented),onReleaseRequested:unref(onReleaseRequested)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["loop","trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});const ElPopper=withInstall(/* @__PURE__ */defineComponent({name:"ElPopper",inheritAttrs:!1,__name:"popper",props:popperProps,setup(__props,{expose:__expose}){const props=__props,popperProvides={triggerRef:ref(),popperInstanceRef:ref(),contentRef:ref(),referenceRef:ref(),role:computed(()=>props.role)};return __expose(popperProvides),provide(POPPER_INJECTION_KEY,popperProvides),(_ctx,_cache)=>renderSlot(_ctx.$slots,"default")}})),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:teleportProps.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Boolean,default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...useAriaProps(["ariaLabel"])}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:[String,Array],default:"hover"},triggerKeys:{type:Array,default:()=>[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space]},focusOnTarget:Boolean}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=(name=>{const updateEventKey=`update:${name}`,updateEventKeyRaw=`onUpdate:${name}`,useModelToggleEmits=[updateEventKey];return{useModelToggle:({indicator:indicator,toggleReason:toggleReason,shouldHideWhenRouteChanges:shouldHideWhenRouteChanges,shouldProceed:shouldProceed,onShow:onShow,onHide:onHide})=>{const instance=getCurrentInstance(),{emit:emit}=instance,props=instance.props,hasUpdateHandler=computed(()=>isFunction$1(props[updateEventKeyRaw])),isModelBindingAbsent=computed(()=>null===props[name]),doShow=event=>{!0!==indicator.value&&(indicator.value=!0,toggleReason&&(toggleReason.value=event),isFunction$1(onShow)&&onShow(event))},doHide=event=>{!1!==indicator.value&&(indicator.value=!1,toggleReason&&(toggleReason.value=event),isFunction$1(onHide)&&onHide(event))},show=event=>{if(!0===props.disabled||isFunction$1(shouldProceed)&&!shouldProceed())return;const shouldEmit=hasUpdateHandler.value&&isClient;shouldEmit&&emit(updateEventKey,!0),!isModelBindingAbsent.value&&shouldEmit||doShow(event)},hide=event=>{if(!0===props.disabled||!isClient)return;const shouldEmit=hasUpdateHandler.value&&isClient;shouldEmit&&emit(updateEventKey,!1),!isModelBindingAbsent.value&&shouldEmit||doHide(event)},onChange=val=>{isBoolean(val)&&(props.disabled&&val?hasUpdateHandler.value&&emit(updateEventKey,!1):indicator.value!==val&&(val?doShow():doHide()))};return watch(()=>props[name],onChange),shouldHideWhenRouteChanges&&void 0!==instance.appContext.config.globalProperties.$route&&watch(()=>({...instance.proxy.$route}),()=>{shouldHideWhenRouteChanges.value&&indicator.value&&hide()}),onMounted(()=>{onChange(props[name])}),{hide:hide,show:show,toggle:()=>{indicator.value?hide():show()},hasUpdateHandler:hasUpdateHandler}},useModelToggleProps:{[name]:_prop,[updateEventKeyRaw]:_event},useModelToggleEmits:useModelToggleEmits}})("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],TOOLTIP_INJECTION_KEY=/* @__PURE__ */Symbol("elTooltip"),isTriggerType=(trigger,type)=>isArray$1(trigger)?trigger.includes(type):trigger===type,whenTrigger=(trigger,type,handler)=>e=>{isTriggerType(unref(trigger),type)&&handler(e)};var trigger_default=/* @__PURE__ */defineComponent({name:"ElTooltipTrigger",__name:"trigger",props:useTooltipTriggerProps,setup(__props,{expose:__expose}){const props=__props,ns=useNamespace("tooltip"),{controlled:controlled,id:id,open:open,onOpen:onOpen,onClose:onClose,onToggle:onToggle}=inject(TOOLTIP_INJECTION_KEY,void 0),triggerRef=ref(null),stopWhenControlledOrDisabled=()=>{if(unref(controlled)||props.disabled)return!0},trigger=toRef(props,"trigger"),onMouseenter=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"hover",e=>{onOpen(e),props.focusOnTarget&&e.target&&nextTick(()=>{focusElement(e.target,{preventScroll:!0})})})),onMouseleave=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"hover",onClose)),onClick=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"click",e=>{0===e.button&&onToggle(e)})),onFocus=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"focus",onOpen)),onBlur=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"focus",onClose)),onContextMenu=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"contextmenu",e=>{e.preventDefault(),onToggle(e)})),onKeydown=composeEventHandlers(stopWhenControlledOrDisabled,e=>{const code=getEventCode(e);props.triggerKeys.includes(code)&&(e.preventDefault(),onToggle(e))});return __expose({triggerRef:triggerRef}),(_ctx,_cache)=>(openBlock(),createBlock(unref(trigger_default$1),{id:unref(id),"virtual-ref":__props.virtualRef,open:unref(open),"virtual-triggering":__props.virtualTriggering,class:normalizeClass(unref(ns).e("trigger")),onBlur:unref(onBlur),onClick:unref(onClick),onContextmenu:unref(onContextMenu),onFocus:unref(onFocus),onMouseenter:unref(onMouseenter),onMouseleave:unref(onMouseleave),onKeydown:unref(onKeydown)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}}),content_vue_vue_type_script_setup_true_lang_default=/* @__PURE__ */defineComponent({name:"ElTooltipContent",inheritAttrs:!1,__name:"content",props:useTooltipContentProps,setup(__props,{expose:__expose}){const props=__props,{selector:selector}=usePopperContainerId(),ns=useNamespace("tooltip"),contentRef=ref(),popperContentRef=computedEager(()=>contentRef.value?.popperContentRef);let stopHandle;const{controlled:controlled,id:id,open:open,trigger:trigger,onClose:onClose,onOpen:onOpen,onShow:onShow,onHide:onHide,onBeforeShow:onBeforeShow,onBeforeHide:onBeforeHide}=inject(TOOLTIP_INJECTION_KEY,void 0),transitionClass=computed(()=>props.transition||`${ns.namespace.value}-fade-in-linear`),persistentRef=computed(()=>props.persistent);onBeforeUnmount(()=>{stopHandle?.()});const shouldRender=computed(()=>!!unref(persistentRef)||unref(open)),shouldShow=computed(()=>!props.disabled&&unref(open)),appendTo=computed(()=>props.appendTo||selector.value),contentStyle=computed(()=>props.style??{}),ariaHidden=ref(!0),onTransitionLeave=()=>{onHide(),isFocusInsideContent()&&focusElement(document.body,{preventScroll:!0}),ariaHidden.value=!0},stopWhenControlled=()=>{if(unref(controlled))return!0},onContentEnter=composeEventHandlers(stopWhenControlled,()=>{props.enterable&&isTriggerType(unref(trigger),"hover")&&onOpen()}),onContentLeave=composeEventHandlers(stopWhenControlled,()=>{isTriggerType(unref(trigger),"hover")&&onClose()}),onBeforeEnter=()=>{contentRef.value?.updatePopper?.(),onBeforeShow?.()},onBeforeLeave=()=>{onBeforeHide?.()},onAfterShow=()=>{onShow()},onBlur=()=>{props.virtualTriggering||onClose()},isFocusInsideContent=event=>{const popperContent=contentRef.value?.popperContentRef,activeElement=event?.relatedTarget||document.activeElement;return popperContent?.contains(activeElement)};return watch(()=>unref(open),val=>{val?(ariaHidden.value=!1,stopHandle=onClickOutside(popperContentRef,()=>{var arr;unref(controlled)||(arr=unref(trigger),arr||0===arr?isArray$1(arr)?arr:[arr]:[]).every(item=>"hover"!==item&&"focus"!==item)&&onClose()},{detectIframe:!0})):stopHandle?.()},{flush:"post"}),watch(()=>props.content,()=>{contentRef.value?.updatePopper?.()}),__expose({contentRef:contentRef,isFocusInsideContent:isFocusInsideContent}),(_ctx,_cache)=>(openBlock(),createBlock(unref(ElTeleport),{disabled:!__props.teleported,to:appendTo.value},{default:withCtx(()=>[shouldRender.value||!ariaHidden.value?(openBlock(),createBlock(Transition,{key:0,name:transitionClass.value,appear:!persistentRef.value,onAfterLeave:onTransitionLeave,onBeforeEnter:onBeforeEnter,onAfterEnter:onAfterShow,onBeforeLeave:onBeforeLeave,persisted:""},{default:withCtx(()=>[withDirectives(createVNode(unref(content_default$1),mergeProps({id:unref(id),ref_key:"contentRef",ref:contentRef},_ctx.$attrs,{"aria-label":__props.ariaLabel,"aria-hidden":ariaHidden.value,"boundaries-padding":__props.boundariesPadding,"fallback-placements":__props.fallbackPlacements,"gpu-acceleration":__props.gpuAcceleration,offset:__props.offset,placement:__props.placement,"popper-options":__props.popperOptions,"arrow-offset":__props.arrowOffset,strategy:__props.strategy,effect:__props.effect,enterable:__props.enterable,pure:__props.pure,"popper-class":__props.popperClass,"popper-style":[__props.popperStyle,contentStyle.value],"reference-el":__props.referenceEl,"trigger-target-el":__props.triggerTargetEl,visible:shouldShow.value,"z-index":__props.zIndex,loop:__props.loop,onMouseenter:unref(onContentEnter),onMouseleave:unref(onContentLeave),onBlur:onBlur,onClose:unref(onClose)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","loop","onMouseenter","onMouseleave","onClose"]),[[vShow,shouldShow.value]])]),_:3},8,["name","appear"])):createCommentVNode("v-if",!0)]),_:3},8,["disabled","to"]))}}),content_default=content_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$c=["innerHTML"],_hoisted_2$5={key:1};const ElTooltip=withInstall(/* @__PURE__ */defineComponent({name:"ElTooltip",__name:"tooltip",props:useTooltipProps,emits:tooltipEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit;usePopperContainer();const ns=useNamespace("tooltip"),id=useId(),popperRef=ref(),contentRef=ref(),updatePopper=()=>{const popperComponent=unref(popperRef);popperComponent&&popperComponent.popperInstanceRef?.update()},open=ref(!1),toggleReason=ref(),{show:show,hide:hide,hasUpdateHandler:hasUpdateHandler}=useTooltipModelToggle({indicator:open,toggleReason:toggleReason}),{onOpen:onOpen,onClose:onClose}=(({showAfter:showAfter,hideAfter:hideAfter,autoClose:autoClose,open:open,close:close2})=>{const{registerTimeout:registerTimeout}=useTimeout(),{registerTimeout:registerTimeoutForAutoClose,cancelTimeout:cancelTimeoutForAutoClose}=useTimeout();return{onOpen:(event,delay=unref(showAfter))=>{registerTimeout(()=>{open(event);const _autoClose=unref(autoClose);isNumber(_autoClose)&&_autoClose>0&®isterTimeoutForAutoClose(()=>{close2(event)},_autoClose)},delay)},onClose:(event,delay=unref(hideAfter))=>{cancelTimeoutForAutoClose(),registerTimeout(()=>{close2(event)},delay)}}})({showAfter:toRef(props,"showAfter"),hideAfter:toRef(props,"hideAfter"),autoClose:toRef(props,"autoClose"),open:show,close:hide}),controlled=computed(()=>isBoolean(props.visible)&&!hasUpdateHandler.value),kls=computed(()=>[ns.b(),props.popperClass]);provide(TOOLTIP_INJECTION_KEY,{controlled:controlled,id:id,open:readonly(open),trigger:toRef(props,"trigger"),onOpen:onOpen,onClose:onClose,onToggle:event=>{unref(open)?onClose(event):onOpen(event)},onShow:()=>{emit("show",toggleReason.value)},onHide:()=>{emit("hide",toggleReason.value)},onBeforeShow:()=>{emit("before-show",toggleReason.value)},onBeforeHide:()=>{emit("before-hide",toggleReason.value)},updatePopper:updatePopper}),watch(()=>props.disabled,disabled=>{disabled&&open.value&&(open.value=!1)});return onDeactivated(()=>open.value&&hide()),onBeforeUnmount(()=>{toggleReason.value=void 0}),__expose({popperRef:popperRef,contentRef:contentRef,isFocusInsideContent:event=>contentRef.value?.isFocusInsideContent(event),updatePopper:updatePopper,onOpen:onOpen,onClose:onClose,hide:hide}),(_ctx,_cache)=>(openBlock(),createBlock(unref(ElPopper),{ref_key:"popperRef",ref:popperRef,role:__props.role},{default:withCtx(()=>[createVNode(trigger_default,{disabled:__props.disabled,trigger:__props.trigger,"trigger-keys":__props.triggerKeys,"virtual-ref":__props.virtualRef,"virtual-triggering":__props.virtualTriggering,"focus-on-target":__props.focusOnTarget},{default:withCtx(()=>[_ctx.$slots.default?renderSlot(_ctx.$slots,"default",{key:0}):createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),createVNode(content_default,{ref_key:"contentRef",ref:contentRef,"aria-label":__props.ariaLabel,"boundaries-padding":__props.boundariesPadding,content:__props.content,disabled:__props.disabled,effect:__props.effect,enterable:__props.enterable,"fallback-placements":__props.fallbackPlacements,"hide-after":__props.hideAfter,"gpu-acceleration":__props.gpuAcceleration,offset:__props.offset,persistent:__props.persistent,"popper-class":kls.value,"popper-style":__props.popperStyle,placement:__props.placement,"popper-options":__props.popperOptions,"arrow-offset":__props.arrowOffset,pure:__props.pure,"raw-content":__props.rawContent,"reference-el":__props.referenceEl,"trigger-target-el":__props.triggerTargetEl,"show-after":__props.showAfter,strategy:__props.strategy,teleported:__props.teleported,transition:__props.transition,"virtual-triggering":__props.virtualTriggering,"z-index":__props.zIndex,"append-to":__props.appendTo,loop:__props.loop},{default:withCtx(()=>[renderSlot(_ctx.$slots,"content",{},()=>[__props.rawContent?(openBlock(),createElementBlock("span",{key:0,innerHTML:__props.content},null,8,_hoisted_1$c)):(openBlock(),createElementBlock("span",_hoisted_2$5,toDisplayString(__props.content),1))]),__props.showArrow?(openBlock(),createBlock(unref(arrow_default),{key:0})):createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to","loop"])]),_:3},8,["role"]))}})),inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Object],default:""},modelModifiers:{type:Object,default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:iconPropType,default:circle_close_default},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String],default:()=>({})},autofocus:Boolean,rows:{type:Number,default:2},...useAriaProps(["ariaLabel"]),inputmode:{type:String,default:void 0},name:String}),inputEmits={[UPDATE_MODEL_EVENT]:value=>isString(value),input:value=>isString(value),change:(value,evt)=>isString(value)&&(evt instanceof Event||void 0===evt),focus:evt=>evt instanceof FocusEvent,blur:evt=>evt instanceof FocusEvent,clear:evt=>void 0===evt||evt instanceof MouseEvent,mouseleave:evt=>evt instanceof MouseEvent,mouseenter:evt=>evt instanceof MouseEvent,keydown:evt=>evt instanceof Event,compositionstart:evt=>evt instanceof CompositionEvent,compositionupdate:evt=>evt instanceof CompositionEvent,compositionend:evt=>evt instanceof CompositionEvent};let hiddenTextarea;markRaw(circle_close_default);const HIDDEN_STYLE={height:"0",visibility:"hidden",overflow:isFirefox()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],looseToNumber=val=>{const n=Number.parseFloat(val);return Number.isNaN(n)?val:n};function calcTextareaHeight(targetElement,minRows=1,maxRows){if(!hiddenTextarea){hiddenTextarea=document.createElement("textarea");let hostNode=document.body;!isFirefox()&&targetElement.parentNode&&(hostNode=targetElement.parentNode),hostNode.appendChild(hiddenTextarea)}const{paddingSize:paddingSize,borderSize:borderSize,boxSizing:boxSizing,contextStyle:contextStyle}=function(targetElement){const style=window.getComputedStyle(targetElement),boxSizing=style.getPropertyValue("box-sizing"),paddingSize=Number.parseFloat(style.getPropertyValue("padding-bottom"))+Number.parseFloat(style.getPropertyValue("padding-top")),borderSize=Number.parseFloat(style.getPropertyValue("border-bottom-width"))+Number.parseFloat(style.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(name=>[name,style.getPropertyValue(name)]),paddingSize:paddingSize,borderSize:borderSize,boxSizing:boxSizing}}(targetElement);contextStyle.forEach(([key,value])=>hiddenTextarea?.style.setProperty(key,value)),Object.entries(HIDDEN_STYLE).forEach(([key,value])=>hiddenTextarea?.style.setProperty(key,value,"important")),hiddenTextarea.value=targetElement.value||targetElement.placeholder||"";let height=hiddenTextarea.scrollHeight;const result={};"border-box"===boxSizing?height+=borderSize:"content-box"===boxSizing&&(height-=paddingSize),hiddenTextarea.value="";const singleRowHeight=hiddenTextarea.scrollHeight-paddingSize;if(isNumber(minRows)){let minHeight=singleRowHeight*minRows;"border-box"===boxSizing&&(minHeight=minHeight+paddingSize+borderSize),height=Math.max(minHeight,height),result.minHeight=`${minHeight}px`}if(isNumber(maxRows)){let maxHeight=singleRowHeight*maxRows;"border-box"===boxSizing&&(maxHeight=maxHeight+paddingSize+borderSize),height=Math.min(maxHeight,height)}return result.height=`${height}px`,hiddenTextarea.parentNode?.removeChild(hiddenTextarea),hiddenTextarea=void 0,result}const _hoisted_1$b=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],_hoisted_2$4=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role"];const ElInput=withInstall(/* @__PURE__ */defineComponent({name:"ElInput",inheritAttrs:!1,__name:"input",props:inputProps,emits:inputEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,rawAttrs=useAttrs$1(),attrs=((params={})=>{const{excludeListeners:excludeListeners=!1,excludeKeys:excludeKeys}=params,allExcludeKeys=computed(()=>(excludeKeys?.value||[]).concat(DEFAULT_EXCLUDE_KEYS)),instance=getCurrentInstance();return instance?computed(()=>fromPairs(Object.entries(instance.proxy?.$attrs).filter(([key])=>!(allExcludeKeys.value.includes(key)||excludeListeners&&LISTENER_PREFIX.test(key))))):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),computed(()=>({})))})(),slots=useSlots(),containerKls=computed(()=>["textarea"===props.type?nsTextarea.b():nsInput.b(),nsInput.m(inputSize.value),nsInput.is("disabled",inputDisabled.value),nsInput.is("exceed",inputExceed.value),{[nsInput.b("group")]:slots.prepend||slots.append,[nsInput.m("prefix")]:slots.prefix||props.prefixIcon,[nsInput.m("suffix")]:slots.suffix||props.suffixIcon||props.clearable||props.showPassword,[nsInput.bm("suffix","password-clear")]:showClear.value&&showPwdVisible.value,[nsInput.b("hidden")]:"hidden"===props.type},rawAttrs.class]),wrapperKls=computed(()=>[nsInput.e("wrapper"),nsInput.is("focus",isFocused.value)]),{form:elForm,formItem:elFormItem}=useFormItem(),{inputId:inputId}=useFormItemInputId(props,{formItemContext:elFormItem}),inputSize=useFormSize(),inputDisabled=useFormDisabled(),nsInput=useNamespace("input"),nsTextarea=useNamespace("textarea"),input=shallowRef(),textarea=shallowRef(),hovering=ref(!1),passwordVisible=ref(!1),countStyle=ref(),textareaCalcStyle=shallowRef(props.inputStyle),_ref=computed(()=>input.value||textarea.value),{wrapperRef:wrapperRef,isFocused:isFocused,handleFocus:handleFocus,handleBlur:handleBlur}=function(target,{disabled:disabled,beforeFocus:beforeFocus,afterFocus:afterFocus,beforeBlur:beforeBlur,afterBlur:afterBlur}={}){const{emit:emit}=getCurrentInstance(),wrapperRef=shallowRef(),isFocused=ref(!1),handleFocus=event=>{const cancelFocus=!!isFunction$1(beforeFocus)&&beforeFocus(event);unref(disabled)||isFocused.value||cancelFocus||(isFocused.value=!0,emit("focus",event),afterFocus?.())},handleBlur=event=>{const cancelBlur=!!isFunction$1(beforeBlur)&&beforeBlur(event);unref(disabled)||event.relatedTarget&&wrapperRef.value?.contains(event.relatedTarget)||cancelBlur||(isFocused.value=!1,emit("blur",event),afterBlur?.())};return watch([wrapperRef,()=>unref(disabled)],([el,disabled2])=>{el&&(disabled2?el.removeAttribute("tabindex"):el.setAttribute("tabindex","-1"))}),useEventListener(wrapperRef,"focus",handleFocus,!0),useEventListener(wrapperRef,"blur",handleBlur,!0),useEventListener(wrapperRef,"click",event=>{unref(disabled)||isFocusable(event.target)||wrapperRef.value?.contains(document.activeElement)&&wrapperRef.value!==document.activeElement||target.value?.focus()},!0),{isFocused:isFocused,wrapperRef:wrapperRef,handleFocus:handleFocus,handleBlur:handleBlur}}(_ref,{disabled:inputDisabled,afterBlur(){props.validateEvent&&elFormItem?.validate?.("blur").catch(err=>debugWarn(err))}}),needStatusIcon=computed(()=>elForm?.statusIcon??!1),validateState=computed(()=>elFormItem?.validateState||""),validateIcon=computed(()=>validateState.value&&ValidateComponentsMap[validateState.value]),passwordIcon=computed(()=>passwordVisible.value?view_default:hide_default),containerStyle=computed(()=>[rawAttrs.style]),textareaStyle=computed(()=>[props.inputStyle,textareaCalcStyle.value,{resize:props.resize}]),nativeInputValue=computed(()=>isNil(props.modelValue)?"":String(props.modelValue)),showClear=computed(()=>props.clearable&&!inputDisabled.value&&!props.readonly&&!!nativeInputValue.value&&(isFocused.value||hovering.value)),showPwdVisible=computed(()=>props.showPassword&&!inputDisabled.value&&!!nativeInputValue.value),isWordLimitVisible=computed(()=>props.showWordLimit&&!!props.maxlength&&("text"===props.type||"textarea"===props.type)&&!inputDisabled.value&&!props.readonly&&!props.showPassword),textLength=computed(()=>nativeInputValue.value.length),inputExceed=computed(()=>!!isWordLimitVisible.value&&textLength.value>Number(props.maxlength)),suffixVisible=computed(()=>!!slots.suffix||!!props.suffixIcon||showClear.value||props.showPassword||isWordLimitVisible.value||!!validateState.value&&needStatusIcon.value),hasModelModifiers=computed(()=>!!Object.keys(props.modelModifiers).length),[recordCursor,setCursor]=function(input){let selectionInfo;return[function(){if(null==input.value)return;const{selectionStart:selectionStart,selectionEnd:selectionEnd,value:value}=input.value;null!=selectionStart&&null!=selectionEnd&&(selectionInfo={selectionStart:selectionStart,selectionEnd:selectionEnd,value:value,beforeTxt:value.slice(0,Math.max(0,selectionStart)),afterTxt:value.slice(Math.max(0,selectionEnd))})},function(){if(null==input.value||null==selectionInfo)return;const{value:value}=input.value,{beforeTxt:beforeTxt,afterTxt:afterTxt,selectionStart:selectionStart}=selectionInfo;if(null==beforeTxt||null==afterTxt||null==selectionStart)return;let startPos=value.length;if(value.endsWith(afterTxt))startPos=value.length-afterTxt.length;else if(value.startsWith(beforeTxt))startPos=beforeTxt.length;else{const beforeLastChar=beforeTxt[selectionStart-1],newIndex=value.indexOf(beforeLastChar,selectionStart-1);-1!==newIndex&&(startPos=newIndex+1)}input.value.setSelectionRange(startPos,startPos)}]}(input);useResizeObserver(textarea,entries=>{if(onceInitSizeTextarea(),!isWordLimitVisible.value||"both"!==props.resize&&"horizontal"!==props.resize)return;const{width:width}=entries[0].contentRect;countStyle.value={right:`calc(100% - ${width+22-10}px)`}});const resizeTextarea=()=>{const{type:type,autosize:autosize}=props;if(isClient&&"textarea"===type&&textarea.value)if(autosize){const minRows=isObject$2(autosize)?autosize.minRows:void 0,maxRows=isObject$2(autosize)?autosize.maxRows:void 0,textareaStyle2=calcTextareaHeight(textarea.value,minRows,maxRows);textareaCalcStyle.value={overflowY:"hidden",...textareaStyle2},nextTick(()=>{textarea.value.offsetHeight,textareaCalcStyle.value=textareaStyle2})}else textareaCalcStyle.value={minHeight:calcTextareaHeight(textarea.value).minHeight}},onceInitSizeTextarea=(resizeTextarea2=>{let isInit=!1;return()=>{!isInit&&props.autosize&&null!==textarea.value?.offsetParent&&(setTimeout(resizeTextarea2),isInit=!0)}})(resizeTextarea),setNativeInputValue=()=>{const input2=_ref.value,formatterValue=props.formatter?props.formatter(nativeInputValue.value):nativeInputValue.value;input2&&input2.value!==formatterValue&&"file"!==props.type&&(input2.value=formatterValue)},formatValue=value=>{const{trim:trim,number:number}=props.modelModifiers;return trim&&(value=value.trim()),number&&(value=`${looseToNumber(value)}`),props.formatter&&props.parser&&(value=props.parser(value)),value},handleInput=async event=>{if(isComposing.value)return;const{lazy:lazy}=props.modelModifiers;let{value:value}=event.target;lazy?emit("input",value):(value=formatValue(value),String(value)!==nativeInputValue.value?(recordCursor(),emit("update:modelValue",value),emit("input",value),await nextTick(),(props.formatter&&props.parser||!hasModelModifiers.value)&&setNativeInputValue(),setCursor()):props.formatter&&setNativeInputValue())},handleChange=async event=>{let{value:value}=event.target;value=formatValue(value),props.modelModifiers.lazy&&emit("update:modelValue",value),emit("change",value,event),await nextTick(),setNativeInputValue()},{isComposing:isComposing,handleCompositionStart:handleCompositionStart,handleCompositionUpdate:handleCompositionUpdate,handleCompositionEnd:handleCompositionEnd}=function({afterComposition:afterComposition,emit:emit}){const isComposing=ref(!1),handleCompositionUpdate=event=>{emit?.("compositionupdate",event);const text=event.target?.value;isComposing.value=!(text=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text))(text[text.length-1]||"")},handleCompositionEnd=event=>{emit?.("compositionend",event),isComposing.value&&(isComposing.value=!1,nextTick(()=>afterComposition(event)))};return{isComposing:isComposing,handleComposition:event=>{"compositionend"===event.type?handleCompositionEnd(event):handleCompositionUpdate(event)},handleCompositionStart:event=>{emit?.("compositionstart",event),isComposing.value=!0},handleCompositionUpdate:handleCompositionUpdate,handleCompositionEnd:handleCompositionEnd}}({emit:emit,afterComposition:handleInput}),handlePasswordVisible=()=>{passwordVisible.value=!passwordVisible.value},handleMouseLeave=evt=>{hovering.value=!1,emit("mouseleave",evt)},handleMouseEnter=evt=>{hovering.value=!0,emit("mouseenter",evt)},handleKeydown=evt=>{emit("keydown",evt)},clear=evt=>{emit("update:modelValue",""),emit("change",""),emit("clear",evt),emit("input","")};return watch(()=>props.modelValue,()=>{nextTick(()=>resizeTextarea()),props.validateEvent&&elFormItem?.validate?.("change").catch(err=>debugWarn(err))}),watch(nativeInputValue,newValue=>{if(!_ref.value)return;const{trim:trim,number:number}=props.modelModifiers,elValue=_ref.value.value,displayValue=!number&&"number"!==props.type||/^0\d/.test(elValue)?elValue:`${looseToNumber(elValue)}`;displayValue!==newValue&&(document.activeElement===_ref.value&&"range"!==_ref.value.type&&trim&&displayValue.trim()===newValue||setNativeInputValue())}),watch(()=>props.type,async()=>{await nextTick(),setNativeInputValue(),resizeTextarea()}),onMounted(()=>{!props.formatter&&props.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),setNativeInputValue(),nextTick(resizeTextarea)}),__expose({input:input,textarea:textarea,ref:_ref,textareaStyle:textareaStyle,autosize:toRef(props,"autosize"),isComposing:isComposing,focus:()=>_ref.value?.focus(),blur:()=>_ref.value?.blur(),select:()=>{_ref.value?.select()},clear:clear,resizeTextarea:resizeTextarea}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass([containerKls.value,{[unref(nsInput).bm("group","append")]:_ctx.$slots.append,[unref(nsInput).bm("group","prepend")]:_ctx.$slots.prepend}]),style:normalizeStyle(containerStyle.value),onMouseenter:handleMouseEnter,onMouseleave:handleMouseLeave},[createCommentVNode(" input "),"textarea"!==__props.type?(openBlock(),createElementBlock(Fragment,{key:0},[createCommentVNode(" prepend slot "),_ctx.$slots.prepend?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(nsInput).be("group","prepend"))},[renderSlot(_ctx.$slots,"prepend")],2)):createCommentVNode("v-if",!0),createElementVNode("div",{ref_key:"wrapperRef",ref:wrapperRef,class:normalizeClass(wrapperKls.value)},[createCommentVNode(" prefix slot "),_ctx.$slots.prefix||__props.prefixIcon?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(nsInput).e("prefix"))},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("prefix-inner"))},[renderSlot(_ctx.$slots,"prefix"),__props.prefixIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(nsInput).e("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.prefixIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],2)):createCommentVNode("v-if",!0),createElementVNode("input",mergeProps({id:unref(inputId),ref_key:"input",ref:input,class:unref(nsInput).e("inner")},unref(attrs),{name:__props.name,minlength:__props.minlength,maxlength:__props.maxlength,type:__props.showPassword?passwordVisible.value?"text":"password":__props.type,disabled:unref(inputDisabled),readonly:__props.readonly,autocomplete:__props.autocomplete,tabindex:__props.tabindex,"aria-label":__props.ariaLabel,placeholder:__props.placeholder,style:__props.inputStyle,form:__props.form,autofocus:__props.autofocus,role:__props.containerRole,inputmode:__props.inputmode,onCompositionstart:_cache[0]||(_cache[0]=(...args)=>unref(handleCompositionStart)&&unref(handleCompositionStart)(...args)),onCompositionupdate:_cache[1]||(_cache[1]=(...args)=>unref(handleCompositionUpdate)&&unref(handleCompositionUpdate)(...args)),onCompositionend:_cache[2]||(_cache[2]=(...args)=>unref(handleCompositionEnd)&&unref(handleCompositionEnd)(...args)),onInput:handleInput,onChange:handleChange,onKeydown:handleKeydown}),null,16,_hoisted_1$b),createCommentVNode(" suffix slot "),suffixVisible.value?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(nsInput).e("suffix"))},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("suffix-inner"))},[showClear.value&&showPwdVisible.value&&isWordLimitVisible.value?createCommentVNode("v-if",!0):(openBlock(),createElementBlock(Fragment,{key:0},[renderSlot(_ctx.$slots,"suffix"),__props.suffixIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(nsInput).e("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.suffixIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],64)),showClear.value?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("clear")]),onMousedown:withModifiers(unref(NOOP),["prevent"]),onClick:clear},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.clearIcon)))]),_:1},8,["class","onMousedown"])):createCommentVNode("v-if",!0),showPwdVisible.value?(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("password")]),onClick:handlePasswordVisible,onMousedown:withModifiers(unref(NOOP),["prevent"]),onMouseup:withModifiers(unref(NOOP),["prevent"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(passwordIcon.value)))]),_:1},8,["class","onMousedown","onMouseup"])):createCommentVNode("v-if",!0),isWordLimitVisible.value?(openBlock(),createElementBlock("span",{key:3,class:normalizeClass([unref(nsInput).e("count"),unref(nsInput).is("outside","outside"===__props.wordLimitPosition)])},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("count-inner"))},toDisplayString(textLength.value)+" / "+toDisplayString(__props.maxlength),3)],2)):createCommentVNode("v-if",!0),validateState.value&&validateIcon.value&&needStatusIcon.value?(openBlock(),createBlock(unref(ElIcon),{key:4,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("validateIcon"),unref(nsInput).is("loading","validating"===validateState.value)])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(validateIcon.value)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],2)):createCommentVNode("v-if",!0)],2),createCommentVNode(" append slot "),_ctx.$slots.append?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(nsInput).be("group","append"))},[renderSlot(_ctx.$slots,"append")],2)):createCommentVNode("v-if",!0)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" textarea "),createElementVNode("textarea",mergeProps({id:unref(inputId),ref_key:"textarea",ref:textarea,class:[unref(nsTextarea).e("inner"),unref(nsInput).is("focus",unref(isFocused)),unref(nsTextarea).is("clearable",__props.clearable)]},unref(attrs),{name:__props.name,minlength:__props.minlength,maxlength:__props.maxlength,tabindex:__props.tabindex,disabled:unref(inputDisabled),readonly:__props.readonly,autocomplete:__props.autocomplete,style:textareaStyle.value,"aria-label":__props.ariaLabel,placeholder:__props.placeholder,form:__props.form,autofocus:__props.autofocus,rows:__props.rows,role:__props.containerRole,onCompositionstart:_cache[3]||(_cache[3]=(...args)=>unref(handleCompositionStart)&&unref(handleCompositionStart)(...args)),onCompositionupdate:_cache[4]||(_cache[4]=(...args)=>unref(handleCompositionUpdate)&&unref(handleCompositionUpdate)(...args)),onCompositionend:_cache[5]||(_cache[5]=(...args)=>unref(handleCompositionEnd)&&unref(handleCompositionEnd)(...args)),onInput:handleInput,onFocus:_cache[6]||(_cache[6]=(...args)=>unref(handleFocus)&&unref(handleFocus)(...args)),onBlur:_cache[7]||(_cache[7]=(...args)=>unref(handleBlur)&&unref(handleBlur)(...args)),onChange:handleChange,onKeydown:handleKeydown}),null,16,_hoisted_2$4),showClear.value?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(nsTextarea).e("icon"),unref(nsTextarea).e("clear")]),onMousedown:withModifiers(unref(NOOP),["prevent"]),onClick:clear},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.clearIcon)))]),_:1},8,["class","onMousedown"])):createCommentVNode("v-if",!0),isWordLimitVisible.value?(openBlock(),createElementBlock("span",{key:1,style:normalizeStyle(countStyle.value),class:normalizeClass([unref(nsInput).e("count"),unref(nsInput).is("outside","outside"===__props.wordLimitPosition)])},toDisplayString(textLength.value)+" / "+toDisplayString(__props.maxlength),7)):createCommentVNode("v-if",!0)],64))],38))}})),scrollbarProps=buildProps({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:[String,Object,Array],default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...useAriaProps(["ariaLabel","ariaOrientation"])}),scrollbarEmits={"end-reached":direction=>["left","right","top","bottom"].includes(direction),scroll:({scrollTop:scrollTop,scrollLeft:scrollLeft})=>[scrollTop,scrollLeft].every(isNumber)},BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),scrollbarContextKey=/* @__PURE__ */Symbol("scrollbarContextKey"),barProps=buildProps({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var thumb_default=/* @__PURE__ */defineComponent({__name:"thumb",props:thumbProps,setup(__props){const props=__props,scrollbar=inject(scrollbarContextKey),ns=useNamespace("scrollbar");scrollbar||function(scope,m){throw new ElementPlusError(`[${scope}] ${m}`)}("Thumb","can not inject scrollbar context");const instance=ref(),thumb=ref(),thumbState=ref({}),visible=ref(!1);let cursorDown=!1,cursorLeave=!1,baseScrollHeight=0,baseScrollWidth=0,originalOnSelectStart=isClient?document.onselectstart:null;const bar=computed(()=>BAR_MAP[props.vertical?"vertical":"horizontal"]),thumbStyle=computed(()=>(({move:move,size:size,bar:bar})=>({[bar.size]:size,transform:`translate${bar.axis}(${move}%)`}))({size:props.size,move:props.move,bar:bar.value})),offsetRatio=computed(()=>instance.value[bar.value.offset]**2/scrollbar.wrapElement[bar.value.scrollSize]/props.ratio/thumb.value[bar.value.offset]),clickThumbHandler=e=>{if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;window.getSelection()?.removeAllRanges(),startDrag(e);const el=e.currentTarget;el&&(thumbState.value[bar.value.axis]=el[bar.value.offset]-(e[bar.value.client]-el.getBoundingClientRect()[bar.value.direction]))},clickTrackHandler=e=>{if(!thumb.value||!instance.value||!scrollbar.wrapElement)return;const thumbPositionPercentage=100*(Math.abs(e.target.getBoundingClientRect()[bar.value.direction]-e[bar.value.client])-thumb.value[bar.value.offset]/2)*offsetRatio.value/instance.value[bar.value.offset];scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*scrollbar.wrapElement[bar.value.scrollSize]/100},startDrag=e=>{e.stopImmediatePropagation(),cursorDown=!0,baseScrollHeight=scrollbar.wrapElement.scrollHeight,baseScrollWidth=scrollbar.wrapElement.scrollWidth,document.addEventListener("mousemove",mouseMoveDocumentHandler),document.addEventListener("mouseup",mouseUpDocumentHandler),originalOnSelectStart=document.onselectstart,document.onselectstart=()=>!1},mouseMoveDocumentHandler=e=>{if(!instance.value||!thumb.value)return;if(!1===cursorDown)return;const prevPage=thumbState.value[bar.value.axis];if(!prevPage)return;const thumbPositionPercentage=100*(-1*(instance.value.getBoundingClientRect()[bar.value.direction]-e[bar.value.client])-(thumb.value[bar.value.offset]-prevPage))*offsetRatio.value/instance.value[bar.value.offset];"scrollLeft"===bar.value.scroll?scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*baseScrollWidth/100:scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*baseScrollHeight/100},mouseUpDocumentHandler=()=>{cursorDown=!1,thumbState.value[bar.value.axis]=0,document.removeEventListener("mousemove",mouseMoveDocumentHandler),document.removeEventListener("mouseup",mouseUpDocumentHandler),restoreOnselectstart(),cursorLeave&&(visible.value=!1)};onBeforeUnmount(()=>{restoreOnselectstart(),document.removeEventListener("mouseup",mouseUpDocumentHandler)});const restoreOnselectstart=()=>{document.onselectstart!==originalOnSelectStart&&(document.onselectstart=originalOnSelectStart)};return useEventListener(toRef(scrollbar,"scrollbarElement"),"mousemove",()=>{cursorLeave=!1,visible.value=!!props.size}),useEventListener(toRef(scrollbar,"scrollbarElement"),"mouseleave",()=>{cursorLeave=!0,visible.value=cursorDown}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:unref(ns).b("fade"),persisted:""},{default:withCtx(()=>[withDirectives(createElementVNode("div",{ref_key:"instance",ref:instance,class:normalizeClass([unref(ns).e("bar"),unref(ns).is(bar.value.key)]),onMousedown:clickTrackHandler,onClick:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"]))},[createElementVNode("div",{ref_key:"thumb",ref:thumb,class:normalizeClass(unref(ns).e("thumb")),style:normalizeStyle(thumbStyle.value),onMousedown:clickThumbHandler},null,38)],34),[[vShow,__props.always||visible.value]])]),_:1},8,["name"]))}}),bar_default=/* @__PURE__ */defineComponent({__name:"bar",props:barProps,setup(__props,{expose:__expose}){const props=__props,scrollbar=inject(scrollbarContextKey),moveX=ref(0),moveY=ref(0),sizeWidth=ref(""),sizeHeight=ref(""),ratioY=ref(1),ratioX=ref(1);return __expose({handleScroll:wrap=>{if(wrap){const offsetHeight=wrap.offsetHeight-4,offsetWidth=wrap.offsetWidth-4;moveY.value=100*wrap.scrollTop/offsetHeight*ratioY.value,moveX.value=100*wrap.scrollLeft/offsetWidth*ratioX.value}},update:()=>{const wrap=scrollbar?.wrapElement;if(!wrap)return;const offsetHeight=wrap.offsetHeight-4,offsetWidth=wrap.offsetWidth-4,originalHeight=offsetHeight**2/wrap.scrollHeight,originalWidth=offsetWidth**2/wrap.scrollWidth,height=Math.max(originalHeight,props.minSize),width=Math.max(originalWidth,props.minSize);ratioY.value=originalHeight/(offsetHeight-originalHeight)/(height/(offsetHeight-height)),ratioX.value=originalWidth/(offsetWidth-originalWidth)/(width/(offsetWidth-width)),sizeHeight.value=height+4<offsetHeight?`${height}px`:"",sizeWidth.value=width+4<offsetWidth?`${width}px`:""}}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(thumb_default,{move:moveX.value,ratio:ratioX.value,size:sizeWidth.value,always:__props.always},null,8,["move","ratio","size","always"]),createVNode(thumb_default,{move:moveY.value,ratio:ratioY.value,size:sizeHeight.value,vertical:"",always:__props.always},null,8,["move","ratio","size","always"])],64))}});const _hoisted_1$a=["tabindex"];const ElScrollbar=withInstall(/* @__PURE__ */defineComponent({name:"ElScrollbar",__name:"scrollbar",props:scrollbarProps,emits:scrollbarEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,ns=useNamespace("scrollbar");let stopResizeObserver,stopWrapResizeObserver,stopResizeListener,wrapScrollTop=0,wrapScrollLeft=0,direction="";const distanceScrollState={bottom:!1,top:!1,right:!1,left:!1},scrollbarRef=ref(),wrapRef=ref(),resizeRef=ref(),barRef=ref(),wrapStyle=computed(()=>{const style={},height=addUnit(props.height),maxHeight=addUnit(props.maxHeight);return height&&(style.height=height),maxHeight&&(style.maxHeight=maxHeight),[props.wrapStyle,style]}),wrapKls=computed(()=>[props.wrapClass,ns.e("wrap"),{[ns.em("wrap","hidden-default")]:!props.native}]),resizeKls=computed(()=>[ns.e("view"),props.viewClass]),DIRECTION_PAIRS={top:"bottom",bottom:"top",left:"right",right:"left"},handleScroll=()=>{if(wrapRef.value){barRef.value?.handleScroll(wrapRef.value);const prevTop=wrapScrollTop,prevLeft=wrapScrollLeft;wrapScrollTop=wrapRef.value.scrollTop,wrapScrollLeft=wrapRef.value.scrollLeft;const arrivedStates={bottom:wrapScrollTop+wrapRef.value.clientHeight>=wrapRef.value.scrollHeight-props.distance,top:wrapScrollTop<=props.distance&&0!==prevTop,right:wrapScrollLeft+wrapRef.value.clientWidth>=wrapRef.value.scrollWidth-props.distance&&prevLeft!==wrapScrollLeft,left:wrapScrollLeft<=props.distance&&0!==prevLeft};if(emit("scroll",{scrollTop:wrapScrollTop,scrollLeft:wrapScrollLeft}),prevTop!==wrapScrollTop&&(direction=wrapScrollTop>prevTop?"bottom":"top"),prevLeft!==wrapScrollLeft&&(direction=wrapScrollLeft>prevLeft?"right":"left"),props.distance>0){if(distanceScrollState[direction])return;(arrivedStates=>{const oppositeDirection=DIRECTION_PAIRS[direction];if(!oppositeDirection)return;const arrived=arrivedStates[direction],oppositeArrived=arrivedStates[oppositeDirection];arrived&&!distanceScrollState[direction]&&(distanceScrollState[direction]=!0),!oppositeArrived&&distanceScrollState[oppositeDirection]&&(distanceScrollState[oppositeDirection]=!1)})(arrivedStates)}arrivedStates[direction]&&emit("end-reached",direction)}};const update=()=>{barRef.value?.update(),distanceScrollState[direction]=!1};return watch(()=>props.noresize,noresize=>{noresize?(stopResizeObserver?.(),stopWrapResizeObserver?.(),stopResizeListener?.()):(({stop:stopResizeObserver}=useResizeObserver(resizeRef,update)),({stop:stopWrapResizeObserver}=useResizeObserver(wrapRef,update)),stopResizeListener=useEventListener("resize",update))},{immediate:!0}),watch(()=>[props.maxHeight,props.height],()=>{props.native||nextTick(()=>{update(),wrapRef.value&&barRef.value?.handleScroll(wrapRef.value)})}),provide(scrollbarContextKey,reactive({scrollbarElement:scrollbarRef,wrapElement:wrapRef})),onActivated(()=>{wrapRef.value&&(wrapRef.value.scrollTop=wrapScrollTop,wrapRef.value.scrollLeft=wrapScrollLeft)}),onMounted(()=>{props.native||nextTick(()=>{update()})}),onUpdated(()=>update()),__expose({wrapRef:wrapRef,update:update,scrollTo:function(arg1,arg2){isObject$2(arg1)?wrapRef.value.scrollTo(arg1):isNumber(arg1)&&isNumber(arg2)&&wrapRef.value.scrollTo(arg1,arg2)},setScrollTop:value=>{isNumber(value)?wrapRef.value.scrollTop=value:debugWarn("ElScrollbar","value must be a number")},setScrollLeft:value=>{isNumber(value)?wrapRef.value.scrollLeft=value:debugWarn("ElScrollbar","value must be a number")},handleScroll:handleScroll}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{ref_key:"scrollbarRef",ref:scrollbarRef,class:normalizeClass(unref(ns).b())},[createElementVNode("div",{ref_key:"wrapRef",ref:wrapRef,class:normalizeClass(wrapKls.value),style:normalizeStyle(wrapStyle.value),tabindex:__props.tabindex,onScroll:handleScroll},[(openBlock(),createBlock(resolveDynamicComponent(__props.tag),{id:__props.id,ref_key:"resizeRef",ref:resizeRef,class:normalizeClass(resizeKls.value),style:normalizeStyle(__props.viewStyle),role:__props.role,"aria-label":__props.ariaLabel,"aria-orientation":__props.ariaOrientation},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,_hoisted_1$a),__props.native?createCommentVNode("v-if",!0):(openBlock(),createBlock(bar_default,{key:0,ref_key:"barRef",ref:barRef,always:__props.always,"min-size":__props.minSize},null,8,["always","min-size"]))],2))}}));const ElBadge=withInstall(/* @__PURE__ */defineComponent({name:"ElBadge",__name:"badge",props:buildProps({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:[String,Object,Array]},offset:{type:Array,default:()=>[0,0]},badgeClass:{type:String}}),setup(__props,{expose:__expose}){const props=__props,ns=useNamespace("badge"),content=computed(()=>props.isDot?"":isNumber(props.value)&&isNumber(props.max)&&props.max<props.value?`${props.max}+`:`${props.value}`),style=computed(()=>[{backgroundColor:props.color,marginRight:addUnit(-props.offset[0]),marginTop:addUnit(props.offset[1])},props.badgeStyle??{}]);return __expose({content:content}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(ns).b())},[renderSlot(_ctx.$slots,"default"),createVNode(Transition,{name:`${unref(ns).namespace.value}-zoom-in-center`},{default:withCtx(()=>[!__props.hidden&&(content.value||__props.isDot||_ctx.$slots.content)?(openBlock(),createElementBlock("sup",{key:0,class:normalizeClass([unref(ns).e("content"),unref(ns).em("content",__props.type),unref(ns).is("fixed",!!_ctx.$slots.default),unref(ns).is("dot",__props.isDot),unref(ns).is("hide-zero",!__props.showZero&&0===__props.value),__props.badgeClass]),style:normalizeStyle(style.value)},[renderSlot(_ctx.$slots,"content",{value:content.value},()=>[createTextVNode(toDisplayString(content.value),1)])],6)):createCommentVNode("v-if",!0)]),_:3},8,["name"])],2))}})),buttonProps=buildProps({size:useSizeProp,disabled:{type:Boolean,default:void 0},type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:iconPropType},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:iconPropType,default:()=>loading_default},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,dashed:{type:Boolean,default:void 0},color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),buttonEmits={click:evt=>evt instanceof MouseEvent},configProviderContextKey=/* @__PURE__ */Symbol(),globalConfig=ref();function useGlobalConfig(key,defaultValue=void 0){const config=getCurrentInstance()?inject(configProviderContextKey,globalConfig):globalConfig;return key?computed(()=>config.value?.[key]??defaultValue):config}const provideGlobalConfig=(config,app,global2=!1)=>{const inSetup=!!getCurrentInstance(),oldConfig=inSetup?useGlobalConfig():void 0,provideFn=inSetup?provide:void 0;if(!provideFn)return void debugWarn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const context=computed(()=>{const cfg=unref(config);return oldConfig?.value?mergeConfig(oldConfig.value,cfg):cfg});return provideFn(configProviderContextKey,context),provideFn(localeContextKey,computed(()=>context.value.locale)),provideFn(namespaceContextKey,computed(()=>context.value.namespace)),provideFn(zIndexContextKey,computed(()=>context.value.zIndex)),provideFn(SIZE_INJECTION_KEY,{size:computed(()=>context.value.size||"")}),provideFn(emptyValuesContextKey,computed(()=>({emptyValues:context.value.emptyValues,valueOnClear:context.value.valueOnClear}))),!global2&&globalConfig.value||(globalConfig.value=context.value),context},mergeConfig=(a,b)=>{const keys2=[.../* @__PURE__ */new Set([...keysOf(a),...keysOf(b)])],obj={};for(const key of keys2)obj[key]=void 0!==b[key]?b[key]:a[key];return obj},configProviderProps=buildProps({a11y:{type:Boolean,default:!0},locale:{type:Object},size:useSizeProp,button:{type:Object},card:{type:Object},dialog:{type:Object},link:{type:Object},experimentalFeatures:{type:Object},keyboardNavigation:{type:Boolean,default:!0},message:{type:Object},zIndex:Number,namespace:{type:String,default:"el"},table:{type:Object},...useEmptyValuesProps}),messageConfig={placement:"top"},buttonGroupContextKey=(/* @__PURE__ */defineComponent({name:"ElConfigProvider",props:configProviderProps,setup(props,{slots:slots}){const config=provideGlobalConfig(props);return watch(()=>props.message,val=>{Object.assign(messageConfig,config?.value?.message??{},val??{})},{immediate:!0,deep:!0}),()=>renderSlot(slots,"default",{config:config?.value})}}),Symbol("buttonGroupContextKey"));function bound01(n,max){(function(n){return"string"==typeof n&&-1!==n.indexOf(".")&&1===parseFloat(n)})(n)&&(n="100%");const isPercent=function(n){return"string"==typeof n&&-1!==n.indexOf("%")}(n);return n=360===max?n:Math.min(max,Math.max(0,parseFloat(n))),isPercent&&(n=parseInt(String(n*max),10)/100),Math.abs(n-max)<1e-6?1:n=360===max?(n<0?n%max+max:n%max)/parseFloat(String(max)):n%max/parseFloat(String(max))}function clamp01(val){return Math.min(1,Math.max(0,val))}function boundAlpha(a){return a=parseFloat(a),(isNaN(a)||a<0||a>1)&&(a=1),a}function convertToPercentage(n){return Number(n)<=1?100*Number(n)+"%":n}function pad2(c){return 1===c.length?"0"+c:String(c)}function rgbToHsl(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=Math.max(r,g,b),min=Math.min(r,g,b);let h2=0,s=0;const l=(max+min)/2;if(max===min)s=0,h2=0;else{const d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h2=(g-b)/d+(g<b?6:0);break;case g:h2=(b-r)/d+2;break;case b:h2=(r-g)/d+4}h2/=6}return{h:h2,s:s,l:l}}function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*t*(q-p):t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}function rgbToHsv(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=Math.max(r,g,b),min=Math.min(r,g,b);let h2=0;const v=max,d=max-min,s=0===max?0:d/max;if(max===min)h2=0;else{switch(max){case r:h2=(g-b)/d+(g<b?6:0);break;case g:h2=(b-r)/d+2;break;case b:h2=(r-g)/d+4}h2/=6}return{h:h2,s:s,v:v}}function rgbToHex(r,g,b,allow3Char){const hex=[pad2(Math.round(r).toString(16)),pad2(Math.round(g).toString(16)),pad2(Math.round(b).toString(16))];return allow3Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0):hex.join("")}function rgbToCmyk(r,g,b){let c=1-r/255,m=1-g/255,y=1-b/255,k=Math.min(c,m,y);return 1===k?(c=0,m=0,y=0):(c=(c-k)/(1-k)*100,m=(m-k)/(1-k)*100,y=(y-k)/(1-k)*100),k*=100,{c:Math.round(c),m:Math.round(m),y:Math.round(y),k:Math.round(k)}}function convertHexToDecimal(h2){return parseIntFromHex(h2)/255}function parseIntFromHex(val){return parseInt(val,16)}const names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(color){let rgb={r:0,g:0,b:0},a=1,s=null,v=null,l=null,ok=!1,format=!1;var r,g,b;return"string"==typeof color&&(color=function(color){if(color=color.trim().toLowerCase(),0===color.length)return!1;let named=!1;if(names[color])color=names[color],named=!0;else if("transparent"===color)return{r:0,g:0,b:0,a:0,format:"name"};let match=matchers.rgb.exec(color);if(match)return{r:match[1],g:match[2],b:match[3]};if(match=matchers.rgba.exec(color),match)return{r:match[1],g:match[2],b:match[3],a:match[4]};if(match=matchers.hsl.exec(color),match)return{h:match[1],s:match[2],l:match[3]};if(match=matchers.hsla.exec(color),match)return{h:match[1],s:match[2],l:match[3],a:match[4]};if(match=matchers.hsv.exec(color),match)return{h:match[1],s:match[2],v:match[3]};if(match=matchers.hsva.exec(color),match)return{h:match[1],s:match[2],v:match[3],a:match[4]};if(match=matchers.cmyk.exec(color),match)return{c:match[1],m:match[2],y:match[3],k:match[4]};if(match=matchers.hex8.exec(color),match)return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),a:convertHexToDecimal(match[4]),format:named?"name":"hex8"};if(match=matchers.hex6.exec(color),match)return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"};if(match=matchers.hex4.exec(color),match)return{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),a:convertHexToDecimal(match[4]+match[4]),format:named?"name":"hex8"};if(match=matchers.hex3.exec(color),match)return{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),format:named?"name":"hex"};return!1}(color)),"object"==typeof color&&(isValidCSSUnit(color.r)&&isValidCSSUnit(color.g)&&isValidCSSUnit(color.b)?(r=color.r,g=color.g,b=color.b,rgb={r:255*bound01(r,255),g:255*bound01(g,255),b:255*bound01(b,255)},ok=!0,format="%"===String(color.r).substr(-1)?"prgb":"rgb"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.v)?(s=convertToPercentage(color.s),v=convertToPercentage(color.v),rgb=function(h2,s,v){h2=6*bound01(h2,360),s=bound01(s,100),v=bound01(v,100);const i=Math.floor(h2),f=h2-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6;return{r:255*[v,q,p,p,t,v][mod],g:255*[t,v,v,q,p,p][mod],b:255*[p,p,t,v,v,q][mod]}}(color.h,s,v),ok=!0,format="hsv"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.l)?(s=convertToPercentage(color.s),l=convertToPercentage(color.l),rgb=function(h2,s,l){let r,g,b;if(h2=bound01(h2,360),s=bound01(s,100),l=bound01(l,100),0===s)g=l,b=l,r=l;else{const q=l<.5?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h2+1/3),g=hue2rgb(p,q,h2),b=hue2rgb(p,q,h2-1/3)}return{r:255*r,g:255*g,b:255*b}}(color.h,s,l),ok=!0,format="hsl"):isValidCSSUnit(color.c)&&isValidCSSUnit(color.m)&&isValidCSSUnit(color.y)&&isValidCSSUnit(color.k)&&(rgb=function(c,m,y,k){const kConv=k/100;return{r:255*(1-c/100)*(1-kConv),g:255*(1-m/100)*(1-kConv),b:255*(1-y/100)*(1-kConv)}}(color.c,color.m,color.y,color.k),ok=!0,format="cmyk"),Object.prototype.hasOwnProperty.call(color,"a")&&(a=color.a)),a=boundAlpha(a),{ok:ok,format:color.format||format,r:Math.min(255,Math.max(rgb.r,0)),g:Math.min(255,Math.max(rgb.g,0)),b:Math.min(255,Math.max(rgb.b,0)),a:a}}const CSS_UNIT="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),cmyk:new RegExp("cmyk"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function isValidCSSUnit(color){return"number"==typeof color?!Number.isNaN(color):matchers.CSS_UNIT.test(color)}class TinyColor{constructor(color="",opts={}){if(color instanceof TinyColor)return color;"number"==typeof color&&(color=function(color){return{r:color>>16,g:(65280&color)>>8,b:255&color}}(color)),this.originalInput=color;const rgb=inputToRGB(color);this.originalInput=color,this.r=rgb.r,this.g=rgb.g,this.b=rgb.b,this.a=rgb.a,this.roundA=Math.round(100*this.a)/100,this.format=opts.format??rgb.format,this.gradientType=opts.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=rgb.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const rgb=this.toRgb();return(299*rgb.r+587*rgb.g+114*rgb.b)/1e3}getLuminance(){const rgb=this.toRgb();let R2,G2,B2;const RsRGB=rgb.r/255,GsRGB=rgb.g/255,BsRGB=rgb.b/255;return R2=RsRGB<=.03928?RsRGB/12.92:Math.pow((RsRGB+.055)/1.055,2.4),G2=GsRGB<=.03928?GsRGB/12.92:Math.pow((GsRGB+.055)/1.055,2.4),B2=BsRGB<=.03928?BsRGB/12.92:Math.pow((BsRGB+.055)/1.055,2.4),.2126*R2+.7152*G2+.0722*B2}getAlpha(){return this.a}setAlpha(alpha){return this.a=boundAlpha(alpha),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:s}=this.toHsl();return 0===s}toHsv(){const hsv=rgbToHsv(this.r,this.g,this.b);return{h:360*hsv.h,s:hsv.s,v:hsv.v,a:this.a}}toHsvString(){const hsv=rgbToHsv(this.r,this.g,this.b),h2=Math.round(360*hsv.h),s=Math.round(100*hsv.s),v=Math.round(100*hsv.v);return 1===this.a?`hsv(${h2}, ${s}%, ${v}%)`:`hsva(${h2}, ${s}%, ${v}%, ${this.roundA})`}toHsl(){const hsl=rgbToHsl(this.r,this.g,this.b);return{h:360*hsl.h,s:hsl.s,l:hsl.l,a:this.a}}toHslString(){const hsl=rgbToHsl(this.r,this.g,this.b),h2=Math.round(360*hsl.h),s=Math.round(100*hsl.s),l=Math.round(100*hsl.l);return 1===this.a?`hsl(${h2}, ${s}%, ${l}%)`:`hsla(${h2}, ${s}%, ${l}%, ${this.roundA})`}toHex(allow3Char=!1){return rgbToHex(this.r,this.g,this.b,allow3Char)}toHexString(allow3Char=!1){return"#"+this.toHex(allow3Char)}toHex8(allow4Char=!1){return function(r,g,b,a,allow4Char){const hex=[pad2(Math.round(r).toString(16)),pad2(Math.round(g).toString(16)),pad2(Math.round(b).toString(16)),pad2((d=a,Math.round(255*parseFloat(d)).toString(16)))];var d;return allow4Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))&&hex[3].startsWith(hex[3].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0):hex.join("")}(this.r,this.g,this.b,this.a,allow4Char)}toHex8String(allow4Char=!1){return"#"+this.toHex8(allow4Char)}toHexShortString(allowShortChar=!1){return 1===this.a?this.toHexString(allowShortChar):this.toHex8String(allowShortChar)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const r=Math.round(this.r),g=Math.round(this.g),b=Math.round(this.b);return 1===this.a?`rgb(${r}, ${g}, ${b})`:`rgba(${r}, ${g}, ${b}, ${this.roundA})`}toPercentageRgb(){const fmt=x=>`${Math.round(100*bound01(x,255))}%`;return{r:fmt(this.r),g:fmt(this.g),b:fmt(this.b),a:this.a}}toPercentageRgbString(){const rnd=x=>Math.round(100*bound01(x,255));return 1===this.a?`rgb(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%)`:`rgba(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%, ${this.roundA})`}toCmyk(){return{...rgbToCmyk(this.r,this.g,this.b)}}toCmykString(){const{c:c,m:m,y:y,k:k}=rgbToCmyk(this.r,this.g,this.b);return`cmyk(${c}, ${m}, ${y}, ${k})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const hex="#"+rgbToHex(this.r,this.g,this.b,!1);for(const[key,value]of Object.entries(names))if(hex===value)return key;return!1}toString(format){const formatSet=Boolean(format);format=format??this.format;let formattedString=!1;const hasAlpha=this.a<1&&this.a>=0;return formatSet||!hasAlpha||!format.startsWith("hex")&&"name"!==format?("rgb"===format&&(formattedString=this.toRgbString()),"prgb"===format&&(formattedString=this.toPercentageRgbString()),"hex"!==format&&"hex6"!==format||(formattedString=this.toHexString()),"hex3"===format&&(formattedString=this.toHexString(!0)),"hex4"===format&&(formattedString=this.toHex8String(!0)),"hex8"===format&&(formattedString=this.toHex8String()),"name"===format&&(formattedString=this.toName()),"hsl"===format&&(formattedString=this.toHslString()),"hsv"===format&&(formattedString=this.toHsvString()),"cmyk"===format&&(formattedString=this.toCmykString()),formattedString||this.toHexString()):"name"===format&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new TinyColor(this.toString())}lighten(amount=10){const hsl=this.toHsl();return hsl.l+=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}brighten(amount=10){const rgb=this.toRgb();return rgb.r=Math.max(0,Math.min(255,rgb.r-Math.round(-amount/100*255))),rgb.g=Math.max(0,Math.min(255,rgb.g-Math.round(-amount/100*255))),rgb.b=Math.max(0,Math.min(255,rgb.b-Math.round(-amount/100*255))),new TinyColor(rgb)}darken(amount=10){const hsl=this.toHsl();return hsl.l-=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}tint(amount=10){return this.mix("white",amount)}shade(amount=10){return this.mix("black",amount)}desaturate(amount=10){const hsl=this.toHsl();return hsl.s-=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}saturate(amount=10){const hsl=this.toHsl();return hsl.s+=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}greyscale(){return this.desaturate(100)}spin(amount){const hsl=this.toHsl(),hue=(hsl.h+amount)%360;return hsl.h=hue<0?360+hue:hue,new TinyColor(hsl)}mix(color,amount=50){const rgb1=this.toRgb(),rgb2=new TinyColor(color).toRgb(),p=amount/100,rgba={r:(rgb2.r-rgb1.r)*p+rgb1.r,g:(rgb2.g-rgb1.g)*p+rgb1.g,b:(rgb2.b-rgb1.b)*p+rgb1.b,a:(rgb2.a-rgb1.a)*p+rgb1.a};return new TinyColor(rgba)}analogous(results=6,slices=30){const hsl=this.toHsl(),part=360/slices,ret=[this];for(hsl.h=(hsl.h-(part*results>>1)+720)%360;--results;)hsl.h=(hsl.h+part)%360,ret.push(new TinyColor(hsl));return ret}complement(){const hsl=this.toHsl();return hsl.h=(hsl.h+180)%360,new TinyColor(hsl)}monochromatic(results=6){const hsv=this.toHsv(),{h:h2}=hsv,{s:s}=hsv;let{v:v}=hsv;const res=[],modification=1/results;for(;results--;)res.push(new TinyColor({h:h2,s:s,v:v})),v=(v+modification)%1;return res}splitcomplement(){const hsl=this.toHsl(),{h:h2}=hsl;return[this,new TinyColor({h:(h2+72)%360,s:hsl.s,l:hsl.l}),new TinyColor({h:(h2+216)%360,s:hsl.s,l:hsl.l})]}onBackground(background){const fg=this.toRgb(),bg=new TinyColor(background).toRgb(),alpha=fg.a+bg.a*(1-fg.a);return new TinyColor({r:(fg.r*fg.a+bg.r*bg.a*(1-fg.a))/alpha,g:(fg.g*fg.a+bg.g*bg.a*(1-fg.a))/alpha,b:(fg.b*fg.a+bg.b*bg.a*(1-fg.a))/alpha,a:alpha})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(n){const hsl=this.toHsl(),{h:h2}=hsl,result=[this],increment=360/n;for(let i=1;i<n;i++)result.push(new TinyColor({h:(h2+i*increment)%360,s:hsl.s,l:hsl.l}));return result}equals(color){const comparedColor=new TinyColor(color);return"cmyk"===this.format||"cmyk"===comparedColor.format?this.toCmykString()===comparedColor.toCmykString():this.toRgbString()===comparedColor.toRgbString()}}function darken(color,amount=20){return color.mix("#141414",amount).toString()}var button_default=/* @__PURE__ */defineComponent({name:"ElButton",__name:"button",props:buttonProps,emits:buttonEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,buttonStyle=function(props){const _disabled=useFormDisabled(),ns=useNamespace("button");return computed(()=>{let styles={},buttonColor=props.color;if(buttonColor){const match=buttonColor.match(/var\((.*?)\)/);match&&(buttonColor=window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]));const color=new TinyColor(buttonColor),activeBgColor=props.dark?color.tint(20).toString():darken(color,20);if(props.plain)styles=ns.cssVarBlock({"bg-color":props.dark?darken(color,90):color.tint(90).toString(),"text-color":buttonColor,"border-color":props.dark?darken(color,50):color.tint(50).toString(),"hover-text-color":`var(${ns.cssVarName("color-white")})`,"hover-bg-color":buttonColor,"hover-border-color":buttonColor,"active-bg-color":activeBgColor,"active-text-color":`var(${ns.cssVarName("color-white")})`,"active-border-color":activeBgColor}),_disabled.value&&(styles[ns.cssVarBlockName("disabled-bg-color")]=props.dark?darken(color,90):color.tint(90).toString(),styles[ns.cssVarBlockName("disabled-text-color")]=props.dark?darken(color,50):color.tint(50).toString(),styles[ns.cssVarBlockName("disabled-border-color")]=props.dark?darken(color,80):color.tint(80).toString());else{const hoverBgColor=props.dark?darken(color,30):color.tint(30).toString(),textColor=color.isDark()?`var(${ns.cssVarName("color-white")})`:`var(${ns.cssVarName("color-black")})`;if(styles=ns.cssVarBlock({"bg-color":buttonColor,"text-color":textColor,"border-color":buttonColor,"hover-bg-color":hoverBgColor,"hover-text-color":textColor,"hover-border-color":hoverBgColor,"active-bg-color":activeBgColor,"active-border-color":activeBgColor}),_disabled.value){const disabledButtonColor=props.dark?darken(color,50):color.tint(50).toString();styles[ns.cssVarBlockName("disabled-bg-color")]=disabledButtonColor,styles[ns.cssVarBlockName("disabled-text-color")]=props.dark?"rgba(255, 255, 255, 0.5)":`var(${ns.cssVarName("color-white")})`,styles[ns.cssVarBlockName("disabled-border-color")]=disabledButtonColor}}}return styles})}(props),ns=useNamespace("button"),{_ref:_ref,_size:_size,_type:_type,_disabled:_disabled,_props:_props,_plain:_plain,_round:_round,_text:_text,_dashed:_dashed,shouldAddSpace:shouldAddSpace,handleClick:handleClick}=((props,emit)=>{useDeprecated({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},computed(()=>"text"===props.type));const buttonGroupContext=inject(buttonGroupContextKey,void 0),globalConfig2=useGlobalConfig("button"),{form:form}=useFormItem(),_size=useFormSize(computed(()=>buttonGroupContext?.size)),_disabled=useFormDisabled(),_ref=ref(),slots=useSlots(),_type=computed(()=>props.type||buttonGroupContext?.type||globalConfig2.value?.type||""),autoInsertSpace=computed(()=>props.autoInsertSpace??globalConfig2.value?.autoInsertSpace??!1),_plain=computed(()=>props.plain??globalConfig2.value?.plain??!1),_round=computed(()=>props.round??globalConfig2.value?.round??!1),_text=computed(()=>props.text??globalConfig2.value?.text??!1),_dashed=computed(()=>props.dashed??globalConfig2.value?.dashed??!1),_props=computed(()=>"button"===props.tag?{ariaDisabled:_disabled.value||props.loading,disabled:_disabled.value||props.loading,autofocus:props.autofocus,type:props.nativeType}:{}),shouldAddSpace=computed(()=>{const defaultSlot=slots.default?.();if(autoInsertSpace.value&&1===defaultSlot?.length){const slot=defaultSlot[0];if(slot?.type===Text){const text=slot.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(text.trim())}}return!1});return{_disabled:_disabled,_size:_size,_type:_type,_ref:_ref,_props:_props,_plain:_plain,_round:_round,_text:_text,_dashed:_dashed,shouldAddSpace:shouldAddSpace,handleClick:evt=>{_disabled.value||props.loading?evt.stopPropagation():("reset"===props.nativeType&&form?.resetFields(),emit("click",evt))}}})(props,emit),buttonKls=computed(()=>[ns.b(),ns.m(_type.value),ns.m(_size.value),ns.is("disabled",_disabled.value),ns.is("loading",props.loading),ns.is("plain",_plain.value),ns.is("round",_round.value),ns.is("circle",props.circle),ns.is("text",_text.value),ns.is("dashed",_dashed.value),ns.is("link",props.link),ns.is("has-bg",props.bg)]);return __expose({ref:_ref,size:_size,type:_type,disabled:_disabled,shouldAddSpace:shouldAddSpace}),(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(__props.tag),mergeProps({ref_key:"_ref",ref:_ref},unref(_props),{class:buttonKls.value,style:unref(buttonStyle),onClick:unref(handleClick)}),{default:withCtx(()=>[__props.loading?(openBlock(),createElementBlock(Fragment,{key:0},[_ctx.$slots.loading?renderSlot(_ctx.$slots,"loading",{key:0}):(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass(unref(ns).is("loading"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.loadingIcon)))]),_:1},8,["class"]))],64)):__props.icon||_ctx.$slots.icon?(openBlock(),createBlock(unref(ElIcon),{key:1},{default:withCtx(()=>[__props.icon?(openBlock(),createBlock(resolveDynamicComponent(__props.icon),{key:0})):renderSlot(_ctx.$slots,"icon",{key:1})]),_:3})):createCommentVNode("v-if",!0),_ctx.$slots.default?(openBlock(),createElementBlock("span",{key:2,class:normalizeClass({[unref(ns).em("text","expand")]:unref(shouldAddSpace)})},[renderSlot(_ctx.$slots,"default")],2)):createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var button_group_default=/* @__PURE__ */defineComponent({name:"ElButtonGroup",__name:"button-group",props:{size:buttonProps.size,type:buttonProps.type,direction:{type:String,values:["horizontal","vertical"],default:"horizontal"}},setup(__props){const props=__props;provide(buttonGroupContextKey,reactive({size:toRef(props,"size"),type:toRef(props,"type")}));const ns=useNamespace("button");return(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(ns).b("group"),unref(ns).bm("group",props.direction)])},[renderSlot(_ctx.$slots,"default")],2))}});const ElButton=withInstall(button_default,{ButtonGroup:button_group_default});withNoopInstall(button_group_default);var hasRequiredDayjs_min,dayjs_min$1={exports:{}};hasRequiredDayjs_min||(hasRequiredDayjs_min=1,dayjs_min$1.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h2="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t2){var e2=["th","st","nd","rd"],n2=t2%100;return"["+t2+(e2[(n2-20)%10]||e2[n2]||e2[0])+"]"}},m=function(t2,e2,n2){var r2=String(t2);return!r2||r2.length>=e2?t2:""+Array(e2+1-r2.length).join(n2)+t2},v={s:m,z:function(t2){var e2=-t2.utcOffset(),n2=Math.abs(e2),r2=Math.floor(n2/60),i2=n2%60;return(e2<=0?"+":"-")+m(r2,2,"0")+":"+m(i2,2,"0")},m:function t2(e2,n2){if(e2.date()<n2.date())return-t2(n2,e2);var r2=12*(n2.year()-e2.year())+(n2.month()-e2.month()),i2=e2.clone().add(r2,c),s2=n2-i2<0,u2=e2.clone().add(r2+(s2?-1:1),c);return+(-(r2+(n2-i2)/(s2?i2-u2:u2-i2))||0)},a:function(t2){return t2<0?Math.ceil(t2)||0:Math.floor(t2)},p:function(t2){return{M:c,y:h2,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t2]||String(t2||"").toLowerCase().replace(/s$/,"")},u:function(t2){return void 0===t2}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t2){return t2 instanceof _||!(!t2||!t2[p])},w=function t2(e2,n2,r2){var i2;if(!e2)return g;if("string"==typeof e2){var s2=e2.toLowerCase();D[s2]&&(i2=s2),n2&&(D[s2]=n2,i2=s2);var u2=e2.split("-");if(!i2&&u2.length>1)return t2(u2[0])}else{var a2=e2.name;D[a2]=e2,i2=a2}return!r2&&i2&&(g=i2),i2||!r2&&g},O=function(t2,e2){if(S(t2))return t2.clone();var n2="object"==typeof e2?e2:{};return n2.date=t2,n2.args=arguments,new _(n2)},b=v;b.l=w,b.i=S,b.w=function(t2,e2){return O(t2,{locale:e2.$L,utc:e2.$u,x:e2.$x,$offset:e2.$offset})};var _=function(){function M2(t2){this.$L=w(t2.locale,null,!0),this.parse(t2),this.$x=this.$x||t2.x||{},this[p]=!0}var m2=M2.prototype;return m2.parse=function(t2){this.$d=function(t3){var e2=t3.date,n2=t3.utc;if(null===e2)/* @__PURE__ */return new Date(NaN);if(b.u(e2))/* @__PURE__ */return new Date;if(e2 instanceof Date)return new Date(e2);if("string"==typeof e2&&!/Z$/i.test(e2)){var r2=e2.match($);if(r2){var i2=r2[2]-1||0,s2=(r2[7]||"0").substring(0,3);return n2?new Date(Date.UTC(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s2)):new Date(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s2)}}return new Date(e2)}(t2),this.init()},m2.init=function(){var t2=this.$d;this.$y=t2.getFullYear(),this.$M=t2.getMonth(),this.$D=t2.getDate(),this.$W=t2.getDay(),this.$H=t2.getHours(),this.$m=t2.getMinutes(),this.$s=t2.getSeconds(),this.$ms=t2.getMilliseconds()},m2.$utils=function(){return b},m2.isValid=function(){return!(this.$d.toString()===l)},m2.isSame=function(t2,e2){var n2=O(t2);return this.startOf(e2)<=n2&&n2<=this.endOf(e2)},m2.isAfter=function(t2,e2){return O(t2)<this.startOf(e2)},m2.isBefore=function(t2,e2){return this.endOf(e2)<O(t2)},m2.$g=function(t2,e2,n2){return b.u(t2)?this[e2]:this.set(n2,t2)},m2.unix=function(){return Math.floor(this.valueOf()/1e3)},m2.valueOf=function(){return this.$d.getTime()},m2.startOf=function(t2,e2){var n2=this,r2=!!b.u(e2)||e2,f2=b.p(t2),l2=function(t3,e3){var i2=b.w(n2.$u?Date.UTC(n2.$y,e3,t3):new Date(n2.$y,e3,t3),n2);return r2?i2:i2.endOf(a)},$2=function(t3,e3){return b.w(n2.toDate()[t3].apply(n2.toDate("s"),(r2?[0,0,0,0]:[23,59,59,999]).slice(e3)),n2)},y2=this.$W,M3=this.$M,m3=this.$D,v2="set"+(this.$u?"UTC":"");switch(f2){case h2:return r2?l2(1,0):l2(31,11);case c:return r2?l2(1,M3):l2(0,M3+1);case o:var g2=this.$locale().weekStart||0,D2=(y2<g2?y2+7:y2)-g2;return l2(r2?m3-D2:m3+(6-D2),M3);case a:case d:return $2(v2+"Hours",0);case u:return $2(v2+"Minutes",1);case s:return $2(v2+"Seconds",2);case i:return $2(v2+"Milliseconds",3);default:return this.clone()}},m2.endOf=function(t2){return this.startOf(t2,!1)},m2.$set=function(t2,e2){var n2,o2=b.p(t2),f2="set"+(this.$u?"UTC":""),l2=(n2={},n2[a]=f2+"Date",n2[d]=f2+"Date",n2[c]=f2+"Month",n2[h2]=f2+"FullYear",n2[u]=f2+"Hours",n2[s]=f2+"Minutes",n2[i]=f2+"Seconds",n2[r]=f2+"Milliseconds",n2)[o2],$2=o2===a?this.$D+(e2-this.$W):e2;if(o2===c||o2===h2){var y2=this.clone().set(d,1);y2.$d[l2]($2),y2.init(),this.$d=y2.set(d,Math.min(this.$D,y2.daysInMonth())).$d}else l2&&this.$d[l2]($2);return this.init(),this},m2.set=function(t2,e2){return this.clone().$set(t2,e2)},m2.get=function(t2){return this[b.p(t2)]()},m2.add=function(r2,f2){var d2,l2=this;r2=Number(r2);var $2=b.p(f2),y2=function(t2){var e2=O(l2);return b.w(e2.date(e2.date()+Math.round(t2*r2)),l2)};if($2===c)return this.set(c,this.$M+r2);if($2===h2)return this.set(h2,this.$y+r2);if($2===a)return y2(1);if($2===o)return y2(7);var M3=(d2={},d2[s]=e,d2[u]=n,d2[i]=t,d2)[$2]||1,m3=this.$d.getTime()+r2*M3;return b.w(m3,this)},m2.subtract=function(t2,e2){return this.add(-1*t2,e2)},m2.format=function(t2){var e2=this,n2=this.$locale();if(!this.isValid())return n2.invalidDate||l;var r2=t2||"YYYY-MM-DDTHH:mm:ssZ",i2=b.z(this),s2=this.$H,u2=this.$m,a2=this.$M,o2=n2.weekdays,c2=n2.months,f2=n2.meridiem,h3=function(t3,n3,i3,s3){return t3&&(t3[n3]||t3(e2,r2))||i3[n3].slice(0,s3)},d2=function(t3){return b.s(s2%12||12,t3,"0")},$2=f2||function(t3,e3,n3){var r3=t3<12?"AM":"PM";return n3?r3.toLowerCase():r3};return r2.replace(y,function(t3,r3){return r3||function(t4){switch(t4){case"YY":return String(e2.$y).slice(-2);case"YYYY":return b.s(e2.$y,4,"0");case"M":return a2+1;case"MM":return b.s(a2+1,2,"0");case"MMM":return h3(n2.monthsShort,a2,c2,3);case"MMMM":return h3(c2,a2);case"D":return e2.$D;case"DD":return b.s(e2.$D,2,"0");case"d":return String(e2.$W);case"dd":return h3(n2.weekdaysMin,e2.$W,o2,2);case"ddd":return h3(n2.weekdaysShort,e2.$W,o2,3);case"dddd":return o2[e2.$W];case"H":return String(s2);case"HH":return b.s(s2,2,"0");case"h":return d2(1);case"hh":return d2(2);case"a":return $2(s2,u2,!0);case"A":return $2(s2,u2,!1);case"m":return String(u2);case"mm":return b.s(u2,2,"0");case"s":return String(e2.$s);case"ss":return b.s(e2.$s,2,"0");case"SSS":return b.s(e2.$ms,3,"0");case"Z":return i2}return null}(t3)||i2.replace(":","")})},m2.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m2.diff=function(r2,d2,l2){var $2,y2=this,M3=b.p(d2),m3=O(r2),v2=(m3.utcOffset()-this.utcOffset())*e,g2=this-m3,D2=function(){return b.m(y2,m3)};switch(M3){case h2:$2=D2()/12;break;case c:$2=D2();break;case f:$2=D2()/3;break;case o:$2=(g2-v2)/6048e5;break;case a:$2=(g2-v2)/864e5;break;case u:$2=g2/n;break;case s:$2=g2/e;break;case i:$2=g2/t;break;default:$2=g2}return l2?$2:b.a($2)},m2.daysInMonth=function(){return this.endOf(c).$D},m2.$locale=function(){return D[this.$L]},m2.locale=function(t2,e2){if(!t2)return this.$L;var n2=this.clone(),r2=w(t2,e2,!0);return r2&&(n2.$L=r2),n2},m2.clone=function(){return b.w(this.$d,this)},m2.toDate=function(){return new Date(this.valueOf())},m2.toJSON=function(){return this.isValid()?this.toISOString():null},m2.toISOString=function(){return this.$d.toISOString()},m2.toString=function(){return this.$d.toUTCString()},M2}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h2],["$D",d]].forEach(function(t2){k[t2[1]]=function(e2){return this.$g(e2,t2[0],t2[1])}}),O.extend=function(t2,e2){return t2.$i||(t2(e2,_,O),t2.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t2){return O(1e3*t2)},O.en=D[g],O.Ls=D,O.p={},O}());const checkboxProps={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:{type:Boolean,default:void 0},checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:useSizeProp,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},ariaLabel:String,...useAriaProps(["ariaControls"])},checkboxEmits={[UPDATE_MODEL_EVENT]:val=>isString(val)||isNumber(val)||isBoolean(val),change:val=>isString(val)||isNumber(val)||isBoolean(val)},checkboxGroupContextKey=/* @__PURE__ */Symbol("checkboxGroupContextKey"),checkboxGroupProps=buildProps({modelValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:void 0},min:Number,max:Number,size:useSizeProp,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},options:{type:Array},props:{type:Object,default:()=>checkboxDefaultProps},type:{type:String,values:["checkbox","button"],default:"checkbox"},...useAriaProps(["ariaLabel"])}),checkboxGroupEmits={[UPDATE_MODEL_EVENT]:val=>isArray$1(val),change:val=>isArray$1(val)},checkboxDefaultProps={label:"label",value:"value",disabled:"disabled"},useCheckboxEvent=(props,{model:model,isLimitExceeded:isLimitExceeded,hasOwnLabel:hasOwnLabel,isDisabled:isDisabled,isLabeledByFormItem:isLabeledByFormItem})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),{formItem:formItem}=useFormItem(),{emit:emit}=getCurrentInstance();function getLabeledValue(value){return[!0,props.trueValue,props.trueLabel].includes(value)?props.trueValue??props.trueLabel??!0:props.falseValue??props.falseLabel??!1}const validateEvent=computed(()=>checkboxGroup?.validateEvent||props.validateEvent);return watch(()=>props.modelValue,()=>{validateEvent.value&&formItem?.validate("change").catch(err=>debugWarn(err))}),{handleChange:function(e){if(isLimitExceeded.value)return;const target=e.target;emit("change",getLabeledValue(target.checked),e)},onClickRoot:async function(e){isLimitExceeded.value||hasOwnLabel.value||isDisabled.value||!isLabeledByFormItem.value||e.composedPath().some(item=>"LABEL"===item.tagName)||(model.value=getLabeledValue([!1,props.falseValue,props.falseLabel].includes(model.value)),await nextTick(),function(checked,e){emit("change",getLabeledValue(checked),e)}(model.value,e))}}},useCheckbox=(props,slots)=>{const{formItem:elFormItem}=useFormItem(),{model:model,isGroup:isGroup,isLimitExceeded:isLimitExceeded}=(props=>{const selfModel=ref(!1),{emit:emit}=getCurrentInstance(),checkboxGroup=inject(checkboxGroupContextKey,void 0),isGroup=computed(()=>!1===isUndefined(checkboxGroup)),isLimitExceeded=ref(!1),model=computed({get:()=>isGroup.value?checkboxGroup?.modelValue?.value:props.modelValue??selfModel.value,set(val){isGroup.value&&isArray$1(val)?(isLimitExceeded.value=void 0!==checkboxGroup?.max?.value&&val.length>checkboxGroup?.max.value&&val.length>model.value.length,!1===isLimitExceeded.value&&checkboxGroup?.changeEvent?.(val)):(emit("update:modelValue",val),selfModel.value=val)}});return{model:model,isGroup:isGroup,isLimitExceeded:isLimitExceeded}})(props),{isFocused:isFocused,isChecked:isChecked,checkboxButtonSize:checkboxButtonSize,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,actualValue:actualValue}=((props,slots,{model:model})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),isFocused=ref(!1),actualValue=computed(()=>isPropAbsent(props.value)?props.label:props.value),isChecked=computed(()=>{const value=model.value;return isBoolean(value)?value:isArray$1(value)?isObject$2(actualValue.value)?value.map(toRaw).some(o=>isEqual(o,actualValue.value)):value.map(toRaw).includes(actualValue.value):null!=value?value===props.trueValue||value===props.trueLabel:!!value});return{checkboxButtonSize:useFormSize(computed(()=>checkboxGroup?.size?.value),{prop:!0}),isChecked:isChecked,isFocused:isFocused,checkboxSize:useFormSize(computed(()=>checkboxGroup?.size?.value)),hasOwnLabel:computed(()=>!!slots.default||!isPropAbsent(actualValue.value)),actualValue:actualValue}})(props,slots,{model:model}),{isDisabled:isDisabled}=(({model:model,isChecked:isChecked})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),formContext=inject(formContextKey,void 0),isLimitDisabled=computed(()=>{const max=checkboxGroup?.max?.value,min=checkboxGroup?.min?.value;return!isUndefined(max)&&model.value.length>=max&&!isChecked.value||!isUndefined(min)&&model.value.length<=min&&isChecked.value});return{isDisabled:useFormDisabled(computed(()=>void 0===checkboxGroup?formContext?.disabled??isLimitDisabled.value:checkboxGroup.disabled?.value||isLimitDisabled.value)),isLimitDisabled:isLimitDisabled}})({model:model,isChecked:isChecked}),{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem}=useFormItemInputId(props,{formItemContext:elFormItem,disableIdGeneration:hasOwnLabel,disableIdManagement:isGroup}),{handleChange:handleChange,onClickRoot:onClickRoot}=useCheckboxEvent(props,{model:model,isLimitExceeded:isLimitExceeded,hasOwnLabel:hasOwnLabel,isDisabled:isDisabled,isLabeledByFormItem:isLabeledByFormItem});return props.checked&&(isArray$1(model.value)&&!model.value.includes(actualValue.value)?model.value.push(actualValue.value):model.value=props.trueValue??props.trueLabel??!0),useDeprecated({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>isGroup.value&&isPropAbsent(props.value))),useDeprecated({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>!!props.trueLabel)),useDeprecated({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>!!props.falseLabel)),{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem,isChecked:isChecked,isDisabled:isDisabled,isFocused:isFocused,checkboxButtonSize:checkboxButtonSize,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,model:model,actualValue:actualValue,handleChange:handleChange,onClickRoot:onClickRoot}},_hoisted_1$9=["id","indeterminate","name","tabindex","disabled"];var checkbox_default=/* @__PURE__ */defineComponent({name:"ElCheckbox",__name:"checkbox",props:checkboxProps,emits:checkboxEmits,setup(__props){const props=__props,{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem,isChecked:isChecked,isDisabled:isDisabled,isFocused:isFocused,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,model:model,actualValue:actualValue,handleChange:handleChange,onClickRoot:onClickRoot}=useCheckbox(props,useSlots()),inputBindings=computed(()=>props.trueValue||props.falseValue||props.trueLabel||props.falseLabel?{"true-value":props.trueValue??props.trueLabel??!0,"false-value":props.falseValue??props.falseLabel??!1}:{value:actualValue.value}),ns=useNamespace("checkbox"),compKls=computed(()=>[ns.b(),ns.m(checkboxSize.value),ns.is("disabled",isDisabled.value),ns.is("bordered",props.border),ns.is("checked",isChecked.value)]),spanKls=computed(()=>[ns.e("input"),ns.is("disabled",isDisabled.value),ns.is("checked",isChecked.value),ns.is("indeterminate",props.indeterminate),ns.is("focus",isFocused.value)]);return(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(!unref(hasOwnLabel)&&unref(isLabeledByFormItem)?"span":"label"),{for:!unref(hasOwnLabel)&&unref(isLabeledByFormItem)?null:unref(inputId),class:normalizeClass(compKls.value),"aria-controls":__props.indeterminate?__props.ariaControls:null,"aria-checked":__props.indeterminate?"mixed":void 0,"aria-label":__props.ariaLabel,onClick:unref(onClickRoot)},{default:withCtx(()=>[createElementVNode("span",{class:normalizeClass(spanKls.value)},[withDirectives(createElementVNode("input",mergeProps({id:unref(inputId),"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(model)?model.value=$event:null),class:unref(ns).e("original"),type:"checkbox",indeterminate:__props.indeterminate,name:__props.name,tabindex:__props.tabindex,disabled:unref(isDisabled)},inputBindings.value,{onChange:_cache[1]||(_cache[1]=(...args)=>unref(handleChange)&&unref(handleChange)(...args)),onFocus:_cache[2]||(_cache[2]=$event=>isFocused.value=!0),onBlur:_cache[3]||(_cache[3]=$event=>isFocused.value=!1),onClick:_cache[4]||(_cache[4]=withModifiers(()=>{},["stop"]))}),null,16,_hoisted_1$9),[[vModelCheckbox,unref(model)]]),createElementVNode("span",{class:normalizeClass(unref(ns).e("inner"))},null,2)],2),unref(hasOwnLabel)?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(ns).e("label"))},[renderSlot(_ctx.$slots,"default"),_ctx.$slots.default?createCommentVNode("v-if",!0):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(__props.label),1)],64))],2)):createCommentVNode("v-if",!0)]),_:3},8,["for","class","aria-controls","aria-checked","aria-label","onClick"]))}});const _hoisted_1$8=["name","tabindex","disabled"];var checkbox_button_default=/* @__PURE__ */defineComponent({name:"ElCheckboxButton",__name:"checkbox-button",props:checkboxProps,emits:checkboxEmits,setup(__props){const props=__props,{isFocused:isFocused,isChecked:isChecked,isDisabled:isDisabled,checkboxButtonSize:checkboxButtonSize,model:model,actualValue:actualValue,handleChange:handleChange}=useCheckbox(props,useSlots()),inputBindings=computed(()=>props.trueValue||props.falseValue||props.trueLabel||props.falseLabel?{"true-value":props.trueValue??props.trueLabel??!0,"false-value":props.falseValue??props.falseLabel??!1}:{value:actualValue.value}),checkboxGroup=inject(checkboxGroupContextKey,void 0),ns=useNamespace("checkbox"),activeStyle=computed(()=>{const fillValue=checkboxGroup?.fill?.value??"";return{backgroundColor:fillValue,borderColor:fillValue,color:checkboxGroup?.textColor?.value??"",boxShadow:fillValue?`-1px 0 0 0 ${fillValue}`:void 0}}),labelKls=computed(()=>[ns.b("button"),ns.bm("button",checkboxButtonSize.value),ns.is("disabled",isDisabled.value),ns.is("checked",isChecked.value),ns.is("focus",isFocused.value)]);return(_ctx,_cache)=>(openBlock(),createElementBlock("label",{class:normalizeClass(labelKls.value)},[withDirectives(createElementVNode("input",mergeProps({"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(model)?model.value=$event:null),class:unref(ns).be("button","original"),type:"checkbox",name:__props.name,tabindex:__props.tabindex,disabled:unref(isDisabled)},inputBindings.value,{onChange:_cache[1]||(_cache[1]=(...args)=>unref(handleChange)&&unref(handleChange)(...args)),onFocus:_cache[2]||(_cache[2]=$event=>isFocused.value=!0),onBlur:_cache[3]||(_cache[3]=$event=>isFocused.value=!1),onClick:_cache[4]||(_cache[4]=withModifiers(()=>{},["stop"]))}),null,16,_hoisted_1$8),[[vModelCheckbox,unref(model)]]),_ctx.$slots.default||__props.label?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(ns).be("button","inner")),style:normalizeStyle(unref(isChecked)?activeStyle.value:void 0)},[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(__props.label),1)])],6)):createCommentVNode("v-if",!0)],2))}}),checkbox_group_vue_vue_type_script_setup_true_lang_default=/* @__PURE__ */defineComponent({name:"ElCheckboxGroup",__name:"checkbox-group",props:checkboxGroupProps,emits:checkboxGroupEmits,setup(__props,{emit:__emit}){const props=__props,emit=__emit,ns=useNamespace("checkbox"),checkboxDisabled=useFormDisabled(),{formItem:formItem}=useFormItem(),{inputId:groupId,isLabeledByFormItem:isLabeledByFormItem}=useFormItemInputId(props,{formItemContext:formItem}),changeEvent=async value=>{emit("update:modelValue",value),await nextTick(),emit("change",value)},modelValue=computed({get:()=>props.modelValue,set(val){changeEvent(val)}}),aliasProps=computed(()=>({...checkboxDefaultProps,...props.props})),optionComponent=computed(()=>"button"===props.type?checkbox_button_default:checkbox_default);return provide(checkboxGroupContextKey,{...pick(toRefs(props),["size","min","max","validateEvent","fill","textColor"]),disabled:checkboxDisabled,modelValue:modelValue,changeEvent:changeEvent}),watch(()=>props.modelValue,(newVal,oldValue)=>{props.validateEvent&&!isEqual(newVal,oldValue)&&formItem?.validate("change").catch(err=>debugWarn(err))}),(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(__props.tag),{id:unref(groupId),class:normalizeClass(unref(ns).b("group")),role:"group","aria-label":unref(isLabeledByFormItem)?void 0:__props.ariaLabel||"checkbox-group","aria-labelledby":unref(isLabeledByFormItem)?unref(formItem)?.labelId:void 0},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.options,(item,index)=>(openBlock(),createBlock(resolveDynamicComponent(optionComponent.value),mergeProps({key:index},{ref_for:!0},(option=>{const{label:label,value:value,disabled:disabled}=aliasProps.value,base={label:option[label],value:option[value],disabled:option[disabled]};return{...omit(option,[label,value,disabled]),...base}})(item)),null,16))),128))])]),_:3},8,["id","class","aria-label","aria-labelledby"]))}}),checkbox_group_default=checkbox_group_vue_vue_type_script_setup_true_lang_default;const ElCheckbox=withInstall(checkbox_default,{CheckboxButton:checkbox_button_default,CheckboxGroup:checkbox_group_default});withNoopInstall(checkbox_button_default);withNoopInstall(checkbox_group_default);const composeRefs=(...refs)=>el=>{refs.forEach(ref2=>{ref2.value=el})},dropdownProps=buildProps({trigger:{...useTooltipTriggerProps.trigger,type:[String,Array]},triggerKeys:{type:Array,default:()=>[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space,EVENT_CODE.down]},virtualTriggering:useTooltipTriggerProps.virtualTriggering,virtualRef:useTooltipTriggerProps.virtualRef,effect:{...useTooltipContentProps.effect,default:"light"},type:{type:String},placement:{type:String,default:"bottom"},popperOptions:{type:Object,default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:[Number,String],default:0},maxHeight:{type:[Number,String],default:""},popperClass:useTooltipContentProps.popperClass,popperStyle:useTooltipContentProps.popperStyle,disabled:Boolean,role:{type:String,values:roleTypes,default:"menu"},buttonProps:{type:Object},teleported:useTooltipContentProps.teleported,appendTo:useTooltipContentProps.appendTo,persistent:{type:Boolean,default:!0}}),dropdownItemProps=buildProps({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:iconPropType}}),dropdownMenuProps=buildProps({onKeydown:{type:Function}}),DROPDOWN_INJECTION_KEY=/* @__PURE__ */Symbol("elDropdown");var collection_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({inheritAttrs:!1}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]]);var collection_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElCollectionItem",inheritAttrs:!1}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]]);const COLLECTION_ITEM_SIGN="data-el-collection-item",rovingFocusGroupProps=buildProps({style:{type:[String,Array,Object]},currentTabId:{type:String},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:String},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:ElCollection,ElCollectionItem:ElCollectionItem,COLLECTION_INJECTION_KEY:COLLECTION_INJECTION_KEY,COLLECTION_ITEM_INJECTION_KEY:COLLECTION_ITEM_INJECTION_KEY}=(name=>{const COLLECTION_NAME=`El${name}Collection`,COLLECTION_ITEM_NAME=`${COLLECTION_NAME}Item`,COLLECTION_INJECTION_KEY2=Symbol(COLLECTION_NAME),COLLECTION_ITEM_INJECTION_KEY2=Symbol(COLLECTION_ITEM_NAME);return{COLLECTION_INJECTION_KEY:COLLECTION_INJECTION_KEY2,COLLECTION_ITEM_INJECTION_KEY:COLLECTION_ITEM_INJECTION_KEY2,ElCollection:Object.assign({},collection_default,{name:COLLECTION_NAME,setup(){const collectionRef=ref(),itemMap=/* @__PURE__ */new Map;provide(COLLECTION_INJECTION_KEY2,{itemMap:itemMap,getItems:()=>{const collectionEl=unref(collectionRef);if(!collectionEl)return[];const orderedNodes=Array.from(collectionEl.querySelectorAll("[data-el-collection-item]"));return[...itemMap.values()].sort((a,b)=>orderedNodes.indexOf(a.ref)-orderedNodes.indexOf(b.ref))},collectionRef:collectionRef})}}),ElCollectionItem:Object.assign({},collection_item_default,{name:COLLECTION_ITEM_NAME,setup(_,{attrs:attrs}){const collectionItemRef=ref(),collectionInjection=inject(COLLECTION_INJECTION_KEY2,void 0);provide(COLLECTION_ITEM_INJECTION_KEY2,{collectionItemRef:collectionItemRef}),onMounted(()=>{const collectionItemEl=unref(collectionItemRef);collectionItemEl&&collectionInjection.itemMap.set(collectionItemEl,{ref:collectionItemEl,...attrs})}),onBeforeUnmount(()=>{const collectionItemEl=unref(collectionItemRef);collectionInjection.itemMap.delete(collectionItemEl)})}})}})("RovingFocusGroup"),ROVING_FOCUS_GROUP_INJECTION_KEY=/* @__PURE__ */Symbol("elRovingFocusGroup"),ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY=/* @__PURE__ */Symbol("elRovingFocusGroupItem"),MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},focusFirst=elements=>{const{activeElement:prevActive}=document;for(const element of elements){if(element===prevActive)return;if(element.focus(),prevActive!==document.activeElement)return}},EVT_OPTS={bubbles:!1,cancelable:!0};var roving_focus_group_impl_vue_vue_type_script_lang_default=defineComponent({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:rovingFocusGroupProps,emits:["currentTabIdChange","entryFocus"],setup(props,{emit:emit}){const currentTabbedId=ref((props.currentTabId||props.defaultCurrentTabId)??null),isBackingOut=ref(!1),isClickFocus=ref(!1),rovingFocusGroupRef=ref(),{getItems:getItems}=inject(COLLECTION_INJECTION_KEY,void 0),rovingFocusGroupRootStyle=computed(()=>[{outline:"none"},props.style]),onMousedown=composeEventHandlers(e=>{props.onMousedown?.(e)},()=>{isClickFocus.value=!0}),onFocus=composeEventHandlers(e=>{props.onFocus?.(e)},e=>{const isKeyboardFocus=!unref(isClickFocus),{target:target,currentTarget:currentTarget}=e;if(target===currentTarget&&isKeyboardFocus&&!unref(isBackingOut)){const entryFocusEvt=new Event("rovingFocusGroup.entryFocus",EVT_OPTS);if(currentTarget?.dispatchEvent(entryFocusEvt),!entryFocusEvt.defaultPrevented){const items=getItems().filter(item=>item.focusable);focusFirst([items.find(item=>item.active),items.find(item=>item.id===unref(currentTabbedId)),...items].filter(Boolean).map(item=>item.ref))}}isClickFocus.value=!1}),onBlur=composeEventHandlers(e=>{props.onBlur?.(e)},()=>{isBackingOut.value=!1});provide(ROVING_FOCUS_GROUP_INJECTION_KEY,{currentTabbedId:readonly(currentTabbedId),loop:toRef(props,"loop"),tabIndex:computed(()=>unref(isBackingOut)?-1:0),rovingFocusGroupRef:rovingFocusGroupRef,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,orientation:toRef(props,"orientation"),dir:toRef(props,"dir"),onItemFocus:tabbedId=>{emit("currentTabIdChange",tabbedId)},onItemShiftTab:()=>{isBackingOut.value=!0},onBlur:onBlur,onFocus:onFocus,onMousedown:onMousedown,onKeydown:e=>{const focusIntent=(event=>{const key=getEventCode(event);return MAP_KEY_TO_FOCUS_INTENT[key]})(e);if(focusIntent){e.preventDefault();let elements=getItems().filter(item=>item.focusable).map(item=>item.ref);switch(focusIntent){case"last":elements.reverse();break;case"prev":case"next":{"prev"===focusIntent&&elements.reverse();const currentIdx=elements.indexOf(e.currentTarget);elements=props.loop?(atIdx=currentIdx+1,(array=elements).map((_,idx)=>array[(idx+atIdx)%array.length])):elements.slice(currentIdx+1);break}}nextTick(()=>{focusFirst(elements)})}var array,atIdx}}),watch(()=>props.currentTabId,val=>{currentTabbedId.value=val??null}),useEventListener(rovingFocusGroupRef,"rovingFocusGroup.entryFocus",(...args)=>{emit("entryFocus",...args)})}});var roving_focus_group_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:ElCollection,ElRovingFocusGroupImpl:/* @__PURE__ */_plugin_vue_export_helper_default(roving_focus_group_impl_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]])}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_group_impl=resolveComponent("el-roving-focus-group-impl"),_component_el_focus_group_collection=resolveComponent("el-focus-group-collection");return openBlock(),createBlock(_component_el_focus_group_collection,null,{default:withCtx(()=>[createVNode(_component_el_roving_focus_group_impl,normalizeProps(guardReactiveProps(_ctx.$attrs)),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16)]),_:3})}]]);var roving_focus_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({components:{ElRovingFocusCollectionItem:ElCollectionItem},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(props,{emit:emit}){const{currentTabbedId:currentTabbedId,onItemFocus:onItemFocus,onItemShiftTab:onItemShiftTab,onKeydown:onKeydown}=inject(ROVING_FOCUS_GROUP_INJECTION_KEY,void 0),id=useId(),rovingFocusGroupItemRef=ref(),handleMousedown=composeEventHandlers(e=>{emit("mousedown",e)},e=>{props.focusable?onItemFocus(unref(id)):e.preventDefault()}),handleFocus=composeEventHandlers(e=>{emit("focus",e)},()=>{onItemFocus(unref(id))}),handleKeydown=composeEventHandlers(e=>{emit("keydown",e)},e=>{const{shiftKey:shiftKey,target:target,currentTarget:currentTarget}=e;getEventCode(e)===EVENT_CODE.tab&&shiftKey?onItemShiftTab():target===currentTarget&&onKeydown(e)}),isCurrentTab=computed(()=>currentTabbedId.value===unref(id));return provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,{rovingFocusGroupItemRef:rovingFocusGroupItemRef,tabIndex:computed(()=>unref(isCurrentTab)?0:-1),handleMousedown:handleMousedown,handleFocus:handleFocus,handleKeydown:handleKeydown}),{id:id,handleKeydown:handleKeydown,handleFocus:handleFocus,handleMousedown:handleMousedown}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_collection_item=resolveComponent("el-roving-focus-collection-item");return openBlock(),createBlock(_component_el_roving_focus_collection_item,{id:_ctx.id,focusable:_ctx.focusable,active:_ctx.active},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","focusable","active"])}]]),roving_focus_group_default$1=roving_focus_group_default;const{ButtonGroup:ElButtonGroup}=ElButton;var dropdown_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElDropdown",components:{ElButton:ElButton,ElButtonGroup:ElButtonGroup,ElScrollbar:ElScrollbar,ElTooltip:ElTooltip,ElRovingFocusGroup:roving_focus_group_default$1,ElOnlyChild:OnlyChild,ElIcon:ElIcon,ArrowDown:arrow_down_default},props:dropdownProps,emits:["visible-change","click","command"],setup(props,{emit:emit}){const _instance=getCurrentInstance(),ns=useNamespace("dropdown"),{t:t}=useLocale(),triggeringElementRef=ref(),referenceElementRef=ref(),popperRef=ref(),contentRef=ref(),scrollbar=ref(null),currentTabId=ref(null),isUsingKeyboard=ref(!1),wrapStyle=computed(()=>({maxHeight:addUnit(props.maxHeight)})),dropdownTriggerKls=computed(()=>[ns.m(dropdownSize.value)]),trigger=computed(()=>function(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]}(props.trigger)),defaultTriggerId=useId().value,triggerId=computed(()=>props.id||defaultTriggerId);function handleClose(){popperRef.value?.onClose()}const dropdownSize=useFormSize();provide(DROPDOWN_INJECTION_KEY,{contentRef:contentRef,role:computed(()=>props.role),triggerId:triggerId,isUsingKeyboard:isUsingKeyboard,onItemEnter:function(){},onItemLeave:function(){const contentEl=unref(contentRef);trigger.value.includes("hover")&&contentEl?.focus({preventScroll:!0}),currentTabId.value=null},handleClose:handleClose}),provide("elDropdown",{instance:_instance,dropdownSize:dropdownSize,handleClick:function(){popperRef.value?.onClose(void 0,0)},commandHandler:function(...args){emit("command",...args)},trigger:toRef(props,"trigger"),hideOnClick:toRef(props,"hideOnClick")});return{t:t,ns:ns,scrollbar:scrollbar,wrapStyle:wrapStyle,dropdownTriggerKls:dropdownTriggerKls,dropdownSize:dropdownSize,triggerId:triggerId,currentTabId:currentTabId,handleCurrentTabIdChange:function(id){currentTabId.value=id},handlerMainButtonClick:event=>{emit("click",event)},handleClose:handleClose,handleOpen:function(){popperRef.value?.onOpen()},handleBeforeShowTooltip:function(){emit("visible-change",!0)},handleShowTooltip:function(event){isUsingKeyboard.value="keydown"===event?.type,contentRef.value?.focus()},handleBeforeHideTooltip:function(){emit("visible-change",!1)},popperRef:popperRef,contentRef:contentRef,triggeringElementRef:triggeringElementRef,referenceElementRef:referenceElementRef}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_group=resolveComponent("el-roving-focus-group"),_component_el_scrollbar=resolveComponent("el-scrollbar"),_component_el_only_child=resolveComponent("el-only-child"),_component_el_tooltip=resolveComponent("el-tooltip"),_component_el_button=resolveComponent("el-button"),_component_arrow_down=resolveComponent("arrow-down"),_component_el_icon=resolveComponent("el-icon"),_component_el_button_group=resolveComponent("el-button-group");return openBlock(),createElementBlock("div",{class:normalizeClass([_ctx.ns.b(),_ctx.ns.is("disabled",_ctx.disabled)])},[createVNode(_component_el_tooltip,{ref:"popperRef",role:_ctx.role,effect:_ctx.effect,"fallback-placements":["bottom","top"],"popper-options":_ctx.popperOptions,"gpu-acceleration":!1,placement:_ctx.placement,"popper-class":[_ctx.ns.e("popper"),_ctx.popperClass],"popper-style":_ctx.popperStyle,trigger:_ctx.trigger,"trigger-keys":_ctx.triggerKeys,"trigger-target-el":_ctx.contentRef,"show-arrow":_ctx.showArrow,"show-after":"hover"===_ctx.trigger?_ctx.showTimeout:0,"hide-after":"hover"===_ctx.trigger?_ctx.hideTimeout:0,"virtual-ref":_ctx.virtualRef??_ctx.triggeringElementRef,"virtual-triggering":_ctx.virtualTriggering||_ctx.splitButton,disabled:_ctx.disabled,transition:`${_ctx.ns.namespace.value}-zoom-in-top`,teleported:_ctx.teleported,"append-to":_ctx.appendTo,pure:"","focus-on-target":"",persistent:_ctx.persistent,onBeforeShow:_ctx.handleBeforeShowTooltip,onShow:_ctx.handleShowTooltip,onBeforeHide:_ctx.handleBeforeHideTooltip},createSlots({content:withCtx(()=>[createVNode(_component_el_scrollbar,{ref:"scrollbar","wrap-style":_ctx.wrapStyle,tag:"div","view-class":_ctx.ns.e("list")},{default:withCtx(()=>[createVNode(_component_el_roving_focus_group,{loop:_ctx.loop,"current-tab-id":_ctx.currentTabId,orientation:"horizontal",onCurrentTabIdChange:_ctx.handleCurrentTabIdChange},{default:withCtx(()=>[renderSlot(_ctx.$slots,"dropdown")]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange"])]),_:3},8,["wrap-style","view-class"])]),_:2},[_ctx.splitButton?void 0:{name:"default",fn:withCtx(()=>[createVNode(_component_el_only_child,{id:_ctx.triggerId,ref:"triggeringElementRef",role:"button",tabindex:_ctx.tabindex},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","tabindex"])]),key:"0"}]),1032,["role","effect","popper-options","placement","popper-class","popper-style","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","append-to","persistent","onBeforeShow","onShow","onBeforeHide"]),_ctx.splitButton?(openBlock(),createBlock(_component_el_button_group,{key:0},{default:withCtx(()=>[createVNode(_component_el_button,mergeProps({ref:"referenceElementRef"},_ctx.buttonProps,{size:_ctx.dropdownSize,type:_ctx.type,disabled:_ctx.disabled,tabindex:_ctx.tabindex,onClick:_ctx.handlerMainButtonClick}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),createVNode(_component_el_button,mergeProps({id:_ctx.triggerId,ref:"triggeringElementRef"},_ctx.buttonProps,{role:"button",size:_ctx.dropdownSize,type:_ctx.type,class:_ctx.ns.e("caret-button"),disabled:_ctx.disabled,tabindex:_ctx.tabindex,"aria-label":_ctx.t("el.dropdown.toggleDropdown")}),{default:withCtx(()=>[createVNode(_component_el_icon,{class:normalizeClass(_ctx.ns.e("icon"))},{default:withCtx(()=>[createVNode(_component_arrow_down)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):createCommentVNode("v-if",!0)],2)}]]),dropdown_item_impl_vue_vue_type_script_lang_default=defineComponent({name:"DropdownItemImpl",components:{ElIcon:ElIcon},props:dropdownItemProps,emits:["pointermove","pointerleave","click","clickimpl"],setup(_,{emit:emit}){const ns=useNamespace("dropdown"),{role:menuRole}=inject(DROPDOWN_INJECTION_KEY,void 0),{collectionItemRef:rovingFocusCollectionItemRef}=inject(COLLECTION_ITEM_INJECTION_KEY,void 0),{rovingFocusGroupItemRef:rovingFocusGroupItemRef,tabIndex:tabIndex,handleFocus:handleFocus,handleKeydown:handleItemKeydown,handleMousedown:handleMousedown}=inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,void 0),itemRef=composeRefs(rovingFocusCollectionItemRef,rovingFocusGroupItemRef),role=computed(()=>"menu"===menuRole.value?"menuitem":"navigation"===menuRole.value?"link":"button"),handleKeydown=composeEventHandlers(e=>{const code=getEventCode(e);if([EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space].includes(code))return e.preventDefault(),e.stopImmediatePropagation(),emit("clickimpl",e),!0},handleItemKeydown);return{ns:ns,itemRef:itemRef,dataset:{[COLLECTION_ITEM_SIGN]:""},role:role,tabIndex:tabIndex,handleFocus:handleFocus,handleKeydown:handleKeydown,handleMousedown:handleMousedown}}});const _hoisted_1$7=["aria-disabled","tabindex","role"];const useDropdown=()=>{const elDropdown=inject("elDropdown",{});return{elDropdown:elDropdown,_elDropdownSize:computed(()=>elDropdown?.dropdownSize)}};var dropdown_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElDropdownItem",components:{ElRovingFocusItem:roving_focus_item_default,ElDropdownItemImpl:/* @__PURE__ */_plugin_vue_export_helper_default(dropdown_item_impl_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_icon=resolveComponent("el-icon");return openBlock(),createElementBlock(Fragment,null,[_ctx.divided?(openBlock(),createElementBlock("li",{key:0,role:"separator",class:normalizeClass(_ctx.ns.bem("menu","item","divided"))},null,2)):createCommentVNode("v-if",!0),createElementVNode("li",mergeProps({ref:_ctx.itemRef},{..._ctx.dataset,..._ctx.$attrs},{"aria-disabled":_ctx.disabled,class:[_ctx.ns.be("menu","item"),_ctx.ns.is("disabled",_ctx.disabled)],tabindex:_ctx.tabIndex,role:_ctx.role,onClick:_cache[0]||(_cache[0]=e=>_ctx.$emit("clickimpl",e)),onFocus:_cache[1]||(_cache[1]=(...args)=>_ctx.handleFocus&&_ctx.handleFocus(...args)),onKeydown:_cache[2]||(_cache[2]=withModifiers((...args)=>_ctx.handleKeydown&&_ctx.handleKeydown(...args),["self"])),onMousedown:_cache[3]||(_cache[3]=(...args)=>_ctx.handleMousedown&&_ctx.handleMousedown(...args)),onPointermove:_cache[4]||(_cache[4]=e=>_ctx.$emit("pointermove",e)),onPointerleave:_cache[5]||(_cache[5]=e=>_ctx.$emit("pointerleave",e))}),[_ctx.icon||_ctx.$slots.icon?(openBlock(),createBlock(_component_el_icon,{key:0},{default:withCtx(()=>[renderSlot(_ctx.$slots,"icon",{},()=>[(openBlock(),createBlock(resolveDynamicComponent(_ctx.icon)))])]),_:3})):createCommentVNode("v-if",!0),renderSlot(_ctx.$slots,"default")],16,_hoisted_1$7)],64)}]])},inheritAttrs:!1,props:dropdownItemProps,emits:["pointermove","pointerleave","click"],setup(props,{emit:emit,attrs:attrs}){const{elDropdown:elDropdown}=useDropdown(),_instance=getCurrentInstance(),{onItemEnter:onItemEnter,onItemLeave:onItemLeave}=inject(DROPDOWN_INJECTION_KEY,void 0),handlePointerMove=composeEventHandlers(e=>(emit("pointermove",e),e.defaultPrevented),whenMouse(e=>{if(props.disabled)return void onItemLeave(e);const target=e.currentTarget;target===document.activeElement||target.contains(document.activeElement)||(onItemEnter(e),e.defaultPrevented||target?.focus({preventScroll:!0}))})),handlePointerLeave=composeEventHandlers(e=>(emit("pointerleave",e),e.defaultPrevented),whenMouse(onItemLeave));return{handleClick:composeEventHandlers(e=>{if(!props.disabled)return emit("click",e),"keydown"!==e.type&&e.defaultPrevented},e=>{props.disabled?e.stopImmediatePropagation():(elDropdown?.hideOnClick?.value&&elDropdown.handleClick?.(),elDropdown.commandHandler?.(props.command,_instance,e))}),handlePointerMove:handlePointerMove,handlePointerLeave:handlePointerLeave,propsAndAttrs:computed(()=>({...props,...attrs}))}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_dropdown_item_impl=resolveComponent("el-dropdown-item-impl"),_component_el_roving_focus_item=resolveComponent("el-roving-focus-item");return openBlock(),createBlock(_component_el_roving_focus_item,{focusable:!_ctx.disabled},{default:withCtx(()=>[createVNode(_component_el_dropdown_item_impl,mergeProps(_ctx.propsAndAttrs,{onPointerleave:_ctx.handlePointerLeave,onPointermove:_ctx.handlePointerMove,onClickimpl:_ctx.handleClick}),createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:2},[_ctx.$slots.icon?{name:"icon",fn:withCtx(()=>[renderSlot(_ctx.$slots,"icon")]),key:"0"}:void 0]),1040,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])}]]),dropdown_menu_vue_vue_type_script_lang_default=defineComponent({name:"ElDropdownMenu",props:dropdownMenuProps,setup(props){const ns=useNamespace("dropdown"),{_elDropdownSize:_elDropdownSize}=useDropdown(),size=_elDropdownSize.value,{contentRef:contentRef,role:role,triggerId:triggerId,isUsingKeyboard:isUsingKeyboard,handleClose:handleClose}=inject(DROPDOWN_INJECTION_KEY,void 0),{rovingFocusGroupRef:rovingFocusGroupRef,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,onBlur:onBlur,onFocus:onFocus,onKeydown:onKeydown,onMousedown:onMousedown}=inject(ROVING_FOCUS_GROUP_INJECTION_KEY,void 0),{collectionRef:rovingFocusGroupCollectionRef}=inject(COLLECTION_INJECTION_KEY,void 0),dropdownKls=computed(()=>[ns.b("menu"),ns.bm("menu",size?.value)]),dropdownListWrapperRef=composeRefs(contentRef,rovingFocusGroupRef,rovingFocusGroupCollectionRef),handleKeydown=composeEventHandlers(e=>{props.onKeydown?.(e)},e=>{const{currentTarget:currentTarget,target:target}=e,code=getEventCode(e);if(currentTarget.contains(target),EVENT_CODE.tab===code)return handleClose();onKeydown(e)});return{size:size,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,dropdownKls:dropdownKls,role:role,triggerId:triggerId,dropdownListWrapperRef:dropdownListWrapperRef,handleKeydown:handleKeydown,onBlur:onBlur,handleFocus:function(e){isUsingKeyboard.value&&onFocus(e)},onMousedown:onMousedown}}});const _hoisted_1$6=["role","aria-labelledby"];var dropdown_menu_default=/* @__PURE__ */_plugin_vue_export_helper_default(dropdown_menu_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("ul",{ref:_ctx.dropdownListWrapperRef,class:normalizeClass(_ctx.dropdownKls),style:normalizeStyle(_ctx.rovingFocusGroupRootStyle),tabindex:-1,role:_ctx.role,"aria-labelledby":_ctx.triggerId,onFocusin:_cache[0]||(_cache[0]=(...args)=>_ctx.handleFocus&&_ctx.handleFocus(...args)),onFocusout:_cache[1]||(_cache[1]=(...args)=>_ctx.onBlur&&_ctx.onBlur(...args)),onKeydown:_cache[2]||(_cache[2]=withModifiers((...args)=>_ctx.handleKeydown&&_ctx.handleKeydown(...args),["self"])),onMousedown:_cache[3]||(_cache[3]=withModifiers((...args)=>_ctx.onMousedown&&_ctx.onMousedown(...args),["self"]))},[renderSlot(_ctx.$slots,"default")],46,_hoisted_1$6)}]]);const ElDropdown=withInstall(dropdown_default,{DropdownItem:dropdown_item_default,DropdownMenu:dropdown_menu_default}),ElDropdownItem=withNoopInstall(dropdown_item_default),ElDropdownMenu=withNoopInstall(dropdown_menu_default),messageTypes=["primary","success","info","warning","error"],messagePlacement=["top","top-left","top-right","bottom","bottom-left","bottom-right"],messageDefaults={customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0},messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:[String,Object,Function],default:messageDefaults.message},onClose:{type:Function,default:messageDefaults.onClose},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},plain:{type:Boolean,default:messageDefaults.plain},offset:{type:Number,default:messageDefaults.offset},placement:{type:String,values:messagePlacement,default:messageDefaults.placement},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),placementInstances=shallowReactive({}),getLastOffset=(id,placement)=>{const{prev:prev}=((id,placement)=>{const instances=placementInstances[placement]||[],idx=instances.findIndex(instance=>instance.id===id),current=instances[idx];let prev;return idx>0&&(prev=instances[idx-1]),{current:current,prev:prev}})(id,placement);return prev?prev.vm.exposed.bottom.value:0},_hoisted_1$5=["id"],_hoisted_2$3=["innerHTML"];var message_default=/* @__PURE__ */defineComponent({name:"ElMessage",__name:"message",props:messageProps,emits:{destroy:()=>!0},setup(__props,{expose:__expose,emit:__emit}){const{Close:Close}=TypeComponents,props=__props,emit=__emit,isStartTransition=ref(!1),{ns:ns,zIndex:zIndex2}=function(block,sizeFallback){const config=useGlobalConfig(),ns=useNamespace(block,computed(()=>config.value?.namespace||"el")),locale=useLocale(computed(()=>config.value?.locale)),zIndex2=useZIndex(computed(()=>config.value?.zIndex||2e3)),size=computed(()=>unref(sizeFallback)||config.value?.size||"");return provideGlobalConfig(computed(()=>unref(config)||{})),{ns:ns,locale:locale,zIndex:zIndex2,size:size}}("message"),{currentZIndex:currentZIndex,nextZIndex:nextZIndex}=zIndex2,messageRef=ref(),visible=ref(!1),height=ref(0);let stopTimer;const badgeType=computed(()=>props.type?"error"===props.type?"danger":props.type:"info"),typeClass=computed(()=>{const type=props.type;return{[ns.bm("icon",type)]:type&&TypeComponentsMap[type]}}),iconComponent=computed(()=>props.icon||TypeComponentsMap[props.type]||""),placement=computed(()=>props.placement||"top"),lastOffset=computed(()=>getLastOffset(props.id,placement.value)),offset=computed(()=>((id,offset,placement)=>(placementInstances[placement]||[]).findIndex(instance=>instance.id===id)>0?16:offset)(props.id,props.offset,placement.value)+lastOffset.value),bottom=computed(()=>height.value+offset.value),horizontalClass=computed(()=>placement.value.includes("left")?ns.is("left"):placement.value.includes("right")?ns.is("right"):ns.is("center")),verticalProperty=computed(()=>placement.value.startsWith("top")?"top":"bottom"),customStyle=computed(()=>({[verticalProperty.value]:`${offset.value}px`,zIndex:currentZIndex.value}));function startTimer(){0!==props.duration&&({stop:stopTimer}=function(cb,interval,options={}){const{immediate:immediate=!0}=options,isPending=ref(!1);let timer=null;function clear(){timer&&(clearTimeout(timer),timer=null)}function stop(){isPending.value=!1,clear()}function start(...args){clear(),isPending.value=!0,timer=setTimeout(()=>{isPending.value=!1,timer=null,cb(...args)},toValue(interval))}return immediate&&(isPending.value=!0,isClient&&start()),tryOnScopeDispose(stop),{isPending:readonly(isPending),start:start,stop:stop}}(()=>{close2()},props.duration))}function clearTimer(){stopTimer?.()}function close2(){visible.value=!1,nextTick(()=>{isStartTransition.value||(props.onClose?.(),emit("destroy"))})}return onMounted(()=>{startTimer(),nextZIndex(),visible.value=!0}),watch(()=>props.repeatNum,()=>{clearTimer(),startTimer()}),useEventListener(document,"keydown",function(event){getEventCode(event)===EVENT_CODE.esc&&close2()}),useResizeObserver(messageRef,()=>{height.value=messageRef.value.getBoundingClientRect().height}),__expose({visible:visible,bottom:bottom,close:close2}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:unref(ns).b("fade"),onBeforeEnter:_cache[0]||(_cache[0]=$event=>isStartTransition.value=!0),onBeforeLeave:__props.onClose,onAfterLeave:_cache[1]||(_cache[1]=$event=>_ctx.$emit("destroy")),persisted:""},{default:withCtx(()=>[withDirectives(createElementVNode("div",{id:__props.id,ref_key:"messageRef",ref:messageRef,class:normalizeClass([unref(ns).b(),{[unref(ns).m(__props.type)]:__props.type},unref(ns).is("closable",__props.showClose),unref(ns).is("plain",__props.plain),unref(ns).is("bottom","bottom"===verticalProperty.value),horizontalClass.value,__props.customClass]),style:normalizeStyle(customStyle.value),role:"alert",onMouseenter:clearTimer,onMouseleave:startTimer},[__props.repeatNum>1?(openBlock(),createBlock(unref(ElBadge),{key:0,value:__props.repeatNum,type:badgeType.value,class:normalizeClass(unref(ns).e("badge"))},null,8,["value","type","class"])):createCommentVNode("v-if",!0),iconComponent.value?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(ns).e("icon"),typeClass.value])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(iconComponent.value)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),renderSlot(_ctx.$slots,"default",{},()=>[__props.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),createElementVNode("p",{class:normalizeClass(unref(ns).e("content")),innerHTML:__props.message},null,10,_hoisted_2$3)],2112)):(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(unref(ns).e("content"))},toDisplayString(__props.message),3))]),__props.showClose?(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass(unref(ns).e("closeBtn")),onClick:withModifiers(close2,["stop"])},{default:withCtx(()=>[createVNode(unref(Close))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],46,_hoisted_1$5),[[vShow,visible.value]])]),_:3},8,["name","onBeforeLeave"]))}});let seed=1;const normalizeOptions=params=>{const options=!params||isString(params)||isVNode(params)||isFunction$1(params)?{message:params}:params,normalized={...messageDefaults,...options};return(normalized=>{if(normalized.appendTo){if(isString(normalized.appendTo)){let appendTo=document.querySelector(normalized.appendTo);isElement(appendTo)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),appendTo=document.body),normalized.appendTo=appendTo}}else normalized.appendTo=document.body})(normalized),(normalized=>{!normalized.placement&&isString(messageConfig.placement)&&messageConfig.placement&&(normalized.placement=messageConfig.placement),normalized.placement||(normalized.placement="top"),messagePlacement.includes(normalized.placement)||(debugWarn("ElMessage",`Invalid placement: ${normalized.placement}. Falling back to 'top'.`),normalized.placement="top")})(normalized),isBoolean(messageConfig.grouping)&&!normalized.grouping&&(normalized.grouping=messageConfig.grouping),isNumber(messageConfig.duration)&&3e3===normalized.duration&&(normalized.duration=messageConfig.duration),isNumber(messageConfig.offset)&&16===normalized.offset&&(normalized.offset=messageConfig.offset),isBoolean(messageConfig.showClose)&&!normalized.showClose&&(normalized.showClose=messageConfig.showClose),isBoolean(messageConfig.plain)&&!normalized.plain&&(normalized.plain=messageConfig.plain),normalized},createMessage=({appendTo:appendTo,...options},context)=>{const id="message_"+seed++,userOnClose=options.onClose,container=document.createElement("div"),props={...options,id:id,onClose:()=>{userOnClose?.(),(instance=>{const instances=placementInstances[instance.props.placement||"top"],idx=instances.indexOf(instance);if(-1===idx)return;instances.splice(idx,1);const{handler:handler}=instance;handler.close()})(instance)},onDestroy:()=>{render$1(null,container)}},vnode=createVNode(message_default,props,isFunction$1(props.message)||isVNode(props.message)?{default:isFunction$1(props.message)?props.message:()=>props.message}:null);vnode.appContext=context||message._context,render$1(vnode,container),appendTo.appendChild(container.firstElementChild);const vm=vnode.component,instance={id:id,vnode:vnode,vm:vm,handler:{close:()=>{vm.exposed.close()}},props:vnode.component.props};return instance},message=(options={},context)=>{if(!isClient)return{close:()=>{}};const normalized=normalizeOptions(options),instances=(placement=normalized.placement||"top",placementInstances[placement]||(placementInstances[placement]=shallowReactive([])),placementInstances[placement]);var placement;if(normalized.grouping&&instances.length){const instance2=instances.find(({vnode:vm})=>vm.props?.message===normalized.message);if(instance2)return instance2.props.repeatNum+=1,instance2.props.type=normalized.type,instance2.handler}if(isNumber(messageConfig.max)&&instances.length>=messageConfig.max)return{close:()=>{}};const instance=createMessage(normalized,context);return instances.push(instance),instance.handler};messageTypes.forEach(type=>{message[type]=(options={},appContext)=>message({...normalizeOptions(options),type:type},appContext)}),message.closeAll=function(type){for(const placement in placementInstances)if(hasOwn(placementInstances,placement)){const instances=[...placementInstances[placement]];for(const instance of instances)type&&type!==instance.props.type||instance.handler.close()}},message.closeAllByPlacement=function(placement){placementInstances[placement]&&[...placementInstances[placement]].forEach(instance=>instance.handler.close())},message._context=null;const ElMessage=(name="$message",(fn2=message).install=app=>{fn2._context=app._context,app.config.globalProperties[name]=fn2},fn2);var fn2,name;class Debouncing{timeoutId=null;delay;constructor(delay){this.delay=delay}debounce(func){this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{func(),this.timeoutId=null},this.delay)}cancle(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}}function createHtml(tagName,options){const{is:is,style:style,text:text,html:html,parent:parent2}=options??{},element=document.createElement(tagName,{is:is});return style&&Object.assign(element.style,style),text&&(element.innerText=text),html&&(element.innerHTML=html),parent2&&parent2.appendChild(element),element}const _hoisted_1$4={class:"flex items-center flex-1"},_hoisted_2$2={key:0,class:"flashing-ani flex justify-center items-center"},_hoisted_3$2={key:0,class:"m-[10px_0px] flex gap-[20px]"},_hoisted_4$2={key:1,class:"m-[5px_0]"},_hoisted_5$2={class:"grid grid-cols-4 grid-rows-4 gap-[5px] rounded-[6px] overflow-hidden"},_hoisted_6$2={key:1,class:"row-start-3 row-end-5 col-start-4 col-end-4 leading-[88px]!"},_hoisted_7$2={key:3},_export_sfc=(sfc,props)=>{const target=sfc.__vccOpts||sfc;for(const[key,val]of props)target[key]=val;return target},NumberEditor=/* @__PURE__ */_export_sfc(/* @__PURE__ */defineComponent({__name:"NumberEditor",props:/* @__PURE__ */mergeModels({showCancel:{type:Boolean,default:!0},showMax:{type:Boolean,default:!1},showMin:{type:Boolean,default:!1},showConfirm:{type:Boolean,default:!0}},{modelValue:{default:"0"},modelModifiers:{}}),emits:/* @__PURE__ */mergeModels(["confirm","cancel","max","min"],["update:modelValue"]),setup(__props,{emit:__emit}){const keys2=new Array(10).fill(10).map((_,i)=>String(i));function onKeydown(e){keys2.includes(e.key)?value.value+=e.key:"Backspace"===e.key?value.value=value.value.slice(0,value.value.length-1):"Enter"===e.key&&props.showConfirm?emits("confirm",Number(value.value)):"Delete"===e.key?value.value="":"Escape"===e.key&&props.showCancel&&emits("cancel"),e.stopPropagation()}const props=__props,value=useModel(__props,"modelValue",{get:v=>("number"==typeof v&&(v+=""),v),set:v=>Number("00"===v?"0":v.startsWith("0")?v.slice(1):v)}),emits=__emit,isFocus=ref(!1),inputElRef=ref();return onMounted(()=>{setTimeout(()=>inputElRef.value?.focus(),100)}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:"bg-[whitesmoke] p-[10px]",style:normalizeStyle({fontSize:unref(isMobileRef)?"18px":"12px"})},[createElementVNode("div",{ref_key:"inputElRef",ref:inputElRef,onKeydown:onKeydown,onFocus:_cache[0]||(_cache[0]=$event=>isFocus.value=!0),onBlur:_cache[1]||(_cache[1]=$event=>isFocus.value=!1),tabindex:"1",class:"outline-0 w-full p-[5px] rounded-[6px] box-border border-0 bg-white leading-[30px] flex"},[createElementVNode("p",_hoisted_1$4,[createTextVNode(toDisplayString(value.value||"0"),1),isFocus.value?(openBlock(),createElementBlock("span",_hoisted_2$2,"▏")):createCommentVNode("",!0)]),_cache[18]||(_cache[18]=createElementVNode("p",null,"mm",-1))],544),__props.showMin||__props.showMax?(openBlock(),createElementBlock("p",_hoisted_3$2,[__props.showMax?(openBlock(),createElementBlock("button",{key:0,onClick:_cache[2]||(_cache[2]=$event=>emits("max"))},"设置最大值")):createCommentVNode("",!0),__props.showMin?(openBlock(),createElementBlock("button",{key:1,onClick:_cache[3]||(_cache[3]=$event=>emits("min"))},"设置最小值")):createCommentVNode("",!0)])):(openBlock(),createElementBlock("p",_hoisted_4$2)),createElementVNode("ul",_hoisted_5$2,[createElementVNode("li",{onClick:_cache[4]||(_cache[4]=$event=>value.value+="1")},"1"),createElementVNode("li",{onClick:_cache[5]||(_cache[5]=$event=>value.value+="2")},"2"),createElementVNode("li",{onClick:_cache[6]||(_cache[6]=$event=>value.value+="3")},"3"),createElementVNode("li",{onClick:_cache[7]||(_cache[7]=$event=>value.value="")},"清空"),createElementVNode("li",{onClick:_cache[8]||(_cache[8]=$event=>value.value+="4")},"4"),createElementVNode("li",{onClick:_cache[9]||(_cache[9]=$event=>value.value+="5")},"5"),createElementVNode("li",{onClick:_cache[10]||(_cache[10]=$event=>value.value+="6")},"6"),createElementVNode("li",{onClick:_cache[11]||(_cache[11]=$event=>value.value=value.value.slice(0,value.value.length-1))},"✖"),createElementVNode("li",{onClick:_cache[12]||(_cache[12]=$event=>value.value+="7")},"7"),createElementVNode("li",{onClick:_cache[13]||(_cache[13]=$event=>value.value+="8")},"8"),createElementVNode("li",{onClick:_cache[14]||(_cache[14]=$event=>value.value+="9")},"9"),__props.showConfirm?(openBlock(),createElementBlock("li",{key:0,class:"row-start-3 row-end-5 col-start-4 col-end-4 leading-[88px]! confirm",onClick:_cache[15]||(_cache[15]=$event=>emits("confirm",Number(value.value)))},"确认")):(openBlock(),createElementBlock("li",_hoisted_6$2)),createElementVNode("li",{onClick:_cache[16]||(_cache[16]=$event=>value.value+="0"),class:"col-start-1 col-end-3"},"0"),__props.showCancel?(openBlock(),createElementBlock("li",{key:2,onClick:_cache[17]||(_cache[17]=$event=>emits("cancel"))},"取消")):(openBlock(),createElementBlock("li",_hoisted_7$2))])],4))}}),[["__scopeId","data-v-7a78abcb"]]);function createPromise(){let resolve,reject;const promise=new Promise((re2,rt2)=>{resolve=re2,reject=rt2});return{get resolve(){return resolve},get reject(){return reject},get promise(){return promise}}}const customCursor={circle:"url(data:image/svg+xml;base64,PHN2ZyB0PSIxNzc5NzkxMjQ2NjA1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9Ijc5ODkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTUxMiA1MTJtLTMyMCAwYTMyMCAzMjAgMCAxIDAgNjQwIDAgMzIwIDMyMCAwIDEgMC02NDAgMFoiIGZpbGw9IiNmZmZmZmYiIHAtaWQ9Ijc5OTAiPjwvcGF0aD48L3N2Zz4=) 8 8, auto"};class Command extends Component{static interruptKeys=["escape"];static confirmKeys=["enter"];static shortcutKeys=[];get renderer(){return this._renderer||(this._renderer=this.parent?.findComponentByName("Renderer")),this._renderer}get domElement(){return this._domElement||(this._domElement=this.editor?.domContainer?.dialogLayer),this._domElement}get editor(){return this._editor||(this._editor=this.parent?.findComponentByName("Editor")),this._editor}get eventInput(){return this._eventInput||(this._eventInput=this.parent?.findComponentByName("EventInput")),this._eventInput}get renderManager(){return this._renderManager||(this._renderManager=this.parent?.findComponentByName("RenderManager")),this._renderManager}get commandManager(){return this._commandManager||(this._commandManager=this.editor?.commandManager),this._commandManager}get default(){return this._default||(this._default=this.parent?.findComponentByName("DefaultCommand")),this._default}get commandName(){return this.constructor.commandName}get interruptKeys(){return this.constructor.interruptKeys}get shortcutKeys(){return this.constructor.shortcutKeys}get confirmKeys(){return this.constructor.confirmKeys}container=new THREE.Group;constructor(){super(),this.addEventListener("addFromParent",()=>{this.editor.container.add(this.container),this.editor.addEventListener("cancelCommand",()=>{this.cancel()}),this.editor.container.add(this.container)})}initCommandFlow(opt){const{shortcutKeys:shortcutKeys,loop:loop=!1,writeOperationRecord:writeOperationRecord=!0,commandName:commandName=this.commandName,getStartData:getStartData}=opt??{},commandFlow=this.commandManager.addCommandFlow(commandName).add(this.createInterruptHanlder()).addRollback(this.onRollback.bind(this)).addRevokeRollback(this.onRevokeRollback.bind(this)).setLoop(loop);return commandFlow.writeOperationRecord=writeOperationRecord,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.onCompleted(e.data)),shortcutKeys&&(this.eventInput.addKeyCombination(commandName,shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{const data=getStartData?.();this.eventInput.isKeyCombination(commandName)&&await this.commandManager.start(commandName,data)}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(shortcutKeys))),this.commandFlow=commandFlow,commandFlow}onCompleted(_){}onRollback(data){return data}onRevokeRollback(data){return data}onInterrupt(){}cancel(){const commandName=this.commandName||this.constructor.commandName;this.commandManager.currentName===commandName&&(this.commandManager.cancel(),this.onInterrupt())}createInterruptHanlder(){return(next,data)=>{this.addEventRecord("clear",this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyDowns(this.interruptKeys)&&this.cancel()})),next(data)}}get createInterrupt(){return this.createInterruptHanlder.bind(this)}createCursor(cursor){return(next,data)=>{const defaultCursor=this.domElement.style.cursor;this.domElement.style.cursor=cursor,this.addEventRecord("clear",()=>{this.domElement.style.cursor=defaultCursor??"default"}),next(data)}}createFinally(keys2=[]){return()=>{this.cancelEventRecord("clear"),keys2.forEach(k=>this.cancelEventRecord(k))}}formatText(text,color="var(--primary-color)",style=""){return`<span style="color: ${color};${style}">${text}</span>`}setCursor(cursor){this.domElement.style.cursor=customCursor[cursor]||cursor}COMMAND_END_NAME="clear";addCommandEndHandle(...cancels){return this.addEventRecord(this.COMMAND_END_NAME,...cancels)}buttonSimulation(keys2){queueMicrotask(()=>{const variable=this.parent?.findComponentByType(Variable);keys2.forEach(k=>{variable?.set("currentKeyDown",k)}),queueMicrotask(()=>{keys2.forEach(k=>{variable?.set("currentKeyUp",k)})})})}baseNormalLine=new LineSegment;pointLineConstraint(point,baseLine,normalStartPoint,baseNormalLine){if(!baseNormalLine&&normalStartPoint){const normal=baseLine.normal();baseNormalLine=this.baseNormalLine.set(normalStartPoint.clone().add(normal.clone().multiplyScalar(10)),normalStartPoint.clone().add(normal.multiplyScalar(-10)))}const point1=baseLine.projectPoint(point,!1);if(!baseNormalLine)return point1&&point.copy(point1),point;const point2=baseNormalLine.projectPoint(point,!1);return point1&&point2?point.distance(point1)<point.distance(point2)?point.copy(point1):point.copy(point2):point1?point.copy(point1):point2&&point.copy(point2),point}createPointFollowMove(callBack,opt={}){const editor=this.editor,currentPoint=new Point;let globalCenterPoint=null,baseLine=null,baseNormalLine=null;const quadtree=opt.targetLines&&Quadtree.from(opt.targetLines),cancelEvent=editor.addEventListener("pointerPositionChange",()=>{const pointerPosition=Point.from(editor.pointerPosition);if(globalCenterPoint&&editor.eventInput.isKeyDown("shift")){Math.abs(pointerPosition.x-globalCenterPoint.x)>Math.abs(pointerPosition.y-globalCenterPoint.y)?currentPoint.set(pointerPosition.x,globalCenterPoint.y):currentPoint.set(globalCenterPoint.x,pointerPosition.y),callBack(currentPoint,!1)}else if(baseLine&&baseNormalLine&&editor.eventInput.isKeyDown("alt")){const point1=baseLine.projectPoint(pointerPosition,!1),point2=baseNormalLine.projectPoint(pointerPosition,!1);point1&&point2?pointerPosition.distance(point1)<pointerPosition.distance(point2)?currentPoint.copy(point1):currentPoint.copy(point2):point1?currentPoint.copy(point1):point2&¤tPoint.copy(point2),callBack(currentPoint,!1)}else{const{point:point,find:find,line:line2,mode:mode}=editor.renderManager.auxiliaryLineAdsorption(null,quadtree);currentPoint.copy(point),callBack(currentPoint,find,line2,mode)}});return{destroy(){cancelEvent()},setBaseLine(line2,point){if(baseLine=line2,globalCenterPoint=point,line2&&point){const direction=line2.normal();baseNormalLine=new LineSegment(point.clone().add(direction.clone().multiplyScalar(10)),point.clone().add(direction.multiplyScalar(-10)))}else baseNormalLine=null}}}createPointSelector(opt){const getPoint=async mode_=>{if(ended)throw new Error("顶点选择器已经结束,无法继续使用");return mode=mode_,new Promise(resolve=>{resolve_=resolve;const eventClose=this.editor.domEventRegister.addEventListener("click",()=>{point&&!ended&&(mode="null",this.domElement.style.cursor=cursor,resolve({point:Point.from(point),line:line2}),resolve_=null,eventClose())})})},end=()=>{ended||(ended=!0,handle.destroy(),pointMesh.removeFromParent(),resolve_&&resolve_(null),editor.renderManager.setAuxiliaryLineVisible(!1))},{onMove:onMove,targetLines:targetLines,eventRecordNames:eventRecordNames=[]}=opt??{},editor=this.editor,pointMesh=this.renderer.createCircle(new Point(0,0),{size:8,color:65280},this.container);let line2,resolve_,cursor=this.domElement.style.cursor,mode="null",point=null,ended=!1;pointMesh.position.z=.005,pointMesh.visible=!1;const handle=this.createPointFollowMove((p,isAdsorb,l,m)=>{point=null,"null"!==mode&&(line2=l,m||(m="empty"),"all"===mode&&(point=new THREE.Vector3(p.x,p.y,0)),!point&&mode.indexOf(m)>-1&&(point=new THREE.Vector3(p.x,p.y,0))),this.domElement.style.cursor=isAdsorb?"none":cursor,point?(pointMesh.position.copy(point),"none"!==this.domElement.style.cursor&&(cursor=this.domElement.style.cursor),pointMesh.visible=!0):pointMesh.visible=!1,onMove&&onMove(point)},{targetLines:targetLines});return this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],end),{get ended(){return ended},end:end,next:getPoint,setBaseLine(line3,point2){if("all"!==mode)throw new Error("线段方向约束只有在mode等于all时才能设置");handle.setBaseLine(line3,point2)},points:mode_=>({async next(){if(!ended){const result=await getPoint(mode_);if(result)return{value:result,done:!1}}return{value:null,done:!0}},[Symbol.asyncIterator](){return this}}),async awaitEach(callBack,mode_="all"){for await(const result of this.points(mode_))callBack(result);return this}}}createDragPoint(point,opt={}){const{onChange:onChange,onStart:onStart,onEnd:onEnd,onEnter:onEnter,onLeave:onLeave,onClick:onClick,onDblClick:onDblClick,size:size,onLongTouch:onLongTouch,style:style,auxiliaryLine:auxiliaryLine=!1}=opt;point=point.clone();const div=document.createElement("div"),defaultWidth=size?size+"px":isMobileRef.value?"20px":"10px",debouncing=new Debouncing(800),object3D=this.renderer.createText("",point,{position:"absolute",background:"rgba(255,255,255, 0.4)",borderRadius:"100px",width:defaultWidth,height:defaultWidth,pointerEvents:"all",cursor:"move",transition:"0.25s background",border:"solid 1px #fff",...style},this.container);createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:`calc(${defaultWidth} * 1.3)`,height:"1px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"1px",height:`calc(${defaultWidth} * 1.3)`,background:"white",borderRadius:"100px",pointerEvents:"none"}});const move=e=>{e instanceof TouchEvent&&this.editor.domEventRegister.updatePointer(e);const opt2=auxiliaryLine?this.renderManager.auxiliaryLineAdsorption():this.renderManager.adsorption(),{point:pos,line:line2}=opt2;line2?(object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth):(object3D.element.style.width="2px",object3D.element.style.height="2px"),object3D.position.x=pos.x,object3D.position.y=pos.y,point.copy(pos),onChange&&onChange(point,opt2),debouncing.cancle(),e?.stopPropagation(),e?.preventDefault()},mouseup=e=>{object3D.element.style.pointerEvents="all",object3D.element.style.background="rgba(255,255,255, 0.4)",object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth,isMobileRef.value?(object3D.element.removeEventListener("touchmove",move),object3D.element.removeEventListener("touchend",mouseup)):(document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",mouseup),e?.stopPropagation()),e&&onEnd&&setTimeout(()=>onEnd(point),100),debouncing.cancle()},start=()=>{object3D.element.style.background="#00ff00",object3D.element.style.width="2px",object3D.element.style.height="2px",isMobileRef.value?(object3D.element.addEventListener("touchmove",move),object3D.element.addEventListener("touchend",mouseup)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",mouseup)),onStart&&onStart(point),onLongTouch&&debouncing.debounce(()=>(mouseup(null),onLongTouch()))};isMobileRef.value?object3D.element.addEventListener("pointerdown",start):(object3D.element.addEventListener("mousedown",e=>{start(),e.stopPropagation(),e.preventDefault()}),object3D.element.addEventListener("mouseenter",()=>onEnter&&onEnter()),object3D.element.addEventListener("mouseleave",()=>onLeave&&onLeave())),onClick&&object3D.element.addEventListener("click",onClick),onDblClick&&object3D.element.addEventListener("dblclick",onDblClick);return{dragPointMesh:object3D,destroy:()=>{div.remove(),object3D.removeFromParent()},setPoint(point2){point2 instanceof Point?object3D.position.set(point2.x,point2.y,object3D.position.z):object3D.position.copy(point2)}}}createClickPoint(point,onClick){const div=document.createElement("div"),object3D=this.renderer.createText("",point,{position:"absolute",background:"rgb(255,255,255)",borderRadius:"100px",width:"10px",height:"10px",pointerEvents:"all",cursor:"pointer",transition:"0.25s background"},this.container);object3D.element.addEventListener("mousedown",e=>{onClick(),e.stopPropagation(),e.preventDefault()});return()=>{div.remove(),object3D.removeFromParent()}}awaitOnlyKeys(keys2,options={}){const{condition:condition,once:once=!0,eventRecordNames:eventRecordNames=[]}=options;let loopResolve;const{resolve:resolve,promise:promise}=createPromise(),cancelEvent=this.eventInput.addEventListener("codeChange",()=>{if(this.eventInput.isOnlyKeyDowns(keys2)){if(condition&&!condition())return;once?(resolve(!0),cancelEvent()):loopResolve(!0)}});return this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],cancelEvent),Object.assign(promise,{cancel:cancelEvent,[Symbol.asyncIterator]:()=>({async next(){{const{resolve:resolve2,promise:promise2}=createPromise();loopResolve=resolve2;const result=await promise2;if(result)return{value:result,done:!1}}return{value:void 0,done:!0}}}),async awaitEach(callBack){for await(const _ of this)callBack();return this}})}createVueApp(com,props,parent2=this.domElement){const div=document.createElement("div");div.style.zIndex="20",parent2.appendChild(div);const app=createApp(com,props);return app.mount(div),()=>{app.unmount(),div.remove()}}openWidthEditor(opt){let{defaultWidth:defaultWidth=0,maxWidth:maxWidth=1/0,minWidth:minWidth=0,title:title,showMin:showMin=!1,showMax:showMax=!1,showCancel:showCancel=!1,eventRecordNames:eventRecordNames=[]}=opt??{};minWidth=Number(minWidth.toFixed(0)),maxWidth=Number(maxWidth.toFixed(0)),"number"==typeof maxWidth&&(defaultWidth=Math.min(maxWidth,defaultWidth)),"number"==typeof minWidth&&(defaultWidth=Math.max(minWidth,defaultWidth)),defaultWidth=Number(defaultWidth.toFixed(0));const{resolve:resolve,promise:promise}=createPromise();function onConfirm(value){return value<minWidth?ElMessage({message:`宽度不能小于${minWidth}mm`,type:"warning"}):maxWidth&&value>maxWidth?ElMessage({message:`宽度不能大于${maxWidth} mm, 不然将会穿透依附的墙壁`,type:"warning"}):(destroy(),void resolve(value))}function close2(){ended||(ended=!0,destroy())}const width=ref(defaultWidth+""),destroy=this.createVueApp(function(){return createVNode("div",{class:{"z-20 absolute left-0 top-0 w-full h-full flex flex-col":!0," justify-center items-center bg-[rgba(0,0,0,0.5)]":!isMobileRef.value},onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation(),onPointerup:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation()},[isMobileRef.value&&createVNode("div",{class:"flex-1 pointer-events-none"},null),createVNode("div",{class:{"w-[400px] rounded-[8px] overflow-hidden":!isMobileRef.value}},[title&&createVNode("div",{class:"bg-white p-[10px] text-center text-[16px]"},[createVNode("h4",null,[title])]),createVNode(Transition,{name:"slide-fade"},{default:()=>[createVNode(NumberEditor,{showMax:showMax,showMin:showMin,showCancel:showCancel,onConfirm:onConfirm,onCancel:()=>onConfirm(defaultWidth),onMax:()=>width.value=String(maxWidth),onMin:()=>width.value=String(minWidth),modelValue:width.value,"onUpdate:modelValue":$event=>width.value=$event},null)]})])])});this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],close2);let ended=!1;return Object.assign(promise,{promise:promise,close:close2,get ended(){return ended}})}openLinePointEditor(point,line2){const uuid_=uuid(),context=this,{resolve:resolve,promise:promise}=createPromise();function onConfirm(){end(),resolve(point)}function updateData(){const helpLine1=new LineSegment(point,line2.start),len1=helpLine1.length;text1.setText(mToMm(len1)+"mm");let center=helpLine1.center;text1.position.set(center.x,center.y,0),num1Text.visible=len1>1e-9;const helpLine2=new LineSegment(point,line2.end),len2=helpLine2.length;text2.setText(mToMm(len2)+"mm"),center=helpLine2.center,text2.position.set(center.x,center.y,0),num2Text.visible=len2>1e-9,pointMesh.position.set(point.x,point.y,.05)}const group=new THREE.Group;context.container.add(group);const style={background:"var(--primary-color)",width:"20px",lineHeight:"20px",textAlign:"center",borderRadius:"100px"},num1Text=context.renderer.createText("1",line2.start,style,group),num2Text=context.renderer.createText("2",line2.end,style,group),pointMesh=context.renderer.createCircle(Point.zero(),{color:65280},group),text1=context.createEditButton({parent:group,onClick:async()=>{let width=mToMm(point.distance(line2.start));const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width,maxWidth:1e3*line2.length,minWidth:0,showMax:!0});this.addEventRecord(uuid_,close2),width=await promise2;const direct=line2.end.directionFrom(line2.start);point.copy(line2.start).add(direct.multiplyScalar(width/1e3)),updateData()}}),text2=context.createEditButton({parent:group,onClick:async()=>{let width=mToMm(point.distance(line2.end));const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width,maxWidth:1e3*line2.length,minWidth:0,showMax:!0});this.addEventRecord(uuid_,close2),width=await promise2;const direct=line2.start.directionFrom(line2.end);point.copy(line2.end).add(direct.multiplyScalar(width/1e3)),updateData()}});updateData();const destroy=context.createVueApp(function(){return createVNode("div",{class:" pointer-events-none z-18 absolute left-0 top-0 w-full h-full flex flex-col",onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode("div",{class:"flex-1"},null),createVNode("div",{class:"bg-white p-0 text-center text-[16px] pointer-events-auto"},[createVNode("h4",{class:"border-b border-b-[#ccc] leading-[40px]"},[createTextVNode("落点位置确认")]),createVNode("div",{class:"p-[40px]"},[createVNode("button",{onClick:onConfirm,class:"bg-(--primary-color) p-[5px_40px] outline-0 border-0 active:grayscale-75 rounded-[6px] text-white"},[createTextVNode("确认")]),createVNode("p",{class:"mt-[10px] text-[red] text-[12px]"},[createTextVNode("* 请点击距离数字后可修改两侧边距")])])])])});let ended=!1;const end=()=>{ended||(this.cancelEventRecord(uuid_),destroy(),group.clear(),group.removeFromParent(),ended=!0)};return Object.assign(promise,{promise:promise,close:end,get ended(){return ended}})}createButton(opt){const{text:text,onClick:onClick,visible:visible=!0,position:position,style:style,freedom:freedom,parent:parent2=this.container,eventRecordNames:eventRecordNames=[]}=opt??{},textMesh=this.renderer.createText("",Point.zero(),{},parent2);position instanceof Point?textMesh.position.set(position.x,position.y,0):position instanceof THREE.Vector3&&textMesh.position.copy(position);let element=textMesh.element;return freedom&&(element=document.createElement("div"),element.style.position="absolute",textMesh.element.appendChild(element)),Object.assign(element.style,{pointerEvents:"all",background:"var(--primary-color)",padding:"2px 5px",borderRadius:"6px",cursor:"pointer",...style}),element.classList.add("button"),textMesh.visible=visible,text&&(element.innerHTML=text),onClick&&(isMobileRef.value?element.addEventListener("click",onClick):element.addEventListener("mousedown",onClick)),this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],()=>{textMesh.removeFromParent()}),Object.assign(textMesh,{domElement:element,setText(text2){element.innerHTML=text2},setPosition(position2){position2 instanceof Point?textMesh.position.set(position2.x,position2.y,0):position2 instanceof THREE.Vector3&&textMesh.position.copy(position2)},setPositionByTwoPointCenter(point1,point2){point1=Point.from(point1),point2=Point.from(point2),this.setPosition(point1.add(point2).multiplyScalar(.5))}})}createEditButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg fill="#fff" viewBox="0 0 1088 1024" width="18" height="18"><path d="M289.728 752a40.32 40.32 0 0 0 5.952-0.512l168.192-29.44a9.792 9.792 0 0 0 5.312-2.816l423.936-423.936c3.84-3.84 3.84-10.24 0-14.08l-166.208-166.336a9.92 9.92 0 0 0-7.104-2.88 9.92 9.92 0 0 0-7.104 2.88L288.832 538.88a10.176 10.176 0 0 0-2.816 5.312l-29.504 168.192a33.92 33.92 0 0 0 33.216 39.68zM357.12 577.6l362.688-362.624 73.28 73.344-362.688 362.56-88.96 15.744 15.68-89.024z m554.88 258.368H176a32 32 0 0 0-32 32v36.032c0 4.416 3.584 8 8 8h784a8 8 0 0 0 8-8v-36.032a32 32 0 0 0-32-32z"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}createCloseButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center",background:"red"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2578" width="18" height="18"><path d="M572.91974805 512l242.82096754-242.82096757c16.30246778-16.30246778 16.30246778-43.75925563 0-60.91974802-16.30246778-16.30246778-43.75925563-16.30246778-60.91974802 0L512 451.08025195 269.17903243 208.25928441c-16.30246778-16.30246778-43.75925563-16.30246778-60.91974802 0-16.30246778 16.30246778-16.30246778 43.75925563 0 60.91974802L451.08025195 512l-242.82096754 242.82096757c-16.30246778 16.30246778-16.30246778 43.75925563 0 60.91974802 16.30246778 16.30246778 43.75925563 16.30246778 60.91974802 0l242.82096757-242.82096754 242.82096757 242.82096754c16.30246778 16.30246778 43.75925563 16.30246778 60.91974802 0 16.30246778-16.30246778 16.30246778-43.75925563 0-60.91974802L572.91974805 512z" fill="#ffffff" p-id="2579"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}createConfirmButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center",background:"#4caf50"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M384 785.67L97.83 499.5l60.34-60.34L384 664.99l439.16-439.16 60.34 60.34z" p-id="7237" fill="#ffffff"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}}class MergeLine extends Command{static name="MergeLine";static shortcutKeys=["Control","G"];static commandName="merge-line";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(MergeLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLines.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(MergeLine.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(MergeLine.commandName)&&await this.commandManager.start(MergeLine.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?selectLines.length<2?(ElMessage({message:"未执行线段合并,请选择至少两条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}mergeLines(next,selectLines){selectLines=selectLines.filter(line2=>!line2.userData.isDoor);const removeLines=/* @__PURE__ */new Set,newLines=[];mergeChainsLine(selectLines,void 0,removeLines,newLines),newLines.length?(next({newLines:newLines,deleteLines:[...removeLines]}),ElMessage({message:"已合并",type:"success"})):(ElMessage({message:"合并失败,未找到共用点",type:"warning"}),this.commandManager.cancel())}completed({newLines:newLines,deleteLines:deleteLines}){this.renderManager.addLines(newLines),this.renderManager.removeLines(deleteLines),this.renderManager.draw()}rollback(data){const{newLines:newLines,deleteLines:deleteLines}=data;return this.renderManager.addLines(deleteLines),this.renderManager.removeLines(newLines),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}class DeleteSelectLine extends Command{static name="DeleteSelectLine";static shortcutKeys=["Delete"];static commandName="deleteSelectLine";onAddFromParent(parent2){super.onAddFromParent(parent2),this.initCommandFlow({shortcutKeys:DeleteSelectLine.shortcutKeys,getStartData:()=>this.default.getSelectData()}).add(this.start.bind(this))}start(next,lines){if(Array.isArray(lines)){if(0===lines.length)return ElMessage({message:"请选择线段",type:"warning"}),void this.cancel();for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.removeHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.removeLine(line2,!1)}this.renderManager.draw(),ElMessage({message:"删除成功",type:"success"}),next(lines)}else ElMessage({message:"进入命令失败",type:"warning"}),this.cancel()}onRollback(lines){for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.addHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.addLine(line2)}return this.renderManager.draw(),lines}onRevokeRollback(lines){for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.removeHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.removeLine(line2,!1)}return this.renderManager.draw(),lines}}class TwoPointConnection extends Command{static name="TwoPointConnection";static shortcutKeys=["Control","P"];static commandName="twoPointConnection";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(this.commandName)&&await this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2!==selectLines.length?(ElMessage({message:"请选择2条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}connection(next,selectLines){let start,end,diatance=1/0;for(let i=0;i<2;i++)for(let j=0;j<2;j++){const point1=selectLines[0].points[i],point2=selectLines[1].points[j],d=point1.distance(point2);d<diatance&&(start=point1,end=point2,diatance=d)}if(start&&end){next(new LineSegment(start.clone(),end.clone())),ElMessage({message:"连接成功",type:"success"})}else this.cancel()}completed(line2){this.renderManager.addLine(line2),this.renderManager.draw()}rollback(line2){return this.renderManager.removeLine(line2),line2}revokeRollback(line2){return this.completed(line2),line2}}class TwoLineConnectionLine extends Command{static name="TwoLineConnectionLine";static shortcutKeys=["Control","L"];static commandName="twoLineConnectionLine";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(this.commandName)&&await this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2!==selectLines.length?(ElMessage({message:"请选择2条线段",type:"warning"}),this.cancel()):selectLines[0].isParallelTo(selectLines[1],45)?(ElMessage({message:"两条线段角度需要小于135度",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}connection(next,selectLines){const line1=selectLines[0],line2=selectLines[1],point=selectLines[0].getIntersection(selectLines[1]);if(!point)return;const oldLine1=line1.points.map(p=>p.clone()),oldLine2=line2.points.map(p=>p.clone());line1.start.distance(point)<line1.end.distance(point)?line1.start.copy(point):line1.end.copy(point),line2.start.distance(point)<line2.end.distance(point)?line2.start.copy(point):line2.end.copy(point);const newLine1=line1.points.map(p=>p.clone()),newLine2=line2.points.map(p=>p.clone());next({line1:line1,line2:line2,oldLine1:oldLine1,oldLine2:oldLine2,newLine1:newLine1,newLine2:newLine2}),ElMessage({message:"连接成功",type:"success"})}completed({line1:line1,line2:line2,newLine1:newLine1,newLine2:newLine2}){this.renderManager.removeLine(line1),this.renderManager.removeLine(line2),line1.set(...newLine1),line2.set(...newLine2),this.renderManager.addLines([line1,line2]),this.renderManager.draw()}rollback(data){const{line1:line1,line2:line2,oldLine1:oldLine1,oldLine2:oldLine2}=data;return this.renderManager.removeLine(line1),this.renderManager.removeLine(line2),line1.set(...oldLine1),line2.set(...oldLine2),this.renderManager.addLines([line1,line2]),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}class SelectAll extends Command{static name="SelectAll";container=new THREE.Group;static shortcutKeys=["Control","A"];static commandName="selectAll";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(SelectAll.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(SelectAll.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(SelectAll.commandName)&&await this.commandManager.start(SelectAll.commandName)}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}selectAll(next){next([...this.renderManager.lines])}completed(lines){lines.map(line2=>this.default.addSelectLine(line2))}rollback(lines){return lines.map(line2=>this.default.removeSelectLine(line2)),lines}revokeRollback(lines){return this.completed(lines),lines}}class ViewAngle extends Command{static name="ViewAngle";static shortcutKeys=["Control","R"];static commandName="viewAngle";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(ViewAngle.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.viewAngle.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),this.eventInput.addKeyCombination(ViewAngle.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(ViewAngle.commandName)&&await this.commandManager.start(ViewAngle.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2===selectLines.length&&selectLines[0].isSameEndpoint(selectLines[1])?next(selectLines):(ElMessage({message:"请选择两条具有端点相交的线段",type:"warning"}),this.cancel()):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}viewAngle(next,selectLines){const[start,end]=selectLines,radius=Math.min(.8*start.length,.8*end.length);let center,point1,point2,gapAngle=0,textAngle=0;function getAngle(center2,p){const dx=p.x-center2.x,dy=p.y-center2.y;let angle3=Math.atan2(dy,dx)*(180/Math.PI);return angle3<0&&(angle3+=360),angle3}start.isSameEndpointAsStart(end)?(center=start.start,point1=start.end):(center=start.end,point1=start.start),point2=end.isSameEndpointAsStart(start)?end.end:end.start;const angle1=getAngle(center,point1),angle2=getAngle(center,point2),min=Math.min(angle1,angle2),max=Math.max(angle1,angle2),pointArray=[];function addSegments(startAngle,endAngle){for(let i=startAngle;i<=endAngle;i++){const x1=Math.cos(i*Math.PI/180)*radius+center.x,y1=Math.sin(i*Math.PI/180)*radius+center.y,x2=Math.cos((i+1)*Math.PI/180)*radius+center.x,y2=Math.sin((i+1)*Math.PI/180)*radius+center.y;pointArray.push(x1,y1,0,x2,y2,0)}}max-min>180?(addSegments(0,min),addSegments(max,360),gapAngle=360-(max-min),textAngle=(max+gapAngle/2)%360):(addSegments(min,max),gapAngle=max-min,textAngle=min+gapAngle/2);const lineSegment=new THREE.LineSegments;lineSegment.geometry=this.renderManager.createGeometry({position:pointArray},pointArray.length/3),lineSegment.material=new THREE.LineBasicMaterial({color:16711935}),this.renderManager.container.add(lineSegment);const x=Math.cos(textAngle*Math.PI/180)*radius+center.x,y=Math.sin(textAngle*Math.PI/180)*radius+center.y,textObj2D=this.renderer.createText(Number(gapAngle.toFixed(2)),new THREE.Vector3(x,y,0),{textShadow:"0px 0px 2px #000"},this.renderManager.container);let mouse_0_count=0;this.addEventRecord("clear").add(()=>lineSegment.removeFromParent()).add(()=>textObj2D.removeFromParent()).add(this.eventInput.addEventListener("codeChange",()=>{this.eventInput.isOnlyKeyDown("enter")?next():this.eventInput.isOnlyKeyDown("mouse_0")&&(mouse_0_count++,1===mouse_0_count?setTimeout(()=>mouse_0_count=0,500):2===mouse_0_count&&(next(),mouse_0_count=0))}))}}class Shape2D extends THREE.Mesh{constructor(material){super(new THREE.BufferGeometry,material??new THREE.MeshBasicMaterial({color:13421772,side:THREE.DoubleSide,transparent:!0})),this.frustumCulled=!1}setPositions(vertices){let attr=this.geometry.getAttribute("position");if(attr&&attr.array.length===vertices.length){attr.array.set(vertices),attr.needsUpdate=!0}else attr=new THREE.Float32BufferAttribute(vertices,3),this.geometry.setAttribute("position",attr);this.geometry.computeBoundingBox(),this.geometry.computeBoundingSphere()}setUVs(uvs){let attr=this.geometry.getAttribute("uv");if(attr&&attr.array.length===uvs.length){attr.array.set(uvs),attr.needsUpdate=!0}else attr=new THREE.Float32BufferAttribute(uvs,2),this.geometry.setAttribute("uv",attr)}setIndices(indices){const current=this.geometry.getIndex();if(current&¤t.array.length===indices.length){current.array.set(indices),current.needsUpdate=!0}else this.geometry.setIndex([...indices])}fromRectangle(rect){const p0=rect.p0,p1=rect.p1,p2=rect.p2,p3=rect.p3;return this.setPositions([p0.x,p0.y,0,p1.x,p1.y,0,p2.x,p2.y,0,p3.x,p3.y,0]),this.setUVs([0,0,1,0,1,1,0,1]),this.setIndices([0,1,2,0,2,3]),this}async setTexture(map){let texture2;texture2=map instanceof THREE.Texture?map:"string"==typeof map?await(new THREE.TextureLoader).loadAsync(map):new THREE.CanvasTexture(map),texture2.needsUpdate=!0;const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)(material instanceof THREE.MeshBasicMaterial||material instanceof THREE.MeshStandardMaterial||material instanceof THREE.MeshPhongMaterial||material instanceof THREE.MeshLambertMaterial)&&(material.map=texture2,material.needsUpdate=!0);return texture2}setColor(color){const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)"color"in material&&material.color.set(color);return this}setOpacity(opacity){const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)material.transparent=opacity<1,material.opacity=opacity,material.needsUpdate=!0;return this}getBounds(){return this.geometry.boundingBox||this.geometry.computeBoundingBox(),this.geometry.boundingBox}getSize(){const size=new THREE.Vector3;return this.getBounds().getSize(size),size}getCenter(){const center=new THREE.Vector3;return this.getBounds().getCenter(center),center}clearGeometry(){return this.geometry.setAttribute("position",new THREE.Float32BufferAttribute([],3)),this.geometry.deleteAttribute("uv"),this.geometry.setIndex([]),this}dispose(){this.geometry.dispose();const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials){const map=material.map;map?.dispose&&map.dispose(),material.dispose()}}}class Wall2D extends Shape2D{line;rectangle=new Rectangle;width=0;constructor(line2,width=.5*DEFAULT_WALL_WIDTH){super(),this.line=line2,this.width=width,this.setLine(line2),this.setColor(16777215)}setLine(line2){this.fromRectangle(line2.toRectangle(this.width,"butt",this.rectangle)),this.clear();const edges=new THREE.LineSegments(new THREE.EdgesGeometry(this.geometry),new THREE.LineBasicMaterial({color:4235007}));this.add(edges)}dispose(){super.dispose(),this.clear()}}class LineAlignmentGuide extends Lines{start=new Vector3;end=new Vector3;constructor(){super(),this.continuous=!1,this.addEventListener("removed",()=>this.clear())}set(line2,points=[]){this.clear();const step=line2.start.leftNormal(line2.end).multiplyScalar(.4);let start=line2.start.clone().add(step),end=line2.end.clone().add(step);this.start.copy(start.toJson()),this.end.copy(end.toJson()),points.forEach(p=>p.add(step)),step.normalize();for(let i=0;i<points.length+1;i++){const point=i===points.length?end:points[i],pre=0===i?start:points[i-1],dist=Number((1e3*point.distance(pre)).toFixed(0)),center=point.clone().add(pre).multiplyScalar(.5);dist>0&&this.createText(dist,center,{padding:"1px 0px",background:"#fff",width:"35px",color:"#000",textAlign:"center",borderRadius:"6px"})}this.setPoint(this.start,this.end,...points.concat([start,end]).flatMap(p=>{const line22=p.expandAsLine(step,.1).translate(-.05,step),line222=line22.clone().rotate(.25*Math.PI);return[...line22.points.map(p2=>p2.toVector3()),...line222.points.map(p2=>p2.toVector3())]}))}createText(text,pos,style){const div=document.createElement("div");div.innerHTML=text,div.style.pointerEvents="none",Object.assign(div.style,{fontSize:"10px",color:"#ffffff",...style});const css2DObject=new CSS2DObject(div);return pos instanceof Point?css2DObject.position.set(pos.x,pos.y,0):pos instanceof Vector3&&css2DObject.position.copy(pos),this.add(css2DObject),css2DObject}}class DragControlPoint{editor;eventCancels=[];onChange;onStart;onEnd;onEnter;onLeave;onClick;onDblClick;onLongTouch;point;opt;constructor(point,editor,opt={}){this.editor=editor,this.point=point.clone(),this.opt=opt,this.init()}object3D;init(){let point=this.point;const debouncing=new Debouncing(800),{object3D:object3D,defaultWidth:defaultWidth,background:background}=this.createView();this.object3D=object3D;const move=e=>{e instanceof TouchEvent&&this.editor.domEventRegister.updatePointer(e);const pos=Point.from(this.editor.pointerPosition);object3D.position.x=pos.x,object3D.position.y=pos.y,point.copy(pos),this.onChange?.(point),debouncing.cancle(),e?.stopPropagation(),e?.preventDefault()},mouseup=e=>{object3D.element.style.pointerEvents="all",object3D.element.style.background=background,object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth,isMobileRef.value?(object3D.element.removeEventListener("touchmove",move),object3D.element.removeEventListener("touchend",mouseup)):(document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",mouseup),e?.stopPropagation()),e&&this.onEnd&&setTimeout(()=>this.onEnd(point),100),debouncing.cancle()},start=()=>{object3D.element.style.background="#00ff00",object3D.element.style.width="2px",object3D.element.style.height="2px",isMobileRef.value?(object3D.element.addEventListener("touchmove",move),object3D.element.addEventListener("touchend",mouseup)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",mouseup)),this.onStart?.(point),debouncing.debounce(()=>(mouseup(null),this.onLongTouch?.()))};isMobileRef.value?object3D.element.addEventListener("pointerdown",start):(object3D.element.addEventListener("mousedown",e=>{start(),e.stopPropagation(),e.preventDefault()}),object3D.element.addEventListener("mouseenter",()=>this.onEnter?.()),object3D.element.addEventListener("mouseleave",()=>this.onLeave?.())),object3D.element.addEventListener("click",()=>this.onClick?.()),object3D.element.addEventListener("dblclick",()=>this.onDblClick?.()),this.eventCancels.push(()=>{object3D.removeFromParent()})}setPoint(point){point instanceof Point&&(point=Point.from(point)),this.point.copy(point),this.object3D?.position.set(point.x,point.y,this.object3D.position.z)}createView(){const{size:size,style:style=!1}=this.opt;let point=this.point;const defaultWidth=size?size+"px":isMobileRef.value?"20px":"10px",object3D=this.editor.renderer.createText("",point,{position:"absolute",background:"rgba(255,255,255, 0.4)",borderRadius:"100px",width:defaultWidth,height:defaultWidth,pointerEvents:"all",cursor:"move",transition:"0.25s background",border:"solid 1px #fff",...style},this.editor.container);return createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:`calc(${defaultWidth} * 1.3)`,height:"1px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"1px",height:`calc(${defaultWidth} * 1.3)`,background:"white",borderRadius:"100px",pointerEvents:"none"}}),{object3D:object3D,defaultWidth:defaultWidth,background:"rgba(255,255,255, 0.4)"}}destroy(){this.eventCancels.forEach(fun=>fun()),this.eventCancels.length=0}}class SnapController{editor;lineSnap=!0;pointSnap=!0;quadtree;radius=0;outQuadtree=!1;constructor(editor,lines,radius=(isMobileRef.value?.08:.06)){this.editor=editor,this.radius=radius;const outQuadtree=lines instanceof Quadtree;this.quadtree=outQuadtree?lines:Quadtree.from(lines),this.outQuadtree=outQuadtree}addLine(line2){this.quadtree.insert(line2)}removeLine(line2){this.quadtree.remove(line2)}snap(point,radius){radius=radius??this.radius;const editor=this.editor,quadtree=this.quadtree;let result={point:Point.from(editor.pointerPosition),find:!1,line:void 0,mode:void 0},queryResult=this.lineSnap?quadtree.queryCircle(point,radius):[];if(queryResult.length){let projectList=queryResult.map(res=>({point:res.line.projectPoint(point),line:res.line})).filter(item=>!!item.point);if(projectList.sort((a,b)=>a.point.distance(point)-b.point.distance(point)),projectList.length){const line2=projectList[0].line,projectPoint=projectList[0].point;result={point:Point.from(projectPoint),find:!0,mode:"line",line:line2},this.pointSnap&&(line2.start.distance(point)<1.5*radius?(result.point.set(line2.start.x,line2.start.y),result.mode="point"):line2.end.distance(point)<1.5*radius&&(result.point.set(line2.end.x,line2.end.y),result.mode="point"))}}return this.editor.renderManager.dispatchEvent({type:"adsorptionPointChange",...result}),result}destroy(){this.outQuadtree||this.quadtree.clear()}}class PointerFollowMove{snapController;editor;currentSelectLine=null;pos=null;snapType=["wall"];snapRadius=.08;emptySpace=!0;ended=!1;_paused=!1;mobileTrigger="dragControlPoint";eventCancels=[];get paused(){return this._paused}onPointerMove;onMobileStart;onMobileEnd;constructor(editor,point,mobileTrigger="dragControlPoint",quadtree){this.editor=editor,this.snapController=new SnapController(editor,quadtree??this.editor.renderManager.lines),this.mobileTrigger=mobileTrigger,this.init(point)}dragControlPoint;init(point){const editor=this.editor;if(isMobile())if("dragControlPoint"===this.mobileTrigger){point=point??Point.zero();const dragControlPoint=new DragControlPoint(point,this.editor);this.dragControlPoint=dragControlPoint,dragControlPoint.onChange=()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))},dragControlPoint.onStart=p=>this.onMobileStart?.(p),dragControlPoint.onEnd=p=>this.onMobileEnd?.(p),this.eventCancels.push(dragControlPoint.destroy.bind(dragControlPoint))}else"pointerdown"===this.mobileTrigger&&this.eventCancels.push(this.editor.domEventRegister.addEventListener("pointerdown",()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))}));else this.eventCancels.push(editor.addEventListener("pointerPositionChange",()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))}))}getHole(line2,p){for(const insertObject of WH.getIterator(line2)){const hole=WH.holeDataToLine(line2,insertObject),p2=hole.projectPoint(p,!0);if((p2?.distance(p)??1/0)<.08&&(hole.currentData.insertObject=insertObject,hole.currentData.line=line2,this.hasSnapType([insertObject.type,"hole","passageEntrance"])))return hole}return null}getDoor(line2){return line2.userData.isDoor?line2:null}getBalconyRailing(line2){return line2.userData.isBalconyRailing?line2:null}hasSnapType(keys2){const snapType=this.snapType;return"none"!==snapType&&("all"===snapType||!!Array.isArray(snapType)&&keys2.some(key=>snapType.includes(key)))}pointerPositionChange(pos){if(this.currentSelectLine=null,this.pos=null,"none"!==this.snapType){const{point:point,line:line2}=this.snapController.snap(pos,this.snapRadius);if(line2){if(this.hasSnapType(["window","door","passageEntrance","hole"])){const holeLine=this.getHole(line2,point);holeLine&&(this.currentSelectLine=holeLine)}if(!this.currentSelectLine&&this.hasSnapType(["door"])){const doorLine=this.getDoor(line2);doorLine&&(this.currentSelectLine=doorLine)}if(!this.currentSelectLine&&this.hasSnapType(["balconyRailing"])){const brline=this.getBalconyRailing(line2);brline&&(this.currentSelectLine=brline)}!this.currentSelectLine&&this.hasSnapType(["wall"])&&(line2.userData.isDoor||line2.userData.isBalconyRailing||(this.currentSelectLine=line2)),this.currentSelectLine&&(pos=point)}}("none"===this.snapType||this.currentSelectLine||this.emptySpace)&&(this.pos=pos),this.onPointerMove?.(this.pos,this.currentSelectLine)}setEmptySpace(emptySpace){return this.emptySpace=emptySpace,this}setType(snapType){return this.snapType=snapType,this}setSnapRadius(adsorptRadius){return this.snapRadius=adsorptRadius,this}pause(){this._paused=!0}resume(){this._paused=!1}destroy(){this.eventCancels.forEach(fun=>fun()),this.eventCancels.length=0,this.snapController.destroy(),this.ended=!0}}class LineSelector extends PointerFollowMove{resolve_;onMiss;constructor(editor,point,mobileTrigger,quadtree){super(editor,point,mobileTrigger,quadtree),super.setEmptySpace(!1)}setEmptySpace(_){return this}async getLines(){if(this.ended)throw new Error("顶点选择器已经结束,无法继续使用");if(this.resolve_)throw new Error("已有线段获取任务,请勿重复触发");return this.currentSelectLine=null,new Promise(resolve=>{this.resolve_=resolve;const eventCancel=this.editor.domEventRegister.addEventListener("pointerup",()=>{if(!this.currentSelectLine)return this.onMiss?.();resolve(this.currentSelectLine),this.resolve_=null,eventCancel()})})}[Symbol.asyncIterator](){return this}async next(){if(!this.ended){const result=await this.getLines();if(result)return{value:result,done:!1}}return{value:void 0,done:!0}}}function createVueApp(com,props,parent2){const div=document.createElement("div");div.style.zIndex="20",parent2?.appendChild(div);const app=createApp(com,props);return app.mount(div),()=>{app.unmount(),div.remove()}}const matchIconName=/^[a-z0-9]+(-[a-z0-9]+)*$/,stringToIcon=(value,validate,allowSimpleName,provider="")=>{const colonSeparated=value.split(":");if("@"===value.slice(0,1)){if(colonSeparated.length<2||colonSeparated.length>3)return null;provider=colonSeparated.shift().slice(1)}if(colonSeparated.length>3||!colonSeparated.length)return null;if(colonSeparated.length>1){const name2=colonSeparated.pop(),prefix=colonSeparated.pop(),result={provider:colonSeparated.length>0?colonSeparated[0]:provider,prefix:prefix,name:name2};return validate&&!validateIconName(result)?null:result}const name=colonSeparated[0],dashSeparated=name.split("-");if(dashSeparated.length>1){const result={provider:provider,prefix:dashSeparated.shift(),name:dashSeparated.join("-")};return validate&&!validateIconName(result)?null:result}if(allowSimpleName&&""===provider){const result={provider:provider,prefix:"",name:name};return validate&&!validateIconName(result,allowSimpleName)?null:result}return null},validateIconName=(icon,allowSimpleName)=>!!icon&&!(!(allowSimpleName&&""===icon.prefix||icon.prefix)||!icon.name);const defaultIconDimensions=Object.freeze({left:0,top:0,width:16,height:16}),defaultIconTransformations=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),defaultIconProps=Object.freeze({...defaultIconDimensions,...defaultIconTransformations}),defaultExtendedIconProps=Object.freeze({...defaultIconProps,body:"",hidden:!1});function mergeIconData(parent2,child){const result=function(obj1,obj2){const result={};!obj1.hFlip!=!obj2.hFlip&&(result.hFlip=!0),!obj1.vFlip!=!obj2.vFlip&&(result.vFlip=!0);const rotate=((obj1.rotate||0)+(obj2.rotate||0))%4;return rotate&&(result.rotate=rotate),result}(parent2,child);for(const key in defaultExtendedIconProps)key in defaultIconTransformations?key in parent2&&!(key in result)&&(result[key]=defaultIconTransformations[key]):key in child?result[key]=child[key]:key in parent2&&(result[key]=parent2[key]);return result}function internalGetIconData(data,name,tree){const icons=data.icons,aliases=data.aliases||/* @__PURE__ */Object.create(null);let currentProps={};function parse(name2){currentProps=mergeIconData(icons[name2]||aliases[name2],currentProps)}return parse(name),tree.forEach(parse),mergeIconData(data,currentProps)}function parseIconSet(data,callback){const names2=[];if("object"!=typeof data||"object"!=typeof data.icons)return names2;data.not_found instanceof Array&&data.not_found.forEach(name=>{callback(name,null),names2.push(name)});const tree=function(data){const icons=data.icons,aliases=data.aliases||/* @__PURE__ */Object.create(null),resolved=/* @__PURE__ */Object.create(null);return Object.keys(icons).concat(Object.keys(aliases)).forEach(function resolve(name){if(icons[name])return resolved[name]=[];if(!(name in resolved)){resolved[name]=null;const parent2=aliases[name]&&aliases[name].parent,value=parent2&&resolve(parent2);value&&(resolved[name]=[parent2].concat(value))}return resolved[name]}),resolved}(data);for(const name in tree){const item=tree[name];item&&(callback(name,internalGetIconData(data,name,item)),names2.push(name))}return names2}const optionalPropertyDefaults={provider:"",aliases:{},not_found:{},...defaultIconDimensions};function checkOptionalProps(item,defaults){for(const prop in defaults)if(prop in item&&typeof item[prop]!=typeof defaults[prop])return!1;return!0}function quicklyValidateIconSet(obj){if("object"!=typeof obj||null===obj)return null;const data=obj;if("string"!=typeof data.prefix||!obj.icons||"object"!=typeof obj.icons)return null;if(!checkOptionalProps(obj,optionalPropertyDefaults))return null;const icons=data.icons;for(const name in icons){const icon=icons[name];if(!name||"string"!=typeof icon.body||!checkOptionalProps(icon,defaultExtendedIconProps))return null}const aliases=data.aliases||/* @__PURE__ */Object.create(null);for(const name in aliases){const icon=aliases[name],parent2=icon.parent;if(!name||"string"!=typeof parent2||!icons[parent2]&&!aliases[parent2]||!checkOptionalProps(icon,defaultExtendedIconProps))return null}return data}const dataStorage=/* @__PURE__ */Object.create(null);function getStorage(provider,prefix){const providerStorage=dataStorage[provider]||(dataStorage[provider]=/* @__PURE__ */Object.create(null));return providerStorage[prefix]||(providerStorage[prefix]=function(provider,prefix){return{provider:provider,prefix:prefix,icons:/* @__PURE__ */Object.create(null),missing:/* @__PURE__ */new Set}}(provider,prefix))}function addIconSet(storage2,data){return quicklyValidateIconSet(data)?parseIconSet(data,(name,icon)=>{icon?storage2.icons[name]=icon:storage2.missing.add(name)}):[]}let simpleNames=!1;function allowSimpleNames(allow){return"boolean"==typeof allow&&(simpleNames=allow),simpleNames}function addCollection(data,provider){if("object"!=typeof data)return!1;if("string"!=typeof provider&&(provider=data.provider||""),simpleNames&&!provider&&!data.prefix){let added=!1;return quicklyValidateIconSet(data)&&(data.prefix="",parseIconSet(data,(name,icon)=>{(function(name,data){const icon=stringToIcon(name,!0,simpleNames);if(!icon)return!1;const storage2=getStorage(icon.provider,icon.prefix);return data?function(storage2,name,icon){try{if("string"==typeof icon.body)return storage2.icons[name]={...icon},!0}catch(err){}return!1}(storage2,icon.name,data):(storage2.missing.add(icon.name),!0)})(name,icon)&&(added=!0)})),added}const prefix=data.prefix;return!!validateIconName({prefix:prefix,name:"a"})&&!!addIconSet(getStorage(provider,prefix),data)}const defaultIconSizeCustomisations=Object.freeze({width:null,height:null}),defaultIconCustomisations=Object.freeze({...defaultIconSizeCustomisations,...defaultIconTransformations}),unitsSplit=/(-?[0-9.]*[0-9]+[0-9.]*)/g,unitsTest=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function calculateSize(size,ratio,precision){if(1===ratio)return size;if(precision=precision||100,"number"==typeof size)return Math.ceil(size*ratio*precision)/precision;if("string"!=typeof size)return size;const oldParts=size.split(unitsSplit);if(null===oldParts||!oldParts.length)return size;const newParts=[];let code=oldParts.shift(),isNumber2=unitsTest.test(code);for(;;){if(isNumber2){const num=parseFloat(code);isNaN(num)?newParts.push(code):newParts.push(Math.ceil(num*ratio*precision)/precision)}else newParts.push(code);if(code=oldParts.shift(),void 0===code)return newParts.join("");isNumber2=!isNumber2}}const regex=/\sid="(\S+)"/g,counters=/* @__PURE__ */new Map;function replaceIDs(body){const ids=[];let match;for(;match=regex.exec(body);)ids.push(match[1]);if(!ids.length)return body;const suffix="suffix"+(16777216*Math.random()|Date.now()).toString(16);return ids.forEach(id=>{const newID=function(id){id=id.replace(/[0-9]+$/,"")||"a";const count=counters.get(id)||0;return counters.set(id,count+1),count?`${id}${count}`:id}(id),escapedID=id.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");body=body.replace(new RegExp('([#;"])('+escapedID+')([")]|\\.[a-z])',"g"),"$1"+newID+suffix+"$3")}),body=body.replace(new RegExp(suffix,"g"),"")}const storage=/* @__PURE__ */Object.create(null);function getAPIModule(provider){return storage[provider]||storage[""]}function createAPIConfig(source){let resources;if("string"==typeof source.resources)resources=[source.resources];else if(resources=source.resources,!(resources instanceof Array&&resources.length))return null;return{resources:resources,path:source.path||"/",maxURL:source.maxURL||500,rotate:source.rotate||750,timeout:source.timeout||5e3,random:!0===source.random,index:source.index||0,dataAfterTimeout:!1!==source.dataAfterTimeout}}const configStorage=/* @__PURE__ */Object.create(null),fallBackAPISources=["https://api.simplesvg.com","https://api.unisvg.com"],fallBackAPI=[];for(;fallBackAPISources.length>0;)1===fallBackAPISources.length||Math.random()>.5?fallBackAPI.push(fallBackAPISources.shift()):fallBackAPI.push(fallBackAPISources.pop());function addAPIProvider(provider,customConfig){const config=createAPIConfig(customConfig);return null!==config&&(configStorage[provider]=config,!0)}function getAPIConfig(provider){return configStorage[provider]}configStorage[""]=createAPIConfig({resources:["https://api.iconify.design"].concat(fallBackAPI)});let fetchModule=(()=>{let callback;try{if(callback=fetch,"function"==typeof callback)return callback}catch(err){}})();const fetchAPIModule={prepare:(provider,prefix,icons)=>{const results=[],maxLength=function(provider,prefix){const config=getAPIConfig(provider);if(!config)return 0;let result;if(config.maxURL){let maxHostLength=0;config.resources.forEach(item=>{maxHostLength=Math.max(maxHostLength,item.length)});const url=prefix+".json?icons=";result=config.maxURL-maxHostLength-config.path.length-url.length}else result=0;return result}(provider,prefix);let item={type:"icons",provider:provider,prefix:prefix,icons:[]},length=0;return icons.forEach((name,index)=>{length+=name.length+1,length>=maxLength&&index>0&&(results.push(item),item={type:"icons",provider:provider,prefix:prefix,icons:[]},length=name.length),item.icons.push(name)}),results.push(item),results},send:(host,params,callback)=>{if(!fetchModule)return void callback("abort",424);let path=function(provider){if("string"==typeof provider){const config=getAPIConfig(provider);if(config)return config.path}return"/"}(params.provider);switch(params.type){case"icons":{const prefix=params.prefix,iconsList=params.icons.join(",");path+=prefix+".json?"+new URLSearchParams({icons:iconsList}).toString();break}case"custom":{const uri=params.uri;path+="/"===uri.slice(0,1)?uri.slice(1):uri;break}default:return void callback("abort",400)}let defaultError=503;fetchModule(host+path).then(response=>{const status=response.status;if(200===status)return defaultError=501,response.json();setTimeout(()=>{callback(function(status){return 404===status}(status)?"abort":"next",status)})}).then(data=>{"object"==typeof data&&null!==data?setTimeout(()=>{callback("success",data)}):setTimeout(()=>{404===data?callback("abort",data):callback("next",defaultError)})}).catch(()=>{callback("next",defaultError)})}};function removeCallback(storages,id){storages.forEach(storage2=>{const items=storage2.loaderCallbacks;items&&(storage2.loaderCallbacks=items.filter(row=>row.id!==id))})}let idCounter=0;const defaultConfig={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sendQuery(config,payload,query,done){const resourcesCount=config.resources.length,startIndex=config.random?Math.floor(Math.random()*resourcesCount):config.index;let resources;if(config.random){let list=config.resources.slice(0);for(resources=[];list.length>1;){const nextIndex=Math.floor(Math.random()*list.length);resources.push(list[nextIndex]),list=list.slice(0,nextIndex).concat(list.slice(nextIndex+1))}resources=resources.concat(list)}else resources=config.resources.slice(startIndex).concat(config.resources.slice(0,startIndex));const startTime=Date.now();let lastError,status="pending",queriesSent=0,timer=null,queue=[],doneCallbacks=[];function resetTimer(){timer&&(clearTimeout(timer),timer=null)}function abort(){"pending"===status&&(status="aborted"),resetTimer(),queue.forEach(item=>{"pending"===item.status&&(item.status="aborted")}),queue=[]}function subscribe(callback,overwrite){overwrite&&(doneCallbacks=[]),"function"==typeof callback&&doneCallbacks.push(callback)}function failQuery(){status="failed",doneCallbacks.forEach(callback=>{callback(void 0,lastError)})}function clearQueue(){queue.forEach(item=>{"pending"===item.status&&(item.status="aborted")}),queue=[]}function execNext(){if("pending"!==status)return;resetTimer();const resource=resources.shift();if(void 0===resource)return queue.length?void(timer=setTimeout(()=>{resetTimer(),"pending"===status&&(clearQueue(),failQuery())},config.timeout)):void failQuery();const item={status:"pending",resource:resource,callback:(status2,data)=>{!function(item,response,data){const isError="success"!==response;switch(queue=queue.filter(queued=>queued!==item),status){case"pending":break;case"failed":if(isError||!config.dataAfterTimeout)return;break;default:return}if("abort"===response)return lastError=data,void failQuery();if(isError)return lastError=data,void(queue.length||(resources.length?execNext():failQuery()));if(resetTimer(),clearQueue(),!config.random){const index=config.resources.indexOf(item.resource);-1!==index&&index!==config.index&&(config.index=index)}status="completed",doneCallbacks.forEach(callback=>{callback(data)})}(item,status2,data)}};queue.push(item),queriesSent++,timer=setTimeout(execNext,config.rotate),query(resource,payload,item.callback)}return"function"==typeof done&&doneCallbacks.push(done),setTimeout(execNext),function(){return{startTime:startTime,payload:payload,status:status,queriesSent:queriesSent,queriesPending:queue.length,subscribe:subscribe,abort:abort}}}function initRedundancy(cfg){const config={...defaultConfig,...cfg};let queries=[];function cleanup(){queries=queries.filter(item=>"pending"===item().status)}return{query:function(payload,queryCallback,doneCallback){const query2=sendQuery(config,payload,queryCallback,(data,error)=>{cleanup(),doneCallback&&doneCallback(data,error)});return queries.push(query2),query2},find:function(callback){return queries.find(value=>callback(value))||null},setIndex:index=>{config.index=index},getIndex:()=>config.index,cleanup:cleanup}}function emptyCallback$1(){}const redundancyCache=/* @__PURE__ */Object.create(null);function sendAPIQuery(target,query,callback){let redundancy,send2;if("string"==typeof target){const api=getAPIModule(target);if(!api)return callback(void 0,424),emptyCallback$1;send2=api.send;const cached=function(provider){if(!redundancyCache[provider]){const config=getAPIConfig(provider);if(!config)return;redundancyCache[provider]={config:config,redundancy:initRedundancy(config)}}return redundancyCache[provider]}(target);cached&&(redundancy=cached.redundancy)}else{const config=createAPIConfig(target);if(config){redundancy=initRedundancy(config);const api=getAPIModule(target.resources?target.resources[0]:"");api&&(send2=api.send)}}return redundancy&&send2?redundancy.query(query,send2,callback)().abort:(callback(void 0,424),emptyCallback$1)}function emptyCallback(){}function loadedNewIcons(storage2){storage2.iconsLoaderFlag||(storage2.iconsLoaderFlag=!0,setTimeout(()=>{storage2.iconsLoaderFlag=!1,function(storage2){storage2.pendingCallbacksFlag||(storage2.pendingCallbacksFlag=!0,setTimeout(()=>{storage2.pendingCallbacksFlag=!1;const items=storage2.loaderCallbacks?storage2.loaderCallbacks.slice(0):[];if(!items.length)return;let hasPending=!1;const provider=storage2.provider,prefix=storage2.prefix;items.forEach(item=>{const icons=item.icons,oldLength=icons.pending.length;icons.pending=icons.pending.filter(icon=>{if(icon.prefix!==prefix)return!0;const name=icon.name;if(storage2.icons[name])icons.loaded.push({provider:provider,prefix:prefix,name:name});else{if(!storage2.missing.has(name))return hasPending=!0,!0;icons.missing.push({provider:provider,prefix:prefix,name:name})}return!1}),icons.pending.length!==oldLength&&(hasPending||removeCallback([storage2],item.id),item.callback(icons.loaded.slice(0),icons.missing.slice(0),icons.pending.slice(0),item.abort))})}))}(storage2)}))}function parseLoaderResponse(storage2,icons,data){function checkMissing(){const pending=storage2.pendingIcons;icons.forEach(name=>{pending&&pending.delete(name),storage2.icons[name]||storage2.missing.add(name)})}if(data&&"object"==typeof data)try{if(!addIconSet(storage2,data).length)return void checkMissing()}catch(err){console.error(err)}checkMissing(),loadedNewIcons(storage2)}function parsePossiblyAsyncResponse(response,callback){response instanceof Promise?response.then(data=>{callback(data)}).catch(()=>{callback(null)}):callback(response)}function loadNewIcons(storage2,icons){storage2.iconsToLoad?storage2.iconsToLoad=storage2.iconsToLoad.concat(icons).sort():storage2.iconsToLoad=icons,storage2.iconsQueueFlag||(storage2.iconsQueueFlag=!0,setTimeout(()=>{storage2.iconsQueueFlag=!1;const{provider:provider,prefix:prefix}=storage2,icons2=storage2.iconsToLoad;if(delete storage2.iconsToLoad,!icons2||!icons2.length)return;const customIconLoader=storage2.loadIcon;if(storage2.loadIcons&&(icons2.length>1||!customIconLoader))return void parsePossiblyAsyncResponse(storage2.loadIcons(icons2,prefix,provider),data=>{parseLoaderResponse(storage2,icons2,data)});if(customIconLoader)return void icons2.forEach(name=>{parsePossiblyAsyncResponse(customIconLoader(name,prefix,provider),data=>{parseLoaderResponse(storage2,[name],data?{prefix:prefix,icons:{[name]:data}}:null)})});const{valid:valid,invalid:invalid}=function(icons){const valid=[],invalid=[];return icons.forEach(name=>{(name.match(matchIconName)?valid:invalid).push(name)}),{valid:valid,invalid:invalid}}(icons2);if(invalid.length&&parseLoaderResponse(storage2,invalid,null),!valid.length)return;const api=prefix.match(matchIconName)?getAPIModule(provider):null;api?api.prepare(provider,prefix,valid).forEach(item=>{sendAPIQuery(provider,item,data=>{parseLoaderResponse(storage2,item.icons,data)})}):parseLoaderResponse(storage2,valid,null)}))}const loadIcons=(icons,callback)=>{const sortedIcons=function(icons){const result={loaded:[],missing:[],pending:[]},storage2=/* @__PURE__ */Object.create(null);icons.sort((a,b)=>a.provider!==b.provider?a.provider.localeCompare(b.provider):a.prefix!==b.prefix?a.prefix.localeCompare(b.prefix):a.name.localeCompare(b.name));let lastIcon={provider:"",prefix:"",name:""};return icons.forEach(icon=>{if(lastIcon.name===icon.name&&lastIcon.prefix===icon.prefix&&lastIcon.provider===icon.provider)return;lastIcon=icon;const provider=icon.provider,prefix=icon.prefix,name=icon.name,providerStorage=storage2[provider]||(storage2[provider]=/* @__PURE__ */Object.create(null)),localStorage2=providerStorage[prefix]||(providerStorage[prefix]=getStorage(provider,prefix));let list;list=name in localStorage2.icons?result.loaded:""===prefix||localStorage2.missing.has(name)?result.missing:result.pending;const item={provider:provider,prefix:prefix,name:name};list.push(item)}),result}(function(list,validate=!0,simpleNames2=!1){const result=[];return list.forEach(item=>{const icon="string"==typeof item?stringToIcon(item,validate,simpleNames2):item;icon&&result.push(icon)}),result}(icons,!0,allowSimpleNames()));if(!sortedIcons.pending.length){let callCallback=!0;return callback&&setTimeout(()=>{callCallback&&callback(sortedIcons.loaded,sortedIcons.missing,sortedIcons.pending,emptyCallback)}),()=>{callCallback=!1}}const newIcons=/* @__PURE__ */Object.create(null),sources=[];let lastProvider,lastPrefix;return sortedIcons.pending.forEach(icon=>{const{provider:provider,prefix:prefix}=icon;if(prefix===lastPrefix&&provider===lastProvider)return;lastProvider=provider,lastPrefix=prefix,sources.push(getStorage(provider,prefix));const providerNewIcons=newIcons[provider]||(newIcons[provider]=/* @__PURE__ */Object.create(null));providerNewIcons[prefix]||(providerNewIcons[prefix]=[])}),sortedIcons.pending.forEach(icon=>{const{provider:provider,prefix:prefix,name:name}=icon,storage2=getStorage(provider,prefix),pendingQueue=storage2.pendingIcons||(storage2.pendingIcons=/* @__PURE__ */new Set);pendingQueue.has(name)||(pendingQueue.add(name),newIcons[provider][prefix].push(name))}),sources.forEach(storage2=>{const list=newIcons[storage2.provider][storage2.prefix];list.length&&loadNewIcons(storage2,list)}),callback?function(callback,icons,pendingSources){const id=idCounter++,abort=removeCallback.bind(null,pendingSources,id);if(!icons.pending.length)return abort;const item={id:id,icons:icons,callback:callback,abort:abort};return pendingSources.forEach(storage2=>{(storage2.loaderCallbacks||(storage2.loaderCallbacks=[])).push(item)}),abort}(callback,sortedIcons,sources):emptyCallback};const separator=/[\s,]+/;function flipFromString(custom,flip){flip.split(separator).forEach(str=>{switch(str.trim()){case"horizontal":custom.hFlip=!0;break;case"vertical":custom.vFlip=!0}})}function rotateFromString(value,defaultValue=0){const units=value.replace(/^-?[0-9.]*/,"");function cleanup(value2){for(;value2<0;)value2+=4;return value2%4}if(""===units){const num=parseInt(value);return isNaN(num)?0:cleanup(num)}if(units!==value){let split=0;switch(units){case"%":split=25;break;case"deg":split=90}if(split){let num=parseFloat(value.slice(0,value.length-units.length));return isNaN(num)?0:(num/=split,num%1==0?cleanup(num):0)}}return defaultValue}const defaultExtendedIconCustomisations={...defaultIconCustomisations,inline:!1},svgDefaults={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},commonProps={display:"inline-block"},monotoneProps={backgroundColor:"currentColor"},coloredProps={backgroundColor:"transparent"},propsToAdd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},propsToAddTo={webkitMask:monotoneProps,mask:monotoneProps,background:coloredProps};for(const prefix in propsToAddTo){const list=propsToAddTo[prefix];for(const prop in propsToAdd)list[prefix+prop]=propsToAdd[prop]}const customisationAliases={};function fixSize(value){return value+(value.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(prefix=>{const attr=prefix.slice(0,1)+"Flip";customisationAliases[prefix+"-flip"]=attr,customisationAliases[prefix.slice(0,1)+"-flip"]=attr,customisationAliases[prefix+"Flip"]=attr});const render=(icon,props)=>{const customisations=function(defaults,item){const result={...defaults};for(const key in item){const value=item[key],valueType=typeof value;key in defaultIconSizeCustomisations?(null===value||value&&("string"===valueType||"number"===valueType))&&(result[key]=value):valueType===typeof result[key]&&(result[key]="rotate"===key?value%4:value)}return result}(defaultExtendedIconCustomisations,props),componentProps={...svgDefaults},mode=props.mode||"svg",style={},propsStyle=props.style,customStyle="object"!=typeof propsStyle||propsStyle instanceof Array?{}:propsStyle;for(let key in props){const value=props[key];if(void 0!==value)switch(key){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":customisations[key]=!0===value||"true"===value||1===value;break;case"flip":"string"==typeof value&&flipFromString(customisations,value);break;case"color":style.color=value;break;case"rotate":"string"==typeof value?customisations[key]=rotateFromString(value):"number"==typeof value&&(customisations[key]=value);break;case"ariaHidden":case"aria-hidden":!0!==value&&"true"!==value&&delete componentProps["aria-hidden"];break;default:{const alias=customisationAliases[key];alias?!0!==value&&"true"!==value&&1!==value||(customisations[alias]=!0):void 0===defaultExtendedIconCustomisations[key]&&(componentProps[key]=value)}}}const item=function(icon,customisations){const fullIcon={...defaultIconProps,...icon},fullCustomisations={...defaultIconCustomisations,...customisations},box={left:fullIcon.left,top:fullIcon.top,width:fullIcon.width,height:fullIcon.height};let body=fullIcon.body;[fullIcon,fullCustomisations].forEach(props=>{const transformations=[],hFlip=props.hFlip,vFlip=props.vFlip;let tempValue,rotation=props.rotate;switch(hFlip?vFlip?rotation+=2:(transformations.push("translate("+(box.width+box.left).toString()+" "+(0-box.top).toString()+")"),transformations.push("scale(-1 1)"),box.top=box.left=0):vFlip&&(transformations.push("translate("+(0-box.left).toString()+" "+(box.height+box.top).toString()+")"),transformations.push("scale(1 -1)"),box.top=box.left=0),rotation<0&&(rotation-=4*Math.floor(rotation/4)),rotation%=4,rotation){case 1:tempValue=box.height/2+box.top,transformations.unshift("rotate(90 "+tempValue.toString()+" "+tempValue.toString()+")");break;case 2:transformations.unshift("rotate(180 "+(box.width/2+box.left).toString()+" "+(box.height/2+box.top).toString()+")");break;case 3:tempValue=box.width/2+box.left,transformations.unshift("rotate(-90 "+tempValue.toString()+" "+tempValue.toString()+")")}rotation%2==1&&(box.left!==box.top&&(tempValue=box.left,box.left=box.top,box.top=tempValue),box.width!==box.height&&(tempValue=box.width,box.width=box.height,box.height=tempValue)),transformations.length&&(body=function(body,start,end){const split=function(content,tag="defs"){let defs="";const index=content.indexOf("<"+tag);for(;index>=0;){const start=content.indexOf(">",index),end=content.indexOf("</"+tag);if(-1===start||-1===end)break;const endEnd=content.indexOf(">",end);if(-1===endEnd)break;defs+=content.slice(start+1,end).trim(),content=content.slice(0,index).trim()+content.slice(endEnd+1)}return{defs:defs,content:content}}(body);return defs=split.defs,content=start+split.content+end,defs?"<defs>"+defs+"</defs>"+content:content;var defs,content}(body,'<g transform="'+transformations.join(" ")+'">',"</g>"))});const customisationsWidth=fullCustomisations.width,customisationsHeight=fullCustomisations.height,boxWidth=box.width,boxHeight=box.height;let width,height;null===customisationsWidth?(height=null===customisationsHeight?"1em":"auto"===customisationsHeight?boxHeight:customisationsHeight,width=calculateSize(height,boxWidth/boxHeight)):(width="auto"===customisationsWidth?boxWidth:customisationsWidth,height=null===customisationsHeight?calculateSize(width,boxHeight/boxWidth):"auto"===customisationsHeight?boxHeight:customisationsHeight);const attributes={},setAttr=(prop,value)=>{(value=>"unset"===value||"undefined"===value||"none"===value)(value)||(attributes[prop]=value.toString())};setAttr("width",width),setAttr("height",height);const viewBox=[box.left,box.top,boxWidth,boxHeight];return attributes.viewBox=viewBox.join(" "),{attributes:attributes,viewBox:viewBox,body:body}}(icon,customisations),renderAttribs=item.attributes;if(customisations.inline&&(style.verticalAlign="-0.125em"),"svg"===mode)return componentProps.style={...style,...customStyle},Object.assign(componentProps,renderAttribs),componentProps.innerHTML=replaceIDs(item.body),h("svg",componentProps);const{body:body,width:width,height:height}=icon,useMask="mask"===mode||"bg"!==mode&&-1!==body.indexOf("currentColor"),html=function(body,attributes){let renderAttribsHTML=-1===body.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const attr in attributes)renderAttribsHTML+=" "+attr+'="'+attributes[attr]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+renderAttribsHTML+">"+body+"</svg>"}(body,{...renderAttribs,width:width+"",height:height+""});var svg;return componentProps.style={...style,"--svg":(svg=html,'url("'+function(svg){return"data:image/svg+xml,"+function(svg){return svg.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(svg)}(svg)+'")'),width:fixSize(renderAttribs.width),height:fixSize(renderAttribs.height),...commonProps,...useMask?monotoneProps:coloredProps,...customStyle},h("span",componentProps)};var item;if(allowSimpleNames(!0),item=fetchAPIModule,storage[""]=item,"undefined"!=typeof document&&"undefined"!=typeof window){const _window=window;if(void 0!==_window.IconifyPreload){const preload=_window.IconifyPreload,err="Invalid IconifyPreload syntax.";"object"==typeof preload&&null!==preload&&(preload instanceof Array?preload:[preload]).forEach(item=>{try{("object"!=typeof item||null===item||item instanceof Array||"object"!=typeof item.icons||"string"!=typeof item.prefix||!addCollection(item))&&console.error(err)}catch(e){console.error(err)}})}if(void 0!==_window.IconifyProviders){const providers=_window.IconifyProviders;if("object"==typeof providers&&null!==providers)for(let key in providers){const err="IconifyProviders["+key+"] is invalid.";try{const value=providers[key];if("object"!=typeof value||!value||void 0===value.resources)continue;addAPIProvider(key,value)||console.error(err)}catch(e){console.error(err)}}}}const emptyIcon={...defaultIconProps,body:""},Icon=defineComponent((props,{emit:emit})=>{const loader2=ref(null);function abortLoading(){loader2.value&&(loader2.value.abort?.(),loader2.value=null)}const rendering=ref(!!props.ssr),lastRenderedIconName=ref(""),iconData=shallowRef(null);function getIcon(){const icon=props.icon;if("object"==typeof icon&&null!==icon&&"string"==typeof icon.body)return lastRenderedIconName.value="",{data:icon};let iconName;if("string"!=typeof icon||null===(iconName=stringToIcon(icon,!1,!0)))return null;let data=function(name){const icon="string"==typeof name?stringToIcon(name,!0,simpleNames):name;if(icon){const storage2=getStorage(icon.provider,icon.prefix),iconName=icon.name;return storage2.icons[iconName]||(storage2.missing.has(iconName)?null:void 0)}}(iconName);if(!data){const oldState=loader2.value;return oldState&&oldState.name===icon||(loader2.value=null===data?{name:icon}:{name:icon,abort:loadIcons([iconName],updateIconData)}),null}abortLoading(),lastRenderedIconName.value!==icon&&(lastRenderedIconName.value=icon,nextTick(()=>{emit("load",icon)}));const customise=props.customise;if(customise){data=Object.assign({},data);const customised=customise(data.body,iconName.name,iconName.prefix,iconName.provider);"string"==typeof customised&&(data.body=customised)}const classes=["iconify"];return""!==iconName.prefix&&classes.push("iconify--"+iconName.prefix),""!==iconName.provider&&classes.push("iconify--"+iconName.provider),{data:data,classes:classes}}function updateIconData(){const icon=getIcon();icon?icon.data!==iconData.value?.data&&(iconData.value=icon):iconData.value=null}return rendering.value?updateIconData():onMounted(()=>{rendering.value=!0,updateIconData()}),watch(()=>props.icon,updateIconData),onUnmounted(abortLoading),()=>{const icon=iconData.value;if(!icon)return render(emptyIcon,props);let newProps=props;return icon.classes&&(newProps={...props,class:icon.classes.join(" ")}),render({...defaultIconProps,...icon.data},newProps)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),_hoisted_1$3={class:/* @__PURE__ */normalizeClass({"rounded-[8px] size-[40px] bg-(--primary-color) border-0 outline-0 flex justify-center items-center transition-colors":!0})},_sfc_main$5=/* @__PURE__ */defineComponent({__name:"Button",props:{titleColor:{default:"#fff"},titleSize:{default:"10px"},icon:{},iconSize:{default:"24px"},title:{}},emits:["click"],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>(openBlock(),createElementBlock("button",{class:"bg-transparent border-0 btn flex flex-col items-center",style:{cursor:"pointer"},onMousemove:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"])),onMousedown:_cache[1]||(_cache[1]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[2]||(_cache[2]=withModifiers(()=>{},["stop"])),onClick:_cache[3]||(_cache[3]=$event=>emit("click"))},[createElementVNode("div",_hoisted_1$3,[__props.icon?(openBlock(),createBlock(unref(Icon),{key:0,width:__props.iconSize,height:__props.iconSize,color:"#fff",icon:__props.icon},null,8,["width","height","icon"])):createCommentVNode("",!0)]),__props.title?(openBlock(),createElementBlock("span",{key:0,style:normalizeStyle({color:__props.titleColor,fontSize:__props.titleSize}),class:"mt-[5px]"},toDisplayString(__props.title),5)):createCommentVNode("",!0)],32))}});class DrawHole extends Command{static name="DrawHole";container=new THREE.Group;static shortcutKeys=["h"];static commandName="draw-hole";defaultWidth=1;defaultHeight=1;defaultGroundClearance=0;holeKey="passageEntrance";lineSelectorType=["wall"];showEditWidth=!0;showEditHeight=!0;showEditGroundClearance=!0;onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys,commandName:this.commandName,loop:!0});commandFlow.add(this.createCursor("no-drop")),isMobile()&&commandFlow.add(this.selectFirstPoint.bind(this)),commandFlow.add(this.selectLine.bind(this),{prompt:`请选择一条线段作为空洞依附墙体, ${this.formatText("TAB")} 修改孔洞默认宽度, ${this.formatText("ESC")} 取消命令`}),commandFlow.add(this.end.bind(this))}async editWidth(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultWidth,title:"请输入长度",showCancel:!0});this.defaultWidth=w/1e3}async editHeight(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultHeight,title:"请输入高度",showCancel:!0});this.defaultHeight=w/1e3}async editGroundClearance(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultGroundClearance,title:"请输入离地高",showCancel:!0});this.defaultGroundClearance=w/1e3}async selectFirstPoint(next){const onClick=()=>{next(Point.from(this.editor.pointerPosition))};this.editor.domEventRegister.addEventListener("click",onClick,{once:!0}),this.addCommandEndHandle(()=>this.editor.domEventRegister.removeEventListener("click",onClick))}async selectLine(next,point){const holeLine=LineSegment.axisY(this.defaultWidth),wall=new Wall2D(holeLine),lineAlignmentGuide=new LineAlignmentGuide;wall.visible=!1,lineAlignmentGuide.visible=!1,this.container.add(wall),this.container.add(lineAlignmentGuide),wall.position.z=.01;const{pageDestroy:pageDestroy}=(el=this.domElement,editWidth=this.showEditWidth&&(async()=>{await this.editWidth(),holeLine.setLength(this.defaultWidth),wall.setLine(holeLine)}),editHeight=this.showEditHeight&&this.editHeight.bind(this),editGroundClearance=this.showEditGroundClearance&&this.editGroundClearance.bind(this),{directionLock:ref(!1),pageDestroy:createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation(),onPointerup:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[editWidth&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editWidth,icon:"carbon:fit-to-width",title:"长度"},null),editHeight&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editHeight,icon:"carbon:fit-to-height",title:"高度"},null),editGroundClearance&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editGroundClearance,icon:"material-symbols-light:data-thresholding-outline",title:"离地高"},null)])},{},el)});var el,editWidth,editHeight,editGroundClearance;const lineSelector=new LineSelector(this.editor,point).setType(this.lineSelectorType);lineSelector.onPointerMove=(p,line3)=>{const point2=p??Point.from(this.editor.pointerPosition);this.domElement.style.cursor=line3?"move":"no-drop",wall.position.set(point2.x,point2.y,wall.position.z),LineSegment.axisY(this.defaultWidth,holeLine);let angle2=0;if(line3){if(angle2=LineSegment.angleToYAxis(line3),line3.length<holeLine.length)holeLine.setLength(line3.length),wall.position.set(line3.center.x,line3.center.y,wall.position.z);else{const ratioHalf=holeLine.length/line3.length*.5,v=Math.min(1-ratioHalf,Math.max(ratioHalf,line3.projectPointValue(point2))),p2=line3.pointAt(v);wall.position.set(p2.x,p2.y,wall.position.z)}let direction=line3.direction();const hole=Point.from(wall.position).expandAsLine(direction,holeLine.length).translate(.5*-holeLine.length,direction);lineAlignmentGuide.set(line3,hole.points),lineAlignmentGuide.visible=!0}else lineAlignmentGuide.visible=!1;wall.rotation.z=-angle2,wall.visible=!0,wall.setLine(holeLine),this.dispatchEvent({type:"pointerMove",point:point2.toVector3(0),line:line3})},this.addCommandEndHandle().add(()=>{lineAlignmentGuide.clear(),this.container.remove(wall),this.container.remove(lineAlignmentGuide),lineSelector.destroy(),pageDestroy()}),this.awaitOnlyKeys(["tab"],{once:!1}).awaitEach(async()=>{lineSelector.paused||(lineSelector.pause(),await this.editWidth(),holeLine.setLength(this.defaultWidth),wall.setLine(holeLine),lineSelector.resume())});next({line:await lineSelector.getLines(),holeData:{width:holeLine.length,p:{x:wall.position.x,y:wall.position.y,z:0},full:!1,type:this.holeType,groundClearance:this.defaultGroundClearance,height:this.defaultHeight}})}end(next,data){next(data)}onCompleted(data){WallHole.addHole(data.line,data.holeData,this.holeKey),this.renderManager.draw()}onRollback(data){return WallHole.removeHole(data.line,data.holeData),this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class ClippingLine extends DrawHole{static name="ClippingLine";container=new THREE.Group;static shortcutKeys=["C"];static commandName="clippingLine";showEditHeight=!1;showEditGroundClearance=!1;lineSelectorType=["balconyRailing","door","wall"];end(next,data){const clippingLine=WallHole.holeDataToLine(data.line,data.holeData);next({target:data.line,newLines:LineSegmentUtils.clippingByLines(data.line,[clippingLine],clippingLineUserData)??[]})}onCompleted(data){this.renderManager.removeLine(data.target),this.renderManager.addLines(data.newLines),this.renderManager.draw()}onRollback(data){return this.renderManager.addLine(data.target),this.renderManager.removeLines(data.newLines),data}onRevokeRollback(data){return this.onCompleted(data),data}}const _box$1=new Box3,_vector=new Vector3;class LineSegmentsGeometry extends InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(matrix){const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;return void 0!==start&&(start.applyMatrix4(matrix),end.applyMatrix4(matrix),start.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(array){let lineSegments;array instanceof Float32Array?lineSegments=array:Array.isArray(array)&&(lineSegments=new Float32Array(array));const instanceBuffer=new InstancedInterleavedBuffer(lineSegments,6,1);return this.setAttribute("instanceStart",new InterleavedBufferAttribute(instanceBuffer,3,0)),this.setAttribute("instanceEnd",new InterleavedBufferAttribute(instanceBuffer,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(array){let colors;array instanceof Float32Array?colors=array:Array.isArray(array)&&(colors=new Float32Array(array));const instanceColorBuffer=new InstancedInterleavedBuffer(colors,6,1);return this.setAttribute("instanceColorStart",new InterleavedBufferAttribute(instanceColorBuffer,3,0)),this.setAttribute("instanceColorEnd",new InterleavedBufferAttribute(instanceColorBuffer,3,3)),this}fromWireframeGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromEdgesGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromMesh(mesh){return this.fromWireframeGeometry(new WireframeGeometry(mesh.geometry)),this}fromLineSegments(lineSegments){const geometry=lineSegments.geometry;return this.setPositions(geometry.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;void 0!==start&&void 0!==end&&(this.boundingBox.setFromBufferAttribute(start),_box$1.setFromBufferAttribute(end),this.boundingBox.union(_box$1))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sphere),null===this.boundingBox&&this.computeBoundingBox();const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;if(void 0!==start&&void 0!==end){const center=this.boundingSphere.center;this.boundingBox.getCenter(center);let maxRadiusSq=0;for(let i=0,il=start.count;i<il;i++)_vector.fromBufferAttribute(start,i),maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector)),_vector.fromBufferAttribute(end,i),maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector));this.boundingSphere.radius=Math.sqrt(maxRadiusSq),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},ShaderLib.line={uniforms:UniformsUtils.merge([UniformsLib.common,UniformsLib.fog,UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat alpha = opacity;\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class LineMaterial extends ShaderMaterial{constructor(parameters){super({type:"LineMaterial",uniforms:UniformsUtils.clone(ShaderLib.line.uniforms),vertexShader:ShaderLib.line.vertexShader,fragmentShader:ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(parameters)}get color(){return this.uniforms.diffuse.value}set color(value){this.uniforms.diffuse.value=value}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(value){!0===value?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(value){this.uniforms.linewidth&&(this.uniforms.linewidth.value=value)}get dashed(){return"USE_DASH"in this.defines}set dashed(value){!0===value!==this.dashed&&(this.needsUpdate=!0),!0===value?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(value){this.uniforms.dashScale.value=value}get dashSize(){return this.uniforms.dashSize.value}set dashSize(value){this.uniforms.dashSize.value=value}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(value){this.uniforms.dashOffset.value=value}get gapSize(){return this.uniforms.gapSize.value}set gapSize(value){this.uniforms.gapSize.value=value}get opacity(){return this.uniforms.opacity.value}set opacity(value){this.uniforms&&(this.uniforms.opacity.value=value)}get resolution(){return this.uniforms.resolution.value}set resolution(value){this.uniforms.resolution.value.copy(value)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(value){this.defines&&(!0===value!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===value?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const _viewport=new Vector4,_start=new Vector3,_end=new Vector3,_start4=new Vector4,_end4=new Vector4,_ssOrigin=new Vector4,_ssOrigin3=new Vector3,_mvMatrix=new Matrix4,_line=new Line3,_closestPoint=new Vector3,_box=new Box3,_sphere=new Sphere,_clipToWorldVector=new Vector4;let _ray,_lineWidth;function getWorldSpaceHalfWidth(camera,distance,resolution){return _clipToWorldVector.set(0,0,-distance,1).applyMatrix4(camera.projectionMatrix),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),_clipToWorldVector.x=_lineWidth/resolution.width,_clipToWorldVector.y=_lineWidth/resolution.height,_clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),Math.abs(Math.max(_clipToWorldVector.x,_clipToWorldVector.y))}class LineSegments2 extends Mesh{constructor(geometry=new LineSegmentsGeometry,material=new LineMaterial({color:16777215*Math.random()})){super(geometry,material),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const geometry=this.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd,lineDistances=new Float32Array(2*instanceStart.count);for(let i=0,j=0,l=instanceStart.count;i<l;i++,j+=2)_start.fromBufferAttribute(instanceStart,i),_end.fromBufferAttribute(instanceEnd,i),lineDistances[j]=0===j?0:lineDistances[j-1],lineDistances[j+1]=lineDistances[j]+_start.distanceTo(_end);const instanceDistanceBuffer=new InstancedInterleavedBuffer(lineDistances,2,1);return geometry.setAttribute("instanceDistanceStart",new InterleavedBufferAttribute(instanceDistanceBuffer,1,0)),geometry.setAttribute("instanceDistanceEnd",new InterleavedBufferAttribute(instanceDistanceBuffer,1,1)),this}raycast(raycaster,intersects2){const worldUnits=this.material.worldUnits,camera=raycaster.camera;null!==camera||worldUnits||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const threshold=void 0!==raycaster.params.Line2&&raycaster.params.Line2.threshold||0;_ray=raycaster.ray;const matrixWorld=this.matrixWorld,geometry=this.geometry,material=this.material;let sphereMargin,boxMargin;if(_lineWidth=material.linewidth+threshold,null===geometry.boundingSphere&&geometry.computeBoundingSphere(),_sphere.copy(geometry.boundingSphere).applyMatrix4(matrixWorld),worldUnits)sphereMargin=.5*_lineWidth;else{sphereMargin=getWorldSpaceHalfWidth(camera,Math.max(camera.near,_sphere.distanceToPoint(_ray.origin)),material.resolution)}if(_sphere.radius+=sphereMargin,!1!==_ray.intersectsSphere(_sphere)){if(null===geometry.boundingBox&&geometry.computeBoundingBox(),_box.copy(geometry.boundingBox).applyMatrix4(matrixWorld),worldUnits)boxMargin=.5*_lineWidth;else{boxMargin=getWorldSpaceHalfWidth(camera,Math.max(camera.near,_box.distanceToPoint(_ray.origin)),material.resolution)}_box.expandByScalar(boxMargin),!1!==_ray.intersectsBox(_box)&&(worldUnits?function(lineSegments,intersects2){const matrixWorld=lineSegments.matrixWorld,geometry=lineSegments.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd;for(let i=0,l=Math.min(geometry.instanceCount,instanceStart.count);i<l;i++){_line.start.fromBufferAttribute(instanceStart,i),_line.end.fromBufferAttribute(instanceEnd,i),_line.applyMatrix4(matrixWorld);const pointOnLine=new Vector3,point=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,point,pointOnLine),point.distanceTo(pointOnLine)<.5*_lineWidth&&intersects2.push({point:point,pointOnLine:pointOnLine,distance:_ray.origin.distanceTo(point),object:lineSegments,face:null,faceIndex:i,uv:null,uv1:null})}}(this,intersects2):function(lineSegments,camera,intersects2){const projectionMatrix=camera.projectionMatrix,resolution=lineSegments.material.resolution,matrixWorld=lineSegments.matrixWorld,geometry=lineSegments.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd,segmentCount=Math.min(geometry.instanceCount,instanceStart.count),near=-camera.near;_ray.at(1,_ssOrigin),_ssOrigin.w=1,_ssOrigin.applyMatrix4(camera.matrixWorldInverse),_ssOrigin.applyMatrix4(projectionMatrix),_ssOrigin.multiplyScalar(1/_ssOrigin.w),_ssOrigin.x*=resolution.x/2,_ssOrigin.y*=resolution.y/2,_ssOrigin.z=0,_ssOrigin3.copy(_ssOrigin),_mvMatrix.multiplyMatrices(camera.matrixWorldInverse,matrixWorld);for(let i=0,l=segmentCount;i<l;i++){if(_start4.fromBufferAttribute(instanceStart,i),_end4.fromBufferAttribute(instanceEnd,i),_start4.w=1,_end4.w=1,_start4.applyMatrix4(_mvMatrix),_end4.applyMatrix4(_mvMatrix),_start4.z>near&&_end4.z>near)continue;if(_start4.z>near){const deltaDist=_start4.z-_end4.z,t=(_start4.z-near)/deltaDist;_start4.lerp(_end4,t)}else if(_end4.z>near){const deltaDist=_end4.z-_start4.z,t=(_end4.z-near)/deltaDist;_end4.lerp(_start4,t)}_start4.applyMatrix4(projectionMatrix),_end4.applyMatrix4(projectionMatrix),_start4.multiplyScalar(1/_start4.w),_end4.multiplyScalar(1/_end4.w),_start4.x*=resolution.x/2,_start4.y*=resolution.y/2,_end4.x*=resolution.x/2,_end4.y*=resolution.y/2,_line.start.copy(_start4),_line.start.z=0,_line.end.copy(_end4),_line.end.z=0;const param=_line.closestPointToPointParameter(_ssOrigin3,!0);_line.at(param,_closestPoint);const zPos=MathUtils.lerp(_start4.z,_end4.z,param),isInClipSpace=zPos>=-1&&zPos<=1,isInside=_ssOrigin3.distanceTo(_closestPoint)<.5*_lineWidth;if(isInClipSpace&&isInside){_line.start.fromBufferAttribute(instanceStart,i),_line.end.fromBufferAttribute(instanceEnd,i),_line.start.applyMatrix4(matrixWorld),_line.end.applyMatrix4(matrixWorld);const pointOnLine=new Vector3,point=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,point,pointOnLine),intersects2.push({point:point,pointOnLine:pointOnLine,distance:_ray.origin.distanceTo(point),object:lineSegments,face:null,faceIndex:i,uv:null,uv1:null})}}}(this,camera,intersects2))}}onBeforeRender(renderer){const uniforms=this.material.uniforms;uniforms&&uniforms.resolution&&(renderer.getViewport(_viewport),this.material.uniforms.resolution.value.set(_viewport.z,_viewport.w))}}class LineGeometry extends LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(array){const length=array.length-3,points=new Float32Array(2*length);for(let i=0;i<length;i+=3)points[2*i]=array[i],points[2*i+1]=array[i+1],points[2*i+2]=array[i+2],points[2*i+3]=array[i+3],points[2*i+4]=array[i+4],points[2*i+5]=array[i+5];return super.setPositions(points),this}setColors(array){const length=array.length-3,colors=new Float32Array(2*length);for(let i=0;i<length;i+=3)colors[2*i]=array[i],colors[2*i+1]=array[i+1],colors[2*i+2]=array[i+2],colors[2*i+3]=array[i+3],colors[2*i+4]=array[i+4],colors[2*i+5]=array[i+5];return super.setColors(colors),this}setFromPoints(points){const length=points.length-1,positions=new Float32Array(6*length);for(let i=0;i<length;i++)positions[6*i]=points[i].x,positions[6*i+1]=points[i].y,positions[6*i+2]=points[i].z||0,positions[6*i+3]=points[i+1].x,positions[6*i+4]=points[i+1].y,positions[6*i+5]=points[i+1].z||0;return super.setPositions(positions),this}fromLine(line2){const geometry=line2.geometry;return this.setPositions(geometry.attributes.position.array),this}}class Line2 extends LineSegments2{constructor(geometry=new LineGeometry,material=new LineMaterial({color:16777215*Math.random()})){super(geometry,material),this.isLine2=!0,this.type="Line2"}}class Lines2 extends Line2{points=[];continuous=!0;constructor(points=[],color=16777215,opt){super(),this.addPoint(...points),this.frustumCulled=!1,this.material=new LineMaterial({...opt,color:color})}addPoint(...points){this.points.push(...points),this.updateGeometry()}setPoint(...points){this.points.length=0,this.addPoint(...points)}setColor(color){this.material.color instanceof THREE.Color?this.material.color.setHex(color):this.material.color=new THREE.Color(color)}setOpacity(opacity){this.material.transparent=!0,this.material.opacity=opacity}setDashSize(dashSize){this.material.dashSize=dashSize,this.computeLineDistances()}setLinewidth(linewidth){this.material.linewidth=linewidth}setGapSize(gapSize){this.material.gapSize=gapSize,this.computeLineDistances()}getCenter(startIndex,endIndex){if(endIndex=endIndex??startIndex,startIndex<=this.points.length-1&&endIndex<=this.points.length-1){const start=this.points[startIndex],end=this.points[endIndex];return start.clone().add(end).multiplyScalar(.5)}throw new Error("索引不在可取范围")}getDistance(startIndex,endIndex){if(endIndex=endIndex??startIndex,startIndex<=this.points.length-1&&endIndex<=this.points.length-1){const start=this.points[startIndex],end=this.points[endIndex];return start.distanceTo(end)}throw new Error("索引不在可取范围")}_timer=null;updateGeometry(){this._timer&&clearTimeout(this._timer),this.clear(),this._timer=setTimeout(()=>{if(this.continuous)this.points.forEach((p,i)=>{if(0===i)return;const p0=this.points[i-1],geometry=new LineGeometry;geometry.setPositions([p0.x,p0.y,p0.z,p.x,p.y,p.z]);const line2=new Line2(geometry,this.material);line2.computeLineDistances(),this.add(line2)});else for(let i=0;i<this.points.length;i+=2){const p0=this.points[i],p=this.points[i+1],geometry=new LineGeometry;geometry.setPositions([p0.x,p0.y,p0.z,p.x,p.y,p.z]);const line2=new Line2(geometry,this.material);line2.computeLineDistances(),this.add(line2)}this._timer=null,this.dispatchEvent({type:"updateGeometry"})})}}function modifyWindow(context,winLine,line2){let data=winLine.currentData.insertObject,oldWinLine=winLine;winLine=winLine.clone(),WallHole.removeHole(line2,data),context.renderManager.draw();const{promise:promise,resolve:resolve}=createPromise(),lineMesh=new(isMobileRef.value?Lines:Lines2)([winLine.start.toVector3(),winLine.end.toVector3()],16711935,{linewidth:4}),dragPoint=new THREE.Vector3(0,0,0);lineMesh.position.z=.005,context.container.add(lineMesh);const text1=context.renderer.createText("",line2.start,{color:"#00ff00"},context.container);text1.visible=!1;const text2=context.renderer.createText("",line2.end,{color:"#00ff00"},context.container);text2.visible=!1;const{destroy:destroy,dragPointMesh:dragPointMesh,setPoint:setDragPoint}=context.createDragPoint(winLine.center,{size:20,onChange:p=>{context.pointLineConstraint(p,line2);const center=winLine.center,distance=center.distance(p);winLine.translate(distance,p.directionFrom(center)),LineSegmentUtils.constrainLine(winLine,line2),dragPoint.copy(p.toJson()),lineMesh.setPoint(winLine.start.toVector3(),winLine.end.toVector3()),editBtn.setPosition(winLine.center);const[l1,l2]=LineSegmentUtils.clippingByLine(line2,winLine)??[];l1?(text1.visible=!0,text1.position.copy(l1.center.toJson(0)),text1.element.innerText=`${mToMm(l1.length)}mm`):text1.visible=!1,l2?(text2.visible=!0,text2.position.copy(l2.center.toJson(0)),text2.element.innerText=`${mToMm(l2.length)}mm`):text2.visible=!1},onStart(){editBtn.visible=!1},onEnd(){setDragPoint(winLine.center),editBtn.setPosition(winLine.center),editBtn.visible=!0,text1.visible=!1,text2.visible=!1}}),editBtn=context.createEditButton({position:winLine.center,style:{marginLeft:"40px"},onClick:async()=>{editBtn.visible=!1,dragPointMesh.visible=!1,await function(context,winLine,line2,lineMesh){function end(){if(!ended){if(width.value<200)return ElMessage({message:"窗户长度不能小于200mm",type:"warning"});ended=!0,close2(),marginText1.removeFromParent(),marginText2.removeFromParent(),widthText.removeFromParent(),resolve(!0)}}function update(){LineSegmentUtils.constrainLine(winLine,line2),width.value=mToMm(winLine.length);let w=mmTom(width.value);center.copy(winLine.center),startWidth.value=mToMm(line2.start.distance(center)-.5*w),endWidth.value=mToMm(line2.end.distance(center)-.5*w),widthText.setPosition(winLine.center),lineMesh.setPoint(winLine.start.toVector3(),winLine.end.toVector3())}let ended=!1;const list=[{title:"长度",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:width.value,"onUpdate:modelValue":$event=>width.value=$event,showCancel:!1,showConfirm:!1},null)])},{title:"边距1",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:startWidth.value,"onUpdate:modelValue":$event=>startWidth.value=$event,showCancel:!1,showConfirm:!1},null)])},{title:"边距2",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:endWidth.value,"onUpdate:modelValue":$event=>endWidth.value=$event,showCancel:!1,showConfirm:!1},null)])}],len=winLine.length,value=ref(0),center=winLine.center,width=ref(mToMm(winLine.length)),winLineDir=winLine.direction(),startWidth=ref(mToMm(line2.start.distance(center)-.5*len)),endWidth=ref(mToMm(line2.end.distance(center)-.5*len)),{promise:promise,resolve:resolve}=createPromise(),marginText1=context.createButton({text:"边距1",position:line2.start,onClick:()=>value.value=1}),marginText2=context.createButton({text:"边距2",position:line2.end,onClick:()=>value.value=2}),widthText=context.createButton({text:"长度",position:winLine.center,onClick:()=>value.value=0});watch(width,()=>{const center2=winLine.center;let w=mmTom(width.value);winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()}),watch(startWidth,value2=>{const center2=winLine.center,dir=line2.end.directionFrom(line2.start);let w=mmTom(width.value);center2.copy(line2.start).add(dir.multiplyScalar(.5*w+mmTom(value2))),winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()}),watch(endWidth,value2=>{const center2=winLine.center,dir=line2.start.directionFrom(line2.end);let w=mmTom(width.value);center2.copy(line2.end).add(dir.multiplyScalar(.5*w+mmTom(value2))),winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()});const close2=context.createVueApp(()=>createVNode("div",{class:"absolute left-0 top-0 w-full h-full overlay z-100",onMousedown:e=>e.stopPropagation()},[createVNode("div",{class:{"absolute bg-white shadow flex flex-col box-border":!0,"bottom-0 left-0 w-full":isMobileRef.value,"top-0 right-0 h-full min-w-[200px] cursor-pointer":!isMobileRef.value}},[createVNode("ul",{class:"flex items-center gap-[20px] p-[10px]"},[list.map((item,i)=>createVNode("li",{class:{" border-b-transparent border-b-2 text-[14px]":!0,"border-b-(--primary-color)!":value.value===i},onMousedown:()=>value.value=i,onTouchstart:()=>value.value=i},[item.title])),createVNode("li",{class:"flex-1"},null),isMobileRef.value&&createVNode("li",null,[createVNode("button",{onClick:end,class:"button-click"},[createTextVNode("确认")])])]),createVNode("div",{class:"p-[0px_10px]"},[h(list[value.value].content)]),isMobileRef.value||createVNode("div",{class:"p-[10px] flex justify-end mt-[10px]"},[createVNode("button",{onClick:end,class:"button-click"},[createTextVNode("确认")])])])]),{});return context.addCommandEndHandle(end),promise}(context,winLine,line2,lineMesh),editBtn.visible=!0,dragPointMesh.visible=!0,setDragPoint(winLine.center),editBtn.setPosition(winLine.center)}});return context.addCommandEndHandle(()=>{destroy(),editBtn.removeFromParent(),context.container.clear(),data&&(WallHole.addHole(line2,data),context.renderManager.draw())}),context.showConfirm.value=!0,context.awaitOnlyKeys(["enter"]).then(()=>{WallHole.addHole(line2,data),context.renderManager.draw();const opt={type:"window",line:line2,holeData:data,old:{p:oldWinLine.center.toJson(data.p.z),width:oldWinLine.length},new:{p:winLine.center.toJson(data.p.z),width:winLine.length}};data=null,resolve(opt)}),promise}const _sfc_main$4=/* @__PURE__ */defineComponent({__name:"ToolToggle",props:/* @__PURE__ */mergeModels({titleColor:{default:"#fff"},titleSize:{default:"10px"},icon:{},iconSize:{default:"24px"},title:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(__props){const directionLock=useModel(__props,"modelValue");function toggleDirectionLock(){directionLock.value=!directionLock.value}return(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:"flex flex-col items-center",style:{cursor:"pointer"},onMousemove:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"])),onMousedown:_cache[1]||(_cache[1]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[2]||(_cache[2]=withModifiers(()=>{},["stop"])),onClick:withModifiers(toggleDirectionLock,["stop"])},[createElementVNode("div",{class:normalizeClass(["rounded-[100px] size-[40px] flex justify-center items-center transition-colors",directionLock.value?"bg-(--primary-color)":"bg-[#717171]"])},[__props.icon?(openBlock(),createBlock(unref(Icon),{key:0,width:__props.iconSize,height:__props.iconSize,color:"#fff",icon:__props.icon},null,8,["width","height","icon"])):createCommentVNode("",!0)],2),__props.title?(openBlock(),createElementBlock("span",{key:0,style:normalizeStyle({color:__props.titleColor,fontSize:__props.titleSize}),class:"mt-[5px]"},toDisplayString(__props.title),5)):createCommentVNode("",!0)],32))}});async function modifyLine(context,line2){function updateLinesMesh(){const points=[line2.start.toVector3(),line2.end.toVector3()];linesMesh.setPoint(...points);const points2=[];list.forEach(items=>{items.list.forEach(item=>{points2.push(item.line.start.toVector3(),item.line.end.toVector3())})}),linesMesh2.setPoint(...points2)}function setPoint(point,newPoint){const newValue=newPoint.toJson(),records=[{target:point,oldValue:point.toJson(),value:newValue}];point.copy(newPoint),width.value=mToMm(line2.length),follow.value&&list.forEach(item=>{item.point===point&&item.list.forEach(item2=>{records.push({target:item2.point,oldValue:item2.point.toJson(),value:newValue}),item2.point.copy(newPoint)})}),writeIndex>-1&&(recordsList[writeIndex]=records),recordCount.value=recordsList.length,updateLinesMesh()}function end(){ended.value||(ended.value=!0,destroy(),group.clear(),group.removeFromParent(),context.renderManager.addLine(oldLine),list.forEach(items=>items.list.forEach((item,i)=>{item.line.start.copy(items.olds[i].start),item.line.end.copy(items.olds[i].end),context.renderManager.addLine(item.line)})),context.renderManager.draw())}const{directionLock:directionLock,follow:follow,recordCount:recordCount,destroy:destroy}=function(context,opt){const directionLock=ref(!1),follow=ref(!0),recordCount=ref(0),destroy=context.createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode(_sfc_main$4,{icon:"tdesign:rotate-locked-filled",modelValue:directionLock.value,"onUpdate:modelValue":$event=>directionLock.value=$event,title:"方向锁定"},null),createVNode(_sfc_main$4,{icon:"gis:snap",modelValue:follow.value,"onUpdate:modelValue":$event=>follow.value=$event,title:"跟随移动"},null),createVNode(_sfc_main$5,{title:"重置位置",onClick:opt.onResetClick,icon:"system-uicons:reset"},null)])});return{directionLock:directionLock,follow:follow,destroy:destroy,recordCount:recordCount}}(context,{onResetClick(){0!==recordsList.length&&(writeIndex=recordsList.length,setPoint(line2.start,oldLine.start.clone()),setPoint(line2.end,oldLine.end.clone()),list[0].setDragPos(line2.start),list[1].setDragPos(line2.end))}}),{promise:promise,resolve:resolve}=createPromise(),oldLine=line2,group=new Group,linesMesh=new Lines([],65280),linesMesh2=new LineDashed([],5745151),width=ref(mToMm(line2.length)),dragging=ref(!1),ended=ref(!1),ControlZ=context.awaitOnlyKeys(["Control","Z"],{once:!1}),recordsList=[];context.renderManager.removeLine(line2),group.add(linesMesh),group.add(linesMesh2),context.container.add(group),linesMesh2.setOpacity(.5),linesMesh2.continuous=!1,line2=line2.clone();let writeIndex=0,baseLine=line2.clone();ControlZ.awaitEach(function(){const data=recordsList.pop();data&&(data.forEach(item=>{item.target.copy(item.oldValue)}),updateLinesMesh(),recordCount.value=recordsList.length)});const list=line2.points.map((point,index)=>{const list2=context.renderManager.pointVirtualGrid.queryPoint(point).map(item=>({line:item.userData,point:item.point})),olds=list2.map(item=>({line:item.line,start:item.line.start.toJson(),end:item.line.end.toJson()}));list2.forEach(item=>context.renderManager.removeLine(item.line));const{setPoint:setDragPos,destroy:destroy2,dragPointMesh:dragPointMesh}=context.createDragPoint(point,{size:20,auxiliaryLine:!0,onStart(){baseLine=line2.clone(),dragging.value=!0,writeIndex=recordsList.length,textMesh.visible=!0,textMesh.setText(width.value+"mm"),textMesh.setPosition(line2.center)},onEnd(){setDragPos(point),dragging.value=!1,textMesh.visible=!1},onChange(p){directionLock.value&&baseLine&&context.pointLineConstraint(p,baseLine,0===index?baseLine.points[1]:baseLine.points[0]),setPoint(point,p),textMesh.setText(width.value+"mm"),textMesh.setPosition(line2.center)}}),textMesh=context.createButton({text:""}),btn=context.createEditButton({text:width.value+"mm",parent:dragPointMesh,style:{marginLeft:"20px",transform:"translateY(-50%)"},position:Point.zero(),freedom:!0,async onClick(){const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width.value,showCancel:!0,minWidth:200});context.addCommandEndHandle(close2);const w=mmTom(await promise2),otherPoint=line2.getAnotherPoint(point),dir=point.directionFrom(otherPoint);setPoint(point,otherPoint.clone().add(dir.multiplyScalar(w))),setDragPos(point)}});return textMesh.visible=!1,watch(width,()=>btn.setText(width.value+"mm")),watch(dragging,()=>btn.visible=!dragging.value),watch(ended,()=>destroy2()),{point:point,olds:olds,list:list2,setDragPos:setDragPos}});return watch(follow,b=>{list.forEach(items=>{items.list.forEach((item,i)=>{b?items.list.forEach(item2=>item2.point.copy(items.point)):(item.line.start.copy(items.olds[i].start),item.line.end.copy(items.olds[i].end))}),updateLinesMesh()})}),updateLinesMesh(),context.addCommandEndHandle(end),context.showConfirm.value=!0,context.awaitOnlyKeys(["enter"]).then(()=>{const data=list.flatMap(items=>items.list.map((item,i)=>({line:item.line,old:{start:items.olds[i].start,end:items.olds[i].end},new:{start:item.line.start.toJson(),end:item.line.end.toJson()}})));data.push({line:oldLine,old:{start:oldLine.start.toJson(),end:oldLine.end.toJson()},new:{start:line2.start.toJson(),end:line2.end.toJson()}}),end(),resolve({type:"line",list:data})}),promise}class PointDrag extends Command{static name="PointDrag";static shortcutKeys=["F"];static commandName="point";container=new THREE.Group;showConfirm=ref(!1);onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys,loop:!0});commandFlow.add(this.createCursor("no-drop")).add(this.selectLine.bind(this),{prompt:`请选择需要修改的线段, ${this.formatText("ESC")} 取消命令`,showConfirm:this.showConfirm}),commandFlow.add(this.verify.bind(this))}async selectLine(next){this.showConfirm.value=!1,this.commandFlow.writeOperationRecord=!0;const wallLine=new LineSegment,wallObj=new Wall2D(wallLine,.02).setColor(new THREE.Color(65280));this.container.add(wallObj);const lineSelector=new LineSelector(this.editor).setType("all");lineSelector.onPointerMove=(_,line22)=>{line22?(wallLine.copy(line22),wallObj.visible=!0,this.domElement.style.cursor="pointer"):(wallObj.visible=!1,this.domElement.style.cursor="no-drop")},this.addCommandEndHandle(lineSelector.destroy.bind(lineSelector),()=>wallObj.removeFromParent());const line2=await lineSelector.getLines();lineSelector.destroy(),wallObj.removeFromParent(),line2&&(line2.currentData.insertObject?next(await modifyWindow(this,line2,line2.currentData.line)):(line2.userData.isDoor,next(await modifyLine(this,line2))))}async verify(next,data){"window"===data.type?JSON.stringify(data.new)===JSON.stringify(data.old)&&(this.commandFlow.writeOperationRecord=!1):"door"!==data.type&&"line"!==data.type||JSON.stringify(data.list[0].new)===JSON.stringify(data.list[0].old)&&(this.commandFlow.writeOperationRecord=!1),next(data),queueMicrotask(()=>this.commandFlow.writeOperationRecord=!0)}onCompleted(data){if("window"===data.type){const item=data.holeData;item.p=data.new.p,item.width=data.new.width}else"door"!==data.type&&"line"!==data.type||data.list.forEach(({line:line2,new:newData})=>{line2.start.copy(newData.start),line2.end.copy(newData.end),WallHole.filterIllegal([line2]),this.renderManager.removeLine(line2),this.renderManager.addLine(line2)});this.renderManager.draw()}onRollback(data){if("window"===data.type){const item=data.holeData;item.p=data.old.p,item.width=data.old.width}else"door"!==data.type&&"line"!==data.type||data.list.forEach(({line:line2,old:newData})=>{line2.start.copy(newData.start),line2.end.copy(newData.end),WallHole.filterIllegal([line2]),this.renderManager.removeLine(line2),this.renderManager.addLine(line2)});return this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class VerticalCorrContinue extends Command{static name="VerticalCorrContinue";container=new THREE.Group;static shortcutKeys=["Control","Shift","V"];static commandName="VerticalCorrContinue";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;this.initCommandFlow({getStartData:()=>[...this.default.selectLines]}).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this))}constraint(next,selectLines){Array.isArray(selectLines)?1!==selectLines.length?(ElMessage({message:"请选择一条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}verticalCorrection(next,selectLines){const targettLine=selectLines[0],oldLines=[...this.renderManager.lines];next({newLines:LinePipeline.builtin.AxisAlignCorr(LineSegmentUtils.clone(oldLines),this.editor.dxf.options,targettLine),oldLines:oldLines})}onCompleted(data){this.renderManager.removeLineAll(!1),this.renderManager.addLines(data.newLines),this.renderManager.draw()}onRollback(data){return this.renderManager.removeLineAll(!1),this.renderManager.addLines(data.oldLines),this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class RayDistance extends Command{static name="RayDistance";container=new THREE.Group;static shortcutKeys=["R"];static commandName="RayDistance";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);this.initCommandFlow({shortcutKeys:this.shortcutKeys,writeOperationRecord:!1,loop:!0}).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this),{prompt:`请选择线段上的一个点作为发射点, ${this.formatText("ESC")} 取消命令`}).add(this.ray.bind(this),{prompt:`按 ${this.formatText("Enter")} 重新选择发射点, ${this.formatText("ESC")} 取消命令`})}async selectPoint(next){const pointSelector=this.createPointSelector();this.addEventRecord("clear",()=>this.container.clear());const result=await pointSelector.next("line_point");result&&next(result)}async ray(next,{line:line2,point:point}){const normal=line2.normal(),nNormal=normal.clone().multiplyScalar(-1),rayLine1=new LineSegment(point,point.clone().add(normal.multiplyScalar(100))),rayLine2=new LineSegment(point,point.clone().add(nNormal.multiplyScalar(100))),lineObj=this.renderer.createLineSegments([rayLine1,rayLine2],0,{color:196352},this.container);[rayLine1,rayLine2].forEach(rayLine=>{const points=this.renderManager.quadtree.queryLineSegment(rayLine).filter(item=>item.line!==rayLine).map(item=>rayLine.getIntersection(item.line)).filter(p=>!!p);points.sort((a,b)=>point.distance(a)-point.distance(b)).forEach((p,i)=>{const distance=1e3*point.distance(p);if(distance<.001)return;const points2=function(start,end,offset=.5){const offsetDistance=end.leftNormal(start).multiplyScalar(offset),startOffPoint=start.clone().add(offsetDistance);return[start,startOffPoint,end.clone().add(offsetDistance),end]}(point,p,.3*i),auxiliaryLine=new Lines;auxiliaryLine.position.z=.006,auxiliaryLine.material=new THREE.LineDashedMaterial({color:16777215,dashSize:.02,gapSize:.02}),auxiliaryLine.setPoint(...points2.map(p2=>new THREE.Vector3(p2.x,p2.y,0))),this.container.add(auxiliaryLine),setTimeout(()=>auxiliaryLine.computeLineDistances());const text=this.renderer.createText(Number(distance.toFixed(0))+"mm",points2[1].clone().add(points2[2]).multiplyScalar(.5),{background:"#333333",padding:"0px",borderRadius:"0px",color:"#fff"},this.container),circle=this.renderer.createCircle(p,{},this.container);this.addEventRecord("clear",()=>{auxiliaryLine.removeFromParent(),text.removeFromParent(),circle.removeFromParent()})})}),this.addEventRecord("clear",()=>{lineObj.removeFromParent()}),await this.awaitOnlyKeys(["enter"]),next()}}class ManualDistance extends Command{static name="ManualDistance";container=new THREE.Group;static shortcutKeys=["M"];static commandName="ManualDistance";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);this.initCommandFlow({shortcutKeys:this.shortcutKeys,writeOperationRecord:!1,loop:!0}).add(this.createCursor("crosshair")).add(this.selectPointStart.bind(this),{prompt:`请选择两个点, ${this.formatText("ESC")} 取消命令`}).add(this.ray.bind(this),{prompt:`按 ${this.formatText("Enter")} 重新选择, ${this.formatText("ESC")} 取消命令`})}async selectPointStart(next){const pointSelector=this.createPointSelector();this.addCommandEndHandle(()=>this.container.clear());let points=[];await pointSelector.awaitEach(result=>{if(!result)return;const{point:point}=result;this.renderer.createCircle(point,{},this.container),points.push(point),2===points.length&&pointSelector.end()},"all"),2===points.length&&next({point1:points[0],point2:points[1]})}async ray(next,{point1:point1,point2:point2}){const lineAlignmentGuide=new LineAlignmentGuide;this.container.add(lineAlignmentGuide),lineAlignmentGuide.set(new LineSegment(point1,point2)),this.renderer.createLineSegments([new LineSegment(point1,point2)],0,{color:65280},this.container),this.addCommandEndHandle(()=>{lineAlignmentGuide.removeFromParent()}),await this.awaitOnlyKeys(["enter"]),next()}}function earcut(data,holeIndices,dim=2){const outerLen=data.length;let outerNode=function(data,start,end,dim,clockwise){let last2;if(clockwise===function(data,start,end,dim){let sum=0;for(let i=start,j=end-dim;i<end;i+=dim)sum+=(data[j]-data[i])*(data[i+1]+data[j+1]),j=i;return sum}(data,start,end,dim)>0)for(let i=start;i<end;i+=dim)last2=insertNode(i/dim|0,data[i],data[i+1],last2);else for(let i=end-dim;i>=start;i-=dim)last2=insertNode(i/dim|0,data[i],data[i+1],last2);last2&&equals(last2,last2.next)&&(removeNode(last2),last2=last2.next);return last2}(data,0,outerLen,dim,!0);const triangles=[];if(!outerNode||outerNode.next===outerNode.prev)return triangles;let minX,minY,invSize;if(data.length>80*dim){minX=data[0],minY=data[1];let maxX=minX,maxY=minY;for(let i=dim;i<outerLen;i+=dim){const x=data[i],y=data[i+1];x<minX&&(minX=x),y<minY&&(minY=y),x>maxX&&(maxX=x),y>maxY&&(maxY=y)}invSize=Math.max(maxX-minX,maxY-minY),invSize=0!==invSize?32767/invSize:0}return earcutLinked(outerNode,triangles,dim,minX,minY,invSize,0),triangles}function filterPoints(start,end){if(!start)return start;end||(end=start);let again,p=start;do{if(again=!1,p.steiner||!equals(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(removeNode(p),p=end=p.prev,p===p.next)break;again=!0}}while(again||p!==end);return end}function earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(!ear)return;!pass&&invSize&&function(start,minX,minY,invSize){let p=start;do{0===p.z&&(p.z=zOrder(p.x,p.y,minX,minY,invSize)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==start);p.prevZ.nextZ=null,p.prevZ=null,function(list){let numMerges,inSize=1;do{let e,p=list;list=null;let tail=null;for(numMerges=0;p;){numMerges++;let q=p,pSize=0;for(let i=0;i<inSize&&(pSize++,q=q.nextZ,q);i++);let qSize=inSize;for(;pSize>0||qSize>0&&q;)0!==pSize&&(0===qSize||!q||p.z<=q.z)?(e=p,p=p.nextZ,pSize--):(e=q,q=q.nextZ,qSize--),tail?tail.nextZ=e:list=e,e.prevZ=tail,tail=e;p=q}tail.nextZ=null,inSize*=2}while(numMerges>1)}(p)}(ear,minX,minY,invSize);let stop=ear;for(;ear.prev!==ear.next;){const prev=ear.prev,next=ear.next;if(invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear))triangles.push(prev.i,ear.i,next.i),removeNode(ear),ear=next.next,stop=next.next;else if((ear=next)===stop){pass?1===pass?earcutLinked(ear=cureLocalIntersections(filterPoints(ear),triangles),triangles,dim,minX,minY,invSize,2):2===pass&&splitEarcut(ear,triangles,dim,minX,minY,invSize):earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);break}}}function isEar(ear){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=Math.min(ax,bx,cx),y0=Math.min(ay,by,cy),x1=Math.max(ax,bx,cx),y1=Math.max(ay,by,cy);let p=c.next;for(;p!==a;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function isEarHashed(ear,minX,minY,invSize){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=Math.min(ax,bx,cx),y0=Math.min(ay,by,cy),x1=Math.max(ax,bx,cx),y1=Math.max(ay,by,cy),minZ=zOrder(x0,y0,minX,minY,invSize),maxZ=zOrder(x1,y1,minX,minY,invSize);let p=ear.prevZ,n=ear.nextZ;for(;p&&p.z>=minZ&&n&&n.z<=maxZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}for(;p&&p.z>=minZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;n&&n.z<=maxZ;){if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}return!0}function cureLocalIntersections(start,triangles){let p=start;do{const a=p.prev,b=p.next.next;!equals(a,b)&&intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)&&(triangles.push(a.i,p.i,b.i),removeNode(p),removeNode(p.next),p=start=b),p=p.next}while(p!==start);return filterPoints(p)}function splitEarcut(start,triangles,dim,minX,minY,invSize){let a=start;do{let b=a.next.next;for(;b!==a.prev;){if(a.i!==b.i&&isValidDiagonal(a,b)){let c=splitPolygon(a,b);return a=filterPoints(a,a.next),c=filterPoints(c,c.next),earcutLinked(a,triangles,dim,minX,minY,invSize,0),void earcutLinked(c,triangles,dim,minX,minY,invSize,0)}b=b.next}a=a.next}while(a!==start)}function zOrder(x,y,minX,minY,invSize){return(x=1431655765&((x=858993459&((x=252645135&((x=16711935&((x=(x-minX)*invSize|0)|x<<8))|x<<4))|x<<2))|x<<1))|(y=1431655765&((y=858993459&((y=252645135&((y=16711935&((y=(y-minY)*invSize|0)|y<<8))|y<<4))|y<<2))|y<<1))<<1}function pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,px,py){return!(ax===px&&ay===py)&&function(ax,ay,bx,by,cx,cy,px,py){return(cx-px)*(ay-py)>=(ax-px)*(cy-py)&&(ax-px)*(by-py)>=(bx-px)*(ay-py)&&(bx-px)*(cy-py)>=(cx-px)*(by-py)}(ax,ay,bx,by,cx,cy,px,py)}function isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(a,b){let p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&(locallyInside(a,b)&&locallyInside(b,a)&&function(a,b){let p=a,inside=!1;const px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{p.y>py!=p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x&&(inside=!inside),p=p.next}while(p!==a);return inside}(a,b)&&(area(a.prev,a,b.prev)||area(a,b.prev,b))||equals(a,b)&&area(a.prev,a,a.next)>0&&area(b.prev,b,b.next)>0)}function area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y)}function equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y}function intersects(p1,q1,p2,q2){const o1=sign(area(p1,q1,p2)),o2=sign(area(p1,q1,q2)),o3=sign(area(p2,q2,p1)),o4=sign(area(p2,q2,q1));return o1!==o2&&o3!==o4||(!(0!==o1||!onSegment(p1,p2,q1))||(!(0!==o2||!onSegment(p1,q2,q1))||(!(0!==o3||!onSegment(p2,p1,q2))||!(0!==o4||!onSegment(p2,q1,q2)))))}function onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y)}function sign(num){return num>0?1:num<0?-1:0}function locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function splitPolygon(a,b){const a2=createNode(a.i,a.x,a.y),b2=createNode(b.i,b.x,b.y),an2=a.next,bp=b.prev;return a.next=b,b.prev=a,a2.next=an2,an2.prev=a2,b2.next=a2,a2.prev=b2,bp.next=b2,b2.prev=bp,b2}function insertNode(i,x,y,last2){const p=createNode(i,x,y);return last2?(p.next=last2.next,p.prev=last2,last2.next.prev=p,last2.next=p):(p.prev=p,p.next=p),p}function removeNode(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function createNode(i,x,y){return{i:i,x:x,y:y,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const texture=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKdUlEQVR4AeydbZrUKBRGq2YjOjvpWYntStSVjK5EdzLOSsr7arBLOkkBAcLHmacwlQQInMsZUvdP/3Xhv+oEbrfbk5XYz1P1gfLAC4KwCCCwQwBBduBwCwIIwhqAwA4BBNmBwy0IFBQEuBDonwCC9B9DZlCQAIIUhEvX/RNAkP5jyAwKEkCQgnDpun8CfQrSP3dm0AkBBOkkUAzzHAIIcg53ntoJAQTpJFAM8xwCCHIOd57aCQEE8QLFKQTuCSDIPQ2+Q8AjgCAeEE4hcE8AQe5p8B0CHgEE8YBwCoF7AghyT6Psd3rvkACCdBg0hlyPAILUY82TOiSAIB0GjSHXI4Ag9VjzpA4JIEiHQXs9ZK6UIoAgpcjS7xAEEGSIMDKJUgQQpBRZ+h2CAIIMEUYmUYoAgpQiO0q/k88DQSZfAEx/nwCC7PPh7uQEEGTyBcD09wkgyD4f7k5OAEEmXwBnTr+HZyNID1FijKcRQBAP/e12e2vl2cqHUsUe+c5K7OddqfG4fmMHNEN9BPGifL1ev9ulN1Y+FizP1nfsR21Kjun/2AHNUB9BVqJsknyyy1qMdpji89nm/HmKmUZOEkE2gNmCkSTaTTZqDHP5m831/TCz+TWRbP8iyA5KWzh/2+2RJfluc/zH5shngwCCbIC5u6wFNKIkmhM7x12g174iyBqVu2v2f1gtpBFft97b3L7dTZWvKwQQZAWKf8kWkn7Aqvi3ej1HjsDIIUggKJNEu8gImS0yVoExV7XXgugqZZXAIoleuVbvd3CRjFVkkBAkEphJ0mtmi4xVZKxVHUFEIb70ltnSrkfGKj7OFwRJgGa7iBacfpPomNBD9Sb8KE9EjiCJ4EwSZbVUEnuo1gw5DqCuKsiBcTbZ1CTRLtJyZouM1cGVgyAHAS6StPiqRcbqYGzVHEFE4WAxSVrLbJGxOhhT1xxBHInjx1YyW9rNyFgdj+fPHhDkJ4bj/9guooWp3yQ6Hu8wvQd+lKeze9VyFEFeTeyMCyaJsloqZzxez0QOUchYECQjTHVlkmgXOSOzRcZKAchcECQzUHW3SFLzVYuMlcAXKAhSAKq6NElqZbbIWAl4oYIghcAu3ZbObGmXImO1wC5xQJCHVNMr2C6iBazfJDqmd7Tdkh/l22yy3EGQLBi3OzFJlNVS2a6Udgc50rhFtUKQKFxplU0S7SI5M1tkrNJCEd0KQaKRpTVYJMnxqkXGKi0ESa0QJAlbWiOT5Ghmi4xVGvrkVgiSjC654UtmK64L7T5krOKYHa6NIIcRxnVgu4gWun6T6BjTmB/lMbQy1UWQTCBjujFJlNVSCW2GHKGkMtdDkMxAQ7szSbSLhGS2yFiFQi1QD0EKQA3tcpFk71WLjFUozEL1EKQQ2NBuTZKtzNahjFXo86m3TwBB9vnUuutntrSrkLGqRX/nOQiyA6fWLdtFJIR+k+iox/KjXBQaKAjSQBA0BJNEWS0V5BCQRgqCNBIIDcMk+WRFkuiU0gABBGkgCJ0NYarhIshU4WaysQQQJJYY9acigCBThZvJxhJAkFhi1J+KAIJMFe7WJ9ve+BCkvZgwooYIIEhDwWAo7RFAkPZiwogaIoAgDQWDobRHAEHaiwkjKkEgsU8ESQRHszkIIMgccWaWiQQQJBEczeYggCBzxJlZJhJAkERwNJuDQIggc5BglhBYIZBNkNvt9kSBQStrYGWtJ13KJsjy9K92pFwuMDiXgS3DPJ/cguQZFb1AoBECCNJIIBhGmwROFqRNKIwKAo4AgjgSHCGwQgBBVqBwCQKOAII4EhwhsEIAQVagcAkCjsC4grgZcoTAAQIIcgAeTccngCDjx5gZHiCAIAfg0XR8ArkF0V9KolwuMDiXQTZzswlyvV71ByenKMy1/VjnMiSbILkGRD8QaIkAgrQUDcbSHAEEaS4kDKglAgjSUjQYS3MEEKStkDCaxgggSGMBYThtEUCQtuLBaBojgCCNBYThtEUAQdqKB6NpjACCNBaQcsOh5xQCCJJCjTbTEECQaULNRFMIIEgKNdpMQwBBpgk1E00hgCAp1GjzJ4GBzxBk4OAyteMEEOQ4Q3oYmACCNBTc2+32bOVDQ0OafigI0sgSMDGebCj/Wvlo39/akU8DBBCkgSAsQuiP7rjR/Ldcc+fTHs+eOIKcHIFFBO0c/ki+Lvf865xXJIAgFWFvPEpy6PXKv63XrA9I4mOpe44gdXn/8TRb/FtyuHrP9uWdFT4nEUCQk8CbHFr8Ko9GoB/tZLYeUSp0H0EKgd3r1uTQK5V2j71q9/ckiV657q/x/RiBoNYIEoQpXyWTQwv9PmMV2jmZrVBSGeshSEaYj7pa5IjZOfwuyWz5RAqfI0hhwF73kkOvV97l4FPtPmS2gnEdr4ggxxkG9WC7x1E53HP0w57MlqNR+IgghQGre5NDi1pFpzmKfrST2cpB8kEfaYI86JTbLwRMDr1Safd4uZjnmyTRK1ee3uhllQCCrGLJc9Hk0AJOyViFDoDMViipxHoIkgjuUbNFjhI7h/9oMls+kYznCJIRpteV5NDrlXc5+6l2KTJb2bH+6hBBfnHI+q/tHrXkcONWAoDMlqOR8dicIBnndkpXJocWq0rt5+tHO5mtzNQRJCNQk0OvVNo9MvYa1ZUk0StXVCMqbxNAkG02UXdMDi3Mkhmr0PGQ2QolFVAPQQIgPaqyyHHmzuEPkcyWTyTxHEESwXnNJIder7zLp51qNyOzlQH/TIJkwPW6C9s9WpPDDVKJAjJbjkbiEUESwamZyaFFqKLTFot+tJPZOhAZBEmEZ3LolUq7R2IP1ZpJEr1yVXvgSA9CkIRomhxacC1krEJHT2YrlJRXD0E8II9OFzl62Dn8qZDZ8okEnCNIACSviuTQ69Xd5S6+atcjsxUZKgSJAGa7R69yuFkqoUBmy9EIOCJIACRVMTm0uFR02nPRj3YyW4ERRJAAUCaHXqm0ewTU7qKKJNErVxeDPXOQCPKAvsmhhdRTxurBjH7fJrP1G8X2FwTZZnNZ5Dh359gZX4ZbZLYeQESQfUCSQ69X+7X6vavdkczWTvwQZAOO7R6jy+FmrsQDmS1HwzsiiAdEpyaHFo2KTmco+tFOZmsl0giyAsUuvbHysWD5bH3HftSm5JhixzNFfQRZCfP1ev10LVjskV+sxH6+5B6T31/sgGaojyAzRJk5JhNAkGR0NJyBAILMEGXmmEwAQZLR0XAGAggyQ5Trz3GYJyLIMKFkIiUIIEgJqvQ5DAEEGSaUTKQEAQQpQZU+hyGAIMOEcpaJ1J0ngtTlzdM6I4AgnQWM4dYlgCB1efO0zgggSGcBY7h1CSBIXd48rWUCK2NDkBUoXIKAI4AgjgRHCKwQQJAVKFyCgCOAII4ERwisEECQFShcgoAjkEsQ1x9HCAxFAEGGCieTyU0AQXITpb+hCCDIUOFkMrkJIEhuovQ3FIEOBBmKN5PpjACCdBYwhluXAILU5c3TOiOAIJ0FjOHWJYAgdXnztM4IzC1IZ8FiuPUJIEh95jyxIwII0lGwGGp9AghSnzlP7IgAgnQULIZanwCCFGJOt2MQ+AEAAP//U3PGlQAAAAZJREFUAwA3ILMm/jaVEAAAAABJRU5ErkJggg==");class RenderManager extends Component{static name="RenderManager";container=new THREE.Group;lines=[];pointVirtualGrid=new PointSpatialHash;quadtree=new Quadtree(new Box2);verticalReferenceLineFlag=new THREE.Mesh(new THREE.PlaneGeometry(.3,.3),new THREE.MeshBasicMaterial({map:texture,color:58111,transparent:!0}));onAddFromParent(){const dxfLineModel=this.dxfLineModel;this.editor.container.add(this.container),this.editor.container.add(dxfLineModel.dxfModelGroup),dxfLineModel.dxfLineModel.material=new THREE.LineBasicMaterial({transparent:!0,opacity:.5,color:16777215}),dxfLineModel.addEventListener("modelUpdate",e=>{e.model.position.z=0,dxfLineModel.dxfDoorsLineModel.visible=!1}),this.variable.addEventListener("dxfVisible",e=>dxfLineModel.dxfModelGroup.visible=e.value),this.dxf.addEventListener("dataChange",()=>this.reset()),this.reset()}updatedMode=null;reset(){if("self"===this.updatedMode){const doors=this.lines.filter(line2=>line2.userData.isDoor);this.updatedMode=null;const diffList=this.dxf.doorLineSegment.filter(line2=>{for(let i=0;i<doors.length;i++){const door2=doors[i];if(door2.start.equal(line2.start)&&door2.end.equal(line2.end))return!1;if(door2.end.equal(line2.start)&&door2.start.equal(line2.end))return!1}return!0});return this.addLines(diffList.map(line2=>(line2.userData.isDoor=!0,line2.userData.doorDirectConnection,line2))),void this.draw(!1)}this.updatedMode="dxf",this.pointVirtualGrid=new PointSpatialHash;const box=this.dxf.box.clone().expansion(2*Math.max(this.dxf.box.width,this.dxf.box.height));0!==box.width&&0!==box.height||box.set(-200,-200,200,200),this.quadtree.clear(),this.quadtree.bounds=box,this.lines.length=0;const newLines=this.dxf.getLineSegments();this.addLines(newLines),this.draw()}addLine(line2,needdraw=!1){this.lines.push(line2),this.pointVirtualGrid.insert(line2.start,line2),this.pointVirtualGrid.insert(line2.end,line2),this.quadtree.insert(line2),needdraw&&this.draw()}addLines(lines,needdraw=!1){for(let i=0;i<lines.length;i++){const line2=lines[i];this.addLine(line2)}needdraw&&this.draw()}removeLine(line2,needdraw=!0){this.quadtree.remove(line2),this.pointVirtualGrid.remove(line2.start),this.pointVirtualGrid.remove(line2.end);const index=this.lines.indexOf(line2);this.lines.splice(index,1),needdraw&&this.draw()}removeLines(lines,needdraw=!0){for(let i=0;i<lines.length;i++)this.removeLine(lines[i],!1);needdraw&&this.draw()}removeLineAll(needdraw=!0){this.quadtree.clear(),this.pointVirtualGrid.clear(),this.lines.length=0,needdraw&&this.draw()}createGeometry(map,count){const geometry=new THREE.BufferGeometry;return Object.keys(map).forEach(k=>{geometry.setAttribute(k,new THREE.BufferAttribute(new Float32Array(map[k]),map[k].length/count))}),geometry}lineAdsorption=ref(!0);pointAdsorption=ref(!0);adsorption(radius,quadtree){radius=radius??isMobileRef.value?.08:.06,quadtree=quadtree??this.quadtree;const editor=this.parent?.findComponentByName("Editor"),point=Point.from(editor.pointerPosition);let result={point:new THREE.Vector3(editor.pointerPosition.x,editor.pointerPosition.y,0),find:!1,line:void 0,mode:void 0},queryResult=this.lineAdsorption.value?quadtree.queryCircle(point,radius):[];if(queryResult.length){let projectList=queryResult.map(res=>({point:res.line.projectPoint(point),line:res.line})).filter(item=>!!item.point);if(projectList.sort((a,b)=>a.point.distance(point)-b.point.distance(point)),projectList.length){const line2=projectList[0].line,projectPoint=projectList[0].point;result={point:new THREE.Vector3(projectPoint.x,projectPoint.y,0),find:!0,mode:"line",line:line2},this.pointAdsorption.value&&(line2.start.distance(point)<1.5*radius?(result.point.set(line2.start.x,line2.start.y,0),result.mode="point"):line2.end.distance(point)<1.5*radius&&(result.point.set(line2.end.x,line2.end.y,0),result.mode="point"))}}return this.dispatchEvent({type:"adsorptionPointChange",...result}),result}auxiliaryLineAdsorption(radius=null,quadtree){radius=radius??isMobileRef.value?.08:.06;const opt=this.adsorption(radius,quadtree);if("line"===opt.mode){this.setAuxiliaryLineVisible(!0);const start=new THREE.Vector3(opt.line.start.x,opt.line.start.y,.001),end=new THREE.Vector3(opt.line.end.x,opt.line.end.y,.001),center=new THREE.Vector3(opt.point.x,opt.point.y,.001);this.lineDashed1.setPoint(start,center),this.lineDashed2.setPoint(end,center),this.lineDashedText1.position.copy(start.clone().add(center).multiplyScalar(.5)),this.lineDashedText2.position.copy(end.clone().add(center).multiplyScalar(.5)),this.lineDashedText1.element.innerHTML=(1e3*start.distanceTo(center)).toFixed(0),this.lineDashedText2.element.innerHTML=(1e3*end.distanceTo(center)).toFixed(0)}else this.setAuxiliaryLineVisible(!1);return opt}lineDashed1=new LineDashed([]);lineDashed2=new LineDashed([]);lineDashedText1=null;lineDashedText2=null;setAuxiliaryLineVisible(b){this.lineDashedText1||(this.lineDashedText1=this.renderer.createText("",Point.zero(),{background:"#333333",padding:"0px",color:"#00ff00"},this.container)),this.lineDashedText2||(this.lineDashedText2=this.renderer.createText("",Point.zero(),{background:"#333333",padding:"0px",color:"#00ff00"},this.container)),this.lineDashed1.parent&&(this.container.add(this.lineDashed1),this.container.add(this.lineDashed2),this.container.add(this.lineDashedText1),this.container.add(this.lineDashedText2)),this.lineDashed1.visible=this.lineDashed2.visible=this.lineDashedText1.visible=this.lineDashedText2.visible=b}toJson(){return this.lines.map(line2=>line2.clone()).map(line2=>{const userData=line2.userData,drawWindow=userData.drawWindow,insetionArr=this.quadtree.queryLineSegment(line2).filter(r=>r.line!==line2&&!r.userData?.isDoor).map(r=>({index:this.lines.indexOf(r.line)}));return{...cloneUserData(userData),start:line2.start.toJson(this.dxf.originalZAverage),end:line2.end.toJson(this.dxf.originalZAverage),insetionArr:insetionArr,isDoor:userData.isDoor,doorDirectConnection:userData.isDoor,length:line2.length,isWindow:userData.isWindow,isVerticalReferenceLine:userData.isVerticalReferenceLine,wallWidth:line2.userData.wallWidth,drawWindow:drawWindow&&drawWindow.map(w=>({...cloneUserData(w),p:{x:w.p.x,y:w.p.y,z:w.p.z},width:w.width,full:w.full,rooftopPz:w.rooftopPz}))}})}debouncing=new Debouncing(20);synchronizeDxf(){"dxf"!==this.updatedMode?this.debouncing.debounce(()=>{this.updatedMode="self";const dxf2=this.dxf,json=this.toJson();dxf2.set(json,dxf2.options)}):this.updatedMode=null}draw(synchronize=!0){this.container.clear(),new Drawer(this.lines).draw(this.container),synchronize&&this.synchronizeDxf()}get renderer(){return this.parent?.findComponentByName("Renderer")}get dxf(){return this.parent?.findComponentByName("Dxf")}get variable(){return this.parent?.findComponentByName("Variable")}get eventInput(){return this.parent?.findComponentByName("EventInput")}get editor(){return this.parent?.findComponentByName("Editor")}get dxfLineModel(){return this.parent?.findComponentByName("DxfLineModel")}}class Drawer extends Pipeline{wallGroupManager;constructor(lines){super(),this.wallGroupManager=WallGroupManager.fromByLines(lines),this.use({type:"wall",handle:this.wall.bind(this)}),this.use({type:"doubleWall",handle:this.doubleWall.bind(this)}),this.use({type:"door",handle:this.door.bind(this)}),this.use({type:"balconyRailing",handle:this.balconyRailing.bind(this)}),this.use({type:"window",handle:this.wall.bind(this)}),this.use({type:"hole",handle:this.hole.bind(this)}),this.use({type:"bayWindow",handle:this.bayWindow.bind(this)})}wall(ctx){const color=new THREE.Color(5745151),holeLines=ctx.data.flatMap(line2=>{const holeLines2=[];WallHole.forEachStorageType(line2,(data,key)=>{data.forEach(item=>{let type="drawWindow"==key?"window":item.type;const holeLine=WallHole.holeDataToLine(line2,item);holeLine.userData.type=type,holeLines2.push(holeLine)})});let lines=[line2];return holeLines2.length&&(lines=LineSegmentUtils.clippingByLines(line2,holeLines2)??[]),lines.forEach(line22=>{line22.points.forEach(p=>{ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b)})}),holeLines2});this.wallGroupManager.add({type:"hole",lines:holeLines})}doubleWall(ctx){this.wallGroupManager.add({type:"wall",lines:ctx.data})}door(ctx){this.wallGroupManager.add({type:"hole",lines:ctx.data})}balconyRailing(ctx){const color=new THREE.Color(65280);ctx.data.forEach(line2=>{line2.points.forEach(p=>{ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b)})})}bayWindow(ctx){const color=new THREE.Color(5745151);ctx.data.forEach(line2=>{line2.userData.isBayWindow&&line2.points.forEach(p=>{ctx.cache.lineDasheds.push(p.x,p.y,0),ctx.cache.lineDashedColor.push(color.r,color.g,color.b)})}),this.wallGroupManager.add({type:"wall",lines:ctx.data.filter(line2=>!line2.userData.isBayWindow)})}hole(ctx){const colors={default:new THREE.Color(16776960),passageEntrance:new THREE.Color(16776960),window:new THREE.Color(16711935),door:new THREE.Color(16776960),beam:new THREE.Color(16711680)};ctx.data.forEach(line2=>{const type=line2.userData.type??"default",color=colors[type]??colors.default;line2.points.forEach(p=>{"default"===type||"passageEntrance"===type?(ctx.cache.lineDasheds.push(p.x,p.y,0),ctx.cache.lineDashedColor.push(color.r,color.g,color.b)):(ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b))})})}createLineSegments(map,count,parameters){if(Array.isArray(map)){const position=map.flatMap(line2=>line2?.points?.flatMap(p=>[p.x,p.y,0]));return this.createLineSegments({position:position},2*map.length,parameters)}const geometry=new THREE.BufferGeometry;Object.keys(map).forEach(key=>{const value=map[key];if("color"===key){let attr=new THREE.BufferAttribute(new Float32Array(value),value.length/count);geometry.setAttribute(key,attr)}else{let attr=new THREE.BufferAttribute(new Float32Array(value),value.length/count);geometry.setAttribute(key,attr)}});return new THREE.LineSegments(geometry,new THREE.LineBasicMaterial({...parameters}))}draw(parent2){const option={lines:[],lineColor:[],walls:[],wallColor:[],lineDasheds:[],lineDashedColor:[]};if(this.wallGroupManager.forEach(group=>{this.run(group.type,group.lines,option)}),option.lines.length){const wall=this.createLineSegments({position:option.lines,color:option.lineColor},option.lines.length/3,{vertexColors:!0,toneMapped:!1,color:16777215});parent2.add(wall)}if(option.lineDasheds.length){const wall=this.createLineSegments({position:option.lineDasheds,color:option.lineDashedColor},option.lineDasheds.length/3);wall.material=new THREE.LineDashedMaterial({color:16777215,vertexColors:!0,dashSize:.05,gapSize:.05,toneMapped:!1,transparent:!0,opacity:.7}),wall.computeLineDistances(),parent2.add(wall)}if(option.walls.length){const array=[];option.walls.forEach((poly,i)=>{option.wallColor[3*i],option.wallColor[3*i+1],option.wallColor[3*i+2],earcut(poly.flatMap(p=>[p.x,p.y])).forEach(j=>{array.push(poly[j].x,poly[j].y,0)})});const geometry=new THREE.BufferGeometry;geometry.setAttribute("position",new THREE.BufferAttribute(new Float32Array(array),3));const material=new THREE.MeshBasicMaterial({color:16777215}),mesh=new THREE.Mesh(geometry,material);parent2.add(mesh)}}}class DefaultCommand extends Command{static name="DefaultCommand";container=new THREE.Group;onAddFromParent(){const editor=this.editor,commandManager=editor.commandManager;editor.container.add(this.container),commandManager.addCommandFlow("default").add(isMobileRef.value?this.startMobile.bind(this):this.start.bind(this)).addEventListener("finally",this.finally.bind(this)),commandManager.addEventListener("startedBefore",e=>{"default"===e.currentName&&"default"!==e.name&&commandManager.cancel()}),commandManager.addEventListener("finally",e=>"default"!==e.name&&commandManager.start("default")),editor.eventInput.addCancelDefaultBehavior(()=>editor.eventInput.isOnlyKeyDowns(["control","g"]))}selectLines=[];selectLineObject3D=new THREE.Mesh;selectHoleLine=null;setSelectHoleLine(line2){this.removeSelectLineAll(),this.selectHoleLine=line2,this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectWinLineChange"}),this.dispatchEvent({type:"selectHoleLineChange"})}addSelectLine(...lineSegments){this.selectHoleLine=null,lineSegments=lineSegments.filter(line2=>-1===this.selectLines.indexOf(line2)),this.selectLines.push(...lineSegments),this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"})}removeSelectLine(lineSegment){const i=this.selectLines.indexOf(lineSegment);i>-1&&(this.selectHoleLine=null,this.selectLines.splice(i,1),this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"}))}removeSelectLineAll(){(this.selectHoleLine||0!==this.selectLines.length)&&(this.selectHoleLine=null,this.selectLines.length=0,this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"}))}getSelectData(){return this.selectHoleLine?[this.selectHoleLine]:[...this.selectLines]}_timer=null;material1=new THREE.LineBasicMaterial({color:16777215});material2=new THREE.LineBasicMaterial({color:15277667});updateSelectLinesGeometry(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{if(this.destroyed)return;const lines=[...this.selectLines];this.selectHoleLine&&lines.push(this.selectHoleLine),lines.length?this.container.add(this.selectLineObject3D):this.selectLineObject3D.removeFromParent();const editor=this.editor,position=lines.flatMap(line2=>line2.toRectangle(isMobileRef.value?.12:.04,"butt").createGeometry());this.selectLineObject3D.geometry=editor.renderManager.createGeometry({position:position},position.length/3),this.selectHoleLine?this.selectLineObject3D.material=this.material2:this.selectLineObject3D.material=this.material1},10)}showSelectBox(){const editor=this.editor,startPoint=editor.pointerPosition.clone(),endPoint=editor.pointerPosition.clone(),mesh=new THREE.Mesh;this.container.add(mesh),mesh.position.z=.05,mesh.material=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:.5});const move=()=>{endPoint.copy(editor.pointerPosition),(()=>{const minX=Math.min(startPoint.x,endPoint.x),maxX=Math.max(startPoint.x,endPoint.x),minY=Math.min(startPoint.y,endPoint.y),maxY=Math.max(startPoint.y,endPoint.y),position=[minX,maxY,0,maxX,minY,0,maxX,maxY,0,minX,maxY,0,minX,minY,0,maxX,minY,0];mesh.geometry=editor.renderManager.createGeometry({position:position},position.length/3)})()},end=()=>{document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",end),mesh.removeFromParent();const minX=Math.min(startPoint.x,endPoint.x),maxX=Math.max(startPoint.x,endPoint.x),minY=Math.min(startPoint.y,endPoint.y),maxY=Math.max(startPoint.y,endPoint.y),box=new Box2(minX,maxX,minY,maxY),resultList=editor.renderManager.quadtree.queryBox(box);this.removeSelectLineAll(),resultList.forEach(result=>this.addSelectLine(result.line)),this.updateSelectLinesGeometry()};document.addEventListener("mousemove",move),document.addEventListener("mouseup",end)}start(){const editor=this.editor,eventInput=editor.eventInput,object3D=new THREE.Mesh,dom=editor.domContainer.domElement;let time=-1,selectLine=null,selectType=null;object3D.position.z=.002,this.selectLineObject3D.position.z=object3D.position.z+.001,object3D.material=new THREE.MeshBasicMaterial({color:55561});const textObj3D=this.renderer.createText("",new THREE.Vector3(0,0,0),{background:"rgba(0,0,0,0.5)",padding:"2px",borderRadius:"2px"},this.container);textObj3D.visible=!1,this.addEventRecord("clear",editor.addEventListener("pointerPositionChange",()=>{const{line:line2,point:point}=editor.renderManager.adsorption();if(line2){selectLine=line2,selectType="wall";const p=Point.from(point);for(const insertObject of WH.getIterator(line2)){const hole=WH.holeDataToLine(line2,insertObject),p2=hole.projectPoint(p,!0);if((p2?.distance(p)??1/0)<.08){hole.currentData.insertObject=insertObject,hole.currentData.line=line2,selectLine=hole,selectType="hole";break}}dom.style.cursor="pointer";const rectangle=selectLine.toRectangle(.025,"butt");object3D.geometry=editor.renderManager.createGeometry({position:rectangle.createGeometry()},6);const center=selectLine.center;let info="";textObj3D.element.innerText=info+parseInt(1e3*selectLine.length+"")+" mm",textObj3D.position.set(center.x,center.y,0),textObj3D.visible=!0,this.container.add(object3D)}else object3D.removeFromParent(),dom.style.cursor="default",selectLine=null,selectType=null,textObj3D.visible=!1}),eventInput.addEventListener("codeChange",()=>{if(eventInput.isKeyDown("mouse_0")){if(!selectLine)return this.showSelectBox();if(eventInput.isKeyDown("alt"))return this.removeSelectLine(selectLine);if(eventInput.isKeyDown("control")||this.removeSelectLineAll(),"hole"===selectType){const t=performance.now();return-1===time?(time=t,setTimeout(()=>time=-1,400),this.setSelectHoleLine(selectLine)):this.addSelectLine(selectLine.currentData.line)}this.addSelectLine(selectLine)}else if(eventInput.isKeyDown("mouse_1")){if(!selectLine)return;this.removeSelectLine(selectLine)}else if(eventInput.isKeyDown("mouse_2")){if(!selectLine)return;this.addSelectLine(selectLine)}else eventInput.isKeyDowns(["control","z"])?editor.commandManager.rollback():eventInput.isKeyDowns(["control","y"])&&editor.commandManager.revokeRollback()}),function(){object3D.removeFromParent(),textObj3D.removeFromParent()})}async startMobile(){let isSelectLine=!1;const editor=this.editor,eventInput=editor.eventInput,lineSelector=new LineSelector(this.editor,Point.zero(),"pointerdown",editor.renderManager.quadtree);lineSelector.onPointerMove=(_,line2)=>{isSelectLine=!!line2},this.awaitOnlyKeys(["mouse_0"],{once:!1}).awaitEach(()=>{isSelectLine||this.showSelectBox()}),this.addCommandEndHandle(()=>{this.removeSelectLineAll(),lineSelector.destroy()});for await(const line2 of lineSelector){if(!line2)return;if(line2.currentData.insertObject)this.setSelectHoleLine(line2);else{if(eventInput.isKeyDown("alt"))return this.removeSelectLine(line2);eventInput.isKeyDown("control")||this.removeSelectLineAll(),this.addSelectLine(line2)}}}finally(){this.cancelEventRecord("clear"),this.removeSelectLineAll(),this.updateSelectLinesGeometry()}}class DrawLine extends Command{static name="DrawLine";container=new THREE.Group;static withdrawalKeys=["Control","Z"];static shortcutKeys=["L"];static commandName="draw-line";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys});commandFlow.add(this.createCursor("crosshair")),isMobile()&&commandFlow.add(this.selectFirstPoint.bind(this)),commandFlow.add(this.selectPoint.bind(this),{prompt:`两个点绘制一条线段,可连续绘制多条线段, ${this.formatText("ALT")} 键锁定方向, ${this.formatText("ESC")} 取消命令`,showConfirm:!0}),commandFlow.add(this.end.bind(this))}async selectFirstPoint(next){const onClick=()=>{next(Point.from(this.editor.pointerPosition))};this.editor.domEventRegister.addEventListener("click",onClick,{once:!0}),this.addCommandEndHandle(()=>this.editor.domEventRegister.removeEventListener("click",onClick))}async selectPoint(next,point){const circle=this.renderer.createCircle(Point.zero(),{color:16777215},this.container),auxiliaryLine=new LineDashed([new THREE.Vector3(-1e4,0,0),new THREE.Vector3(1e4,0,0),new THREE.Vector3(0,-1e4,0),new THREE.Vector3(0,1e4,0)],16777215,.1,.1),points=[],lineDashed=new LineDashed([],16777215,.1,.1),lineObj3D=new Lines([],16711935),lineAlignmentGuide=new LineAlignmentGuide,baseLine=new LineSegment,normalLine=new LineSegment,unitText=this.renderer.createText("0mm",Point.zero(),{},this.container);point=point??Point.zero(),circle.position.set(point.x,point.y,0),auxiliaryLine.material.transparent=!0,auxiliaryLine.material.opacity=.2,unitText.visible=!1,this.addCommandEndHandle(()=>unitText.removeFromParent()),this.container.add(auxiliaryLine).add(lineDashed).add(lineObj3D).add(lineAlignmentGuide),this.addCommandEndHandle(()=>this.container.clear());const pointerFollowMove=new PointerFollowMove(this.editor,point).setType("all").setEmptySpace(!0);this.addCommandEndHandle(()=>pointerFollowMove.destroy());let currentLine=null;pointerFollowMove.onPointerMove=(point2,line2)=>{if(directionLock.value&&point2&&(PointUtils.constrainPointToAxis(point2,baseLine,normalLine.start,normalLine),pointerFollowMove.dragControlPoint?.setPoint(point2)),circle.position.x=point2.x,circle.position.y=point2.y,auxiliaryLine.position.copy(point2.toVector3()),points.length){lineDashed.setPoint(points.at(-1).toVector3(),circle.position);const c=lineDashed.getCenter(0,1);unitText.position.set(c.x,c.y,c.z),unitText.element.innerText=mToMm(lineDashed.getDistance(0,1))+"mm",unitText.visible=!0}line2&&!directionLock.value?(lineAlignmentGuide.visible=!0,lineAlignmentGuide.set(line2,[point2])):lineAlignmentGuide.visible=!1,currentLine=line2};const addPoint=()=>{const point2=new Point(circle.position.x,circle.position.y);points.push(point2),lineObj3D.setPoint(...points.map(p=>p.toVector3(0))),1===points.length?currentLine&&baseLine.copy(currentLine):points.length>1&&(baseLine.set(points.at(-1),points.at(-2)),pointerFollowMove.snapController.addLine(baseLine.clone()));const normal=baseLine.normal();normalLine.start.copy(point2),normalLine.end.copy(point2).add(normal.multiplyScalar(1)),unitText.visible=!1};isMobile()?pointerFollowMove.onMobileEnd=addPoint:this.awaitOnlyKeys(["mouse_0"],{once:!1}).awaitEach(addPoint),this.awaitOnlyKeys(["enter"],{once:!1,condition:()=>points.length>=2||(ElMessage({type:"warning",message:"需要选择大于或等于两个点"}),!1)}).awaitEach(()=>{next(points.flatMap((p,i)=>0===i||i===points.length-1?[p]:[p,p]))});const{destroy:destroy1,directionLock:directionLock,endPointSnap:endPointSnap}=function(el){const directionLock=ref(!1),endPointSnap=ref(!0),destroy=createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode(_sfc_main$4,{icon:"tdesign:rotate-locked-filled",modelValue:directionLock.value,"onUpdate:modelValue":$event=>directionLock.value=$event,title:"方向锁定( tab )"},null),createVNode(_sfc_main$4,{icon:"gis:snap",modelValue:endPointSnap.value,"onUpdate:modelValue":$event=>endPointSnap.value=$event,title:"端点吸附( alt )"},null)])},{},el);return{directionLock:directionLock,endPointSnap:endPointSnap,destroy:destroy}}(this.editor.domElement);this.awaitOnlyKeys(["tab"],{once:!1}).awaitEach(()=>{directionLock.value=!directionLock.value}),this.awaitOnlyKeys(["alt"],{once:!1}).awaitEach(()=>{endPointSnap.value=!endPointSnap.value});const watchHandle=watch(endPointSnap,()=>pointerFollowMove.snapController.pointSnap=endPointSnap.value);this.addCommandEndHandle(destroy1,watchHandle)}end(next,points){const lines=[];for(let i=0;i<points.length;i+=2)lines.push(new LineSegment(Point.from(points[i]),Point.from(points[i+1])));lines.forEach(line2=>{if(this.renderManager.dxf.options.publicInfo?.rootTopContourInfo){const rooftopPz=HeightQuery.query(line2,this.renderManager.dxf.options.publicInfo?.rootTopContourInfo);line2.userData.rooftopPz=rooftopPz}}),ElMessage({message:"绘制完成",type:"success"}),next(lines)}onCompleted(lines){this.renderManager.addLines(lines),this.renderManager.draw()}onRollback(lines){return lines.forEach(line2=>this.renderManager.removeLine(line2)),this.renderManager.draw(),lines}onRevokeRollback(lines){return this.onCompleted(lines),lines}}class DrawDoorLine extends DrawHole{static name="DrawDoorLine";static shortcutKeys=["D"];static commandName="draw-door-line";holeType="door"}class DrawWindow extends DrawHole{static name="DrawWindow";container=new THREE.Group;static shortcutKeys=["W"];static commandName="draw-window-line";holeType="window";holeKey="drawWindow"}class VerticalCorr extends Command{static name="VerticalCorr";container=new THREE.Group;static shortcutKeys=["Shift","V"];static commandName="VerticalCorr";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isOnlyKeyDowns(this.shortcutKeys)&&this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?1!==selectLines.length?(ElMessage({message:"请选择一条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}isTowLineSegmentConnect(line0,line1){return!!(line0.start.equal(line1.start)||line0.start.equal(line1.end)||line0.end.equal(line1.start)||line0.end.equal(line1.end))}setLinePoint(line2,newStartPoint,newEndPoint,mode="all",resultList=[],id=uuid()){if(line2.userData.setLinePointUUid===id)return[];line2.userData.setLinePointUUid=id;let startIntersectionLine=[],endIntersectionLine=[];"start"!==mode&&"all"!==mode||(startIntersectionLine=this.renderManager.pointVirtualGrid.queryPoint(line2.start).filter(res=>res.userData!==line2)),"end"!==mode&&"all"!==mode||(endIntersectionLine=this.renderManager.pointVirtualGrid.queryPoint(line2.end).filter(res=>res.userData!==line2));const copyLine=line2.clone();let changePoint="";newStartPoint&&(line2.start.equal(newStartPoint)||(changePoint="start"),resultList.push({point:line2.start,oldPoint:line2.start.clone(),newPoint:newStartPoint,line:line2}),line2.start.copy(newStartPoint)),newEndPoint&&(line2.end.equal(newEndPoint)||(changePoint="start"===changePoint?"all":"end"),resultList.push({point:line2.end,oldPoint:line2.end.clone(),newPoint:newEndPoint,line:line2}),line2.end.copy(newEndPoint));const setLinePoint=(intersectionLine,newValue,pointType)=>{intersectionLine.forEach(result=>{const{point:queryPoint,userData:queryLine}=result,pointName=queryLine.start===queryPoint?"start":"end";if(queryLine.directionEqual(copyLine))if("start"===pointName){const newEnd=line2.projectPoint(queryLine.end,!1);if(newEnd)return this.setLinePoint(queryLine,newValue,newEnd,"end",resultList,id)}else{const newStart=line2.projectPoint(queryLine.start,!1);if(newStart)return this.setLinePoint(queryLine,newStart,newValue,"start",resultList,id)}"all"!==changePoint&&pointType!==changePoint||this.setLinePoint(queryLine,queryLine.start===queryPoint?newValue:queryLine.start,queryLine.end===queryPoint?newValue:queryLine.end,queryLine.start===queryPoint?"end":"start",resultList,id)})};return setLinePoint(startIntersectionLine,line2.start,"start"),setLinePoint(endIntersectionLine,line2.end,"end"),[...startIntersectionLine,...endIntersectionLine]}correction(targettLine,resultList=[],vistedList=/* @__PURE__ */new Set){vistedList.add(targettLine);const lines=this.renderManager.quadtree.queryLineSegment(targettLine).filter(({line:line2})=>line2!==targettLine&&!line2.userData.isDoor&&!vistedList.has(line2)).map(result=>result.line),targettLineDirection=targettLine.direction(),[pointLines,intersectingLines]=lines.reduce((list,line2)=>{const[pointLines2,intersectingLines2]=list;return line2.isSameEndpoint(targettLine)?pointLines2.push(line2):intersectingLines2.push(line2),list},[[],[]]);pointLines.forEach(line2=>{const direction=line2.direction(),angle2=targettLineDirection.angleBetween(direction,"angle");if(Math.abs(90-angle2)>45)return!1;const point0=targettLine.isSameEndpointAsStart(line2)?targettLine.start:targettLine.end,point1=line2.isSameEndpointAsStart(targettLine)?line2.end:line2.start,projectPoint=new LineSegment(point1.clone().add(targettLineDirection.clone().multiplyScalar(1)),point1.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point0,!1);if(projectPoint){const list=[];this.setLinePoint(line2,line2.start===point1?projectPoint:line2.start,line2.end===point1?projectPoint:line2.end,line2.start===point1?"start":"end",list),resultList.push(list)}return vistedList.add(line2),!1}),targettLineDirection.copy(targettLine.direction());const projectPointComputed=(sameEndpoint,otherPoint,line2)=>{const point=targettLine.projectPoint(otherPoint);if(point)sameEndpoint.copy(point);else{const projectPoint=new LineSegment(otherPoint.clone().add(targettLineDirection.clone().multiplyScalar(1)),otherPoint.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(sameEndpoint,!1);if(projectPoint){const list=[];this.setLinePoint(line2,line2.start===otherPoint?projectPoint:line2.start,line2.end===otherPoint?projectPoint:line2.end,line2.start===otherPoint?"start":"end",list),resultList.push(list)}}};return intersectingLines.forEach(line2=>{if(targettLine.containsPoint(line2.start))projectPointComputed(line2.start,line2.end,line2);else if(targettLine.containsPoint(line2.end))projectPointComputed(line2.end,line2.start,line2);else{const point=targettLine.getIntersection(line2);if(point){const projectPoint1=new LineSegment(line2.start.clone().add(targettLineDirection.clone().multiplyScalar(1)),line2.start.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point,!1);if(projectPoint1){const list=[];this.setLinePoint(line2,projectPoint1,line2.end,"start",list),resultList.push(list)}const projectPoint2=new LineSegment(line2.end.clone().add(targettLineDirection.clone().multiplyScalar(1)),line2.end.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point,!1);if(projectPoint2){const list=[];this.setLinePoint(line2,line2.start,projectPoint2,"end",list),resultList.push(list)}}}}),resultList}verticalCorrection(next,selectLines){next(this.correction(selectLines[0]))}completed(data){const insertObjectLines=[];data.forEach(items=>{items.forEach(item=>{const{line:line2,newPoint:newPoint,point:point}=item;point.copy(newPoint),this.renderManager.removeLine(line2),this.renderManager.addLine(line2),WallHole.isHole(line2)&&insertObjectLines.push(line2)})}),WallHole.filterIllegal(insertObjectLines),this.renderManager.draw()}rollback(data){const insertObjectLines=[];for(let i=data.length-1;i>=0;i--){const items=data[i];for(let j=items.length-1;j>=0;j--){const item=items[j],{line:line2,oldPoint:oldPoint,point:point}=item;point.copy(oldPoint),this.renderManager.removeLine(line2),this.renderManager.addLine(line2),WallHole.isHole(line2)&&insertObjectLines.push(line2)}}return WallHole.filterIllegal(insertObjectLines),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}const _sfc_main$3=/* @__PURE__ */defineComponent({__name:"Input",props:{modelValue:{},modelModifiers:{}},emits:/* @__PURE__ */mergeModels(["change","blur"],["update:modelValue"]),setup(__props,{emit:__emit}){function onBlur(){emits("blur")}const handleKeypress=event=>{const char=event.key;/[\d\-.]/.test(char)||["Backspace","Delete","ArrowLeft","ArrowRight","Tab"].includes(char)||event.preventDefault()},handlePaste=event=>{const pastedText=event.clipboardData?.getData("text");pastedText&&!/^-?\d+\.?\d*$/.test(pastedText)&&event.preventDefault()},value=useModel(__props,"modelValue",{set:v=>Number(v)}),emits=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock("input",{"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>value.value=$event),type:"text",class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1",onKeypress:handleKeypress,onPaste:handlePaste,onChange:_cache[1]||(_cache[1]=$event=>emits("change")),onBlur:onBlur},null,544)),[[vModelText,value.value,void 0,{number:!0}]])}}),_hoisted_1$2={key:0},_hoisted_2$1={class:"flex w-full"},_hoisted_3$1={key:0,class:"mr-[10px] h-[20px] flex justify-center items-center"},_hoisted_4$1={class:"size-[16px] rounded-[100px] text-[12px] flex justify-center items-center text-[#409eff]"},_hoisted_5$1={class:"flex-1 mb-[5px]"},_hoisted_6$1={class:"leading-[20px]"},_hoisted_7$1={class:"bg-[whitesmoke] rounded-[10px] mt-[5px]"},_hoisted_8$1={class:"p-[5px] text-[12px]"},_hoisted_9$1={class:"mr-[5px]"},_hoisted_10$1={class:"p-[2px] number"},_hoisted_11$1={class:"p-[2px] number"},_hoisted_12$1={class:"p-[5px] text-[12px]"},_hoisted_13$1={class:"p-[2px] number"},_hoisted_14$1={class:"mt-[5px] bg-[whitesmoke] rounded-[10px]"},_hoisted_15$1={key:0,class:"p-[5px] text-[12px] flex"},_hoisted_16$1={class:"p-[5px] text-[12px] flex"},_hoisted_17$1={class:"mr-[5px] w-[50px]"},_hoisted_18$1={key:1,class:"p-[5px] text-[12px] flex"},_hoisted_19$1={key:2,class:"p-[5px] text-[12px] flex"},_hoisted_20$1={key:1,class:"text-[12px] text-center text-[#aaa]"},PropertiesPanelView=/* @__PURE__ */_export_sfc(/* @__PURE__ */defineComponent({__name:"PropertiesPanel",props:{selectLines:{}},emits:["update","clickIcon"],setup(__props,{emit:__emit}){const props=__props,emits=__emit,selectLines=props.selectLines,map=/* @__PURE__ */new Map,userDataList=computed(()=>selectLines.value.map(line2=>(line2.userData.isDoor&&!line2.userData.drawDoorData&&(line2.userData.drawDoorData={}),map.has(line2.uuid)||map.set(line2.uuid,reactive(line2.userData)),map.get(line2.uuid)))),holeName={door:"门",window:"窗",beam:"梁",hole:"垭口"};return(_ctx,_cache)=>(openBlock(),createBlock(_sfc_main$7,{title:"属性",name:"PropertiesPanel",style:{"z-index":"201"},onClickIcon:_cache[6]||(_cache[6]=$event=>emits("clickIcon"))},{default:withCtx(()=>[createElementVNode("div",{class:"p-[5px] max-h-[300px] min-w-[200px] overflow-y-auto",onWheel:_cache[4]||(_cache[4]=e=>e.stopPropagation()),onPointerdown:_cache[5]||(_cache[5]=e=>e.stopPropagation())},[unref(selectLines).length?(openBlock(),createElementBlock("ul",_hoisted_1$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.selectLines.value,(line2,i)=>(openBlock(),createElementBlock("li",_hoisted_2$1,[unref(selectLines).length>1?(openBlock(),createElementBlock("div",_hoisted_3$1,[createElementVNode("div",_hoisted_4$1,toDisplayString(i+1)+". ",1)])):createCommentVNode("",!0),createElementVNode("div",_hoisted_5$1,[createElementVNode("div",null,[createElementVNode("h5",_hoisted_6$1,toDisplayString(line2.userData.isDoor?"门线":line2.userData.isSelectWindow?`孔洞线( ${holeName[line2.userData.type??"hole"]} )`:line2.userData.isBayWindow?"飘窗线":"墙体线"),1)]),createElementVNode("div",_hoisted_7$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(line2.points,(point,index)=>(openBlock(),createElementBlock("p",_hoisted_8$1,[createElementVNode("span",_hoisted_9$1,toDisplayString(0===index?"开始":"结束"),1),createElementVNode("span",_hoisted_10$1,"x:"+toDisplayString(point.x.toFixed(2)),1),_cache[7]||(_cache[7]=createElementVNode("span",{class:"mr-[20px]"},null,-1)),createElementVNode("span",_hoisted_11$1,"y:"+toDisplayString(point.y.toFixed(2)),1)]))),256)),createElementVNode("p",_hoisted_12$1,[_cache[8]||(_cache[8]=createElementVNode("span",{class:"mr-[5px]"},"长度",-1)),createElementVNode("span",_hoisted_13$1,toDisplayString(Number(line2.length.toFixed(4)))+"m",1)])]),createElementVNode("div",_hoisted_14$1,[userDataList.value[i].isSelectWindow?(openBlock(),createElementBlock("p",_hoisted_15$1,[_cache[9]||(_cache[9]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"孔洞宽度",-1)),createVNode(_sfc_main$3,{onBlur:_cache[0]||(_cache[0]=$event=>emits("update")),modelValue:userDataList.value[i].width,"onUpdate:modelValue":$event=>userDataList.value[i].width=$event,modelModifiers:{number:!0},class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0),createElementVNode("p",_hoisted_16$1,[createElementVNode("span",_hoisted_17$1,toDisplayString(line2.userData.isSelectWindow?"孔洞":line2.userData.isBalconyRailing?"栏杆":"墙体")+"高度",1),createVNode(_sfc_main$3,{onBlur:_cache[1]||(_cache[1]=$event=>emits("update")),modelValue:userDataList.value[i].height,"onUpdate:modelValue":$event=>userDataList.value[i].height=$event,class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])]),line2.userData.isDoor?(openBlock(),createElementBlock("p",_hoisted_18$1,[_cache[10]||(_cache[10]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"门高度",-1)),createVNode(_sfc_main$3,{onBlur:_cache[2]||(_cache[2]=$event=>emits("update")),modelValue:userDataList.value[i].drawDoorData.height,"onUpdate:modelValue":$event=>userDataList.value[i].drawDoorData.height=$event,class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0),userDataList.value[i].isSelectWindow?(openBlock(),createElementBlock("p",_hoisted_19$1,[_cache[11]||(_cache[11]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"离地高",-1)),createVNode(_sfc_main$3,{onBlur:_cache[3]||(_cache[3]=$event=>emits("update")),modelValue:userDataList.value[i].groundClearance,"onUpdate:modelValue":$event=>userDataList.value[i].groundClearance=$event,modelModifiers:{number:!0},class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0)])])]))),256))])):(openBlock(),createElementBlock("div",_hoisted_20$1,"请选择线段"))],32)]),_:1}))}}),[["__scopeId","data-v-9af99455"]]);class PropertiesPanel extends Command{static name="PropertiesPanel";container=new THREE.Group;static shortcutKeys=["i"];static commandName="PropertiesPanel";isOpen=!1;onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.constraint.bind(this)).add(this.open.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",()=>this.completed()),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.isOpen||this.eventInput.isKeyCombination(PropertiesPanel.commandName)&&await this.commandManager.start(PropertiesPanel.commandName,this.getSelectLines())}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}getSelectLines(){const list=[...this.default.selectLines],winList=[];if(this.default.selectHoleLine){const wiLine=this.default.selectHoleLine;wiLine.userData=wiLine.currentData.insertObject,wiLine.currentData.selectWin=wiLine.currentData.line,wiLine.userData.isSelectWindow=!0,winList.push(wiLine)}return{list:list,winList:winList}}constraint(next,{list:list,winList:winList}){winList.length?(this.default.setSelectHoleLine(winList[0]),next(winList)):(this.default.addSelectLine(...list),next(list))}open(next){this.isOpen=!0;const container=document.createElement("div");container.tabIndex=1,["mousedown","keydown","keyup"].forEach(key=>container.addEventListener(key,e=>e.stopPropagation())),this.domElement.appendChild(container);const selectLines=ref([]),update=()=>{const data=this.getSelectLines();this.container.clear();const list=[...data.list,...data.winList];selectLines.value=list,list.length>1&&list.forEach((line2,i)=>{this.container.add(drawText(i+1,line2.center,{color:"#fff",width:"16px",height:"16px",lineHeight:"16px",textAlign:"center",background:"#409eff",borderRadius:"200px"},0))})},eventCloses=[this.default.addEventListener("selectLineChange",update),this.default.addEventListener("selectWinLineChange",update)];update();createApp(PropertiesPanelView,{selectLines:selectLines,position:this.editor.domEventRegister.pointer.clone(),onClickIcon:()=>{eventCloses.forEach(eventClose=>eventClose()),container.remove(),this.container.clear(),this.isOpen=!1},onUpdate:()=>{this.renderManager.draw()}}).mount(container),next()}completed(){}rollback(data){return data}revokeRollback(data){return this.completed(),data}}class DrawBalconyRailing extends DrawLine{static name="DrawBalconyRailing";static withdrawalKeys=["Control","Z"];static shortcutKeys=["B"];static commandName="DrawBalconyRailing";end(next,points){const lines=[];for(let i=0;i<points.length;i+=2)lines.push(new LineSegment(Point.from(points[i]),Point.from(points[i+1])));lines.forEach(line2=>{if(this.renderManager.dxf.options.publicInfo?.rootTopContourInfo){const rooftopPz=HeightQuery.query(line2,this.renderManager.dxf.options.publicInfo?.rootTopContourInfo);line2.userData.rooftopPz=rooftopPz,line2.userData.isBalconyRailing=!0,line2.userData.height=1}}),ElMessage({message:"绘制完成",type:"success"}),next(lines)}}const _hoisted_1$1={key:0,class:"max-w-[150px] min-w-[150px p-[5px] editorToolContent"},_hoisted_2={class:"text-[14px] flex flex-col"},_hoisted_3=["onClick"],_hoisted_4={class:"flex flex-row items-center"},_hoisted_5={class:"flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]"},_hoisted_6=["src"],_hoisted_7={class:"text-wrap"},_hoisted_8={key:0,class:"flex items-center gap-[5px]"},_hoisted_9={key:1,class:"text-[#999]"},_hoisted_10={style:{"--el-color-primary":"var(--primary-color)"},class:"flex flex-row items-center justify-between gap-0 mt-[10px] text-[10px]"},_hoisted_11={class:"flex-wrap border-t border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]"},_hoisted_12=["onClick","title"],_hoisted_13=["src"],_hoisted_14={style:{"--el-color-primary":"var(--primary-color)"},class:"absolute left-0 bottom-[calc(100%+5px)] p-[0_5px] flex flex-row items-center justify-between gap-0 mt-[10px] text-[10px]"},_hoisted_15={class:"text-[14px] flex flex-row flex-wrap gap-[10px]"},_hoisted_16=["onClick"],_hoisted_17={class:"flex justify-center items-center size-[30px] bg-[#f0f0f0] rounded-[2px]"},_hoisted_18=["src"],_hoisted_19={class:"flex-wrap border-t border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]"},_hoisted_20=["onClick","title"],_hoisted_21=["src"],_hoisted_22={key:1,class:"items-end box-border pointer-events-none p-[0_5px] w-full absolute left-0 top-0 flex gap-[5px]"},_hoisted_23={class:"text-white rounded-[6px] p-[5px] text-nowrap"},_sfc_main$1=/* @__PURE__ */defineComponent({__name:"EditorToolContent",props:{dxfSystem:{},permission:{}},setup(__props){function startCurrentCommandItem(item){currentCommand.value!==item.command&&("default"!==currentCommand.value&&editor.commandManager.cancel(),setTimeout(()=>editor.commandManager.start(item.command)))}async function selectLocalFile(){const data=await SelectLocalFile.json();Array.isArray(data)&&(localStorage.removeItem("orbitControls"),function(lines){if(lines){localStorage.setItem("lines",JSON.stringify(lines));try{dxfSystem.Dxf.set(lines)}catch(error){console.log(error)}}}(data))}function ringTest(){if(1!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择一条线段"});const manager=dxfSystem.findComponentByType(RenderManager),line2=defaultComponent.selectLines[0];let lines=manager.lines;const miniCircles=new MiniCircles;miniCircles.debug.angle=!0,miniCircles.miniCircle(lines,{circleEdges:[line2]}).circles.forEach(lines2=>{drawLines(lines2,{color:randomColor()})})}function angleTest(){if(2!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择两条线段"});const line1=defaultComponent.selectLines[0],line2=defaultComponent.selectLines[1];console.log(line1.angle(line2,{unit:"degree",range:"180"}))}function intersectionTest(){if(2!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择两条线段"});const line1=defaultComponent.selectLines[0],line2=defaultComponent.selectLines[1],point=line1.getIntersection(line2);point?drawPoint(point):ElMessage.warning({message:"没有交点"})}function commandConfirm(){variable.set("currentKeyDown","enter"),queueMicrotask(()=>variable.set("currentKeyUp","enter"))}const props=__props,dxfVisible=ref(!0),currentCommand=ref(""),dxfSystem=toRaw(props.dxfSystem),isPc=computed(()=>!isMobileRef.value),domEventRegister=dxfSystem.findComponentByType(DomEventRegister),domContainer=dxfSystem.findComponentByType(DomContainer),editor=dxfSystem.findComponentByType(Editor),defaultComponent=dxfSystem.findComponentByType(DefaultCommand),whiteModel=dxfSystem.findComponentByType(WhiteModel),threeVJia=dxfSystem.findComponentByType(ThreeVJia),variable=dxfSystem.findComponentByType(Variable),drawLine=dxfSystem.findComponentByType(DrawLine),rollbackCount=ref(0),revokeRollbackCount=ref(0),drawLineCount=ref(0),images=/* @__PURE__ */Object.assign({"../assets/images/VerticalCorr.svg":__vite_glob_0_0,"../assets/images/VerticalCorrContinue.svg":__vite_glob_0_1,"../assets/images/angle.svg":__vite_glob_0_2,"../assets/images/close.svg":__vite_glob_0_3,"../assets/images/connection.svg":__vite_glob_0_4,"../assets/images/cutLine.svg":__vite_glob_0_5,"../assets/images/deleteSelectLine.svg":__vite_glob_0_6,"../assets/images/deleteSelectWindow.svg":__vite_glob_0_7,"../assets/images/door.svg":__vite_glob_0_8,"../assets/images/dxf.svg":__vite_glob_0_9,"../assets/images/intersectionConnection.svg":__vite_glob_0_10,"../assets/images/line.svg":__vite_glob_0_11,"../assets/images/mergeLine.svg":__vite_glob_0_12,"../assets/images/revokeRollback.svg":__vite_glob_0_13,"../assets/images/rollback.svg":__vite_glob_0_14,"../assets/images/selectAll.svg":__vite_glob_0_15,"../assets/images/selectPoint.svg":__vite_glob_0_16,"../assets/images/verticalLine.svg":__vite_glob_0_17,"../assets/images/window.svg":__vite_glob_0_18,"../assets/images/垭口.svg":__vite_glob_0_19,"../assets/images/属性面板.svg":__vite_glob_0_20,"../assets/images/栏杆.svg":__vite_glob_0_21,"../assets/images/激光测距.svg":__vite_glob_0_22}),selectLineCount=ref(0),selectWinLineCount=ref(0),hasWindowLine=ref(!1),commandList=[{command:"default",name:"默认",show:!1,shortcut:""},{command:"draw-line",name:"绘制线段",src:images["../assets/images/line.svg"].default,show:!0,shortcut:DrawLine.shortcutKeys.join(" + "),confirm:computed(()=>drawLineCount.value>0)},{command:"draw-door-line",name:"绘制门线",show:!0,src:images["../assets/images/door.svg"].default,shortcut:DrawDoorLine.shortcutKeys.join(" + ")},{command:"draw-window-line",name:"绘制窗户线",show:!0,src:images["../assets/images/window.svg"].default,shortcut:DrawWindow.shortcutKeys.join(" + ")},{command:DrawHole.commandName,name:"绘制垭口",show:!0,src:images["../assets/images/垭口.svg"].default,shortcut:DrawHole.shortcutKeys.join(" + ")},{command:DrawBalconyRailing.commandName,name:"绘制栏杆",src:images["../assets/images/栏杆.svg"].default,show:!0,shortcut:DrawBalconyRailing.shortcutKeys.join(" + "),confirm:computed(()=>drawLineCount.value>0)},{command:"point",name:"修改模式",show:!0,src:images["../assets/images/selectPoint.svg"].default,shortcut:PointDrag.shortcutKeys.join(" + ")},{command:ClippingLine.commandName,name:"裁剪线段",show:!0,src:images["../assets/images/cutLine.svg"].default,shortcut:ClippingLine.shortcutKeys.join(" + ")},{command:ManualDistance.commandName,name:"手动测距",show:!0,src:images["../assets/images/激光测距.svg"].default,shortcut:ManualDistance.shortcutKeys.join(" + ")},{command:RayDistance.commandName,name:"射线测距",show:!0,src:images["../assets/images/激光测距.svg"].default,shortcut:RayDistance.shortcutKeys.join(" + ")}],otherCommandList=[{command:"",name:"操作回滚",src:images["../assets/images/rollback.svg"].default,disabled:computed(()=>0!==rollbackCount.value),shortcut:"Ctrl + Z",action(){editor.commandManager.rollback()}},{command:"",name:"撤销操作回滚",src:images["../assets/images/revokeRollback.svg"].default,disabled:computed(()=>0!==revokeRollbackCount.value),shortcut:"Ctrl + Y",class:"rotateY-[180deg]",action(){editor.commandManager.revokeRollback()}},{command:MergeLine.commandName,name:"合并",src:images["../assets/images/mergeLine.svg"].default,show:computed(()=>!isMobileRef.value),disabled:computed(()=>selectLineCount.value>=2),shortcut:MergeLine.shortcutKeys.join(" + ")},{command:TwoPointConnection.commandName,name:"两点连接",disabled:computed(()=>2===selectLineCount.value),show:computed(()=>!isMobileRef.value),src:images["../assets/images/connection.svg"].default,shortcut:TwoPointConnection.shortcutKeys.join(" + ")},{command:TwoLineConnectionLine.commandName,name:"两线连接",disabled:computed(()=>2===selectLineCount.value),show:computed(()=>!isMobileRef.value),src:images["../assets/images/intersectionConnection.svg"].default,shortcut:TwoLineConnectionLine.shortcutKeys.join(" + ")},{command:VerticalCorr.commandName,name:"垂直纠正",disabled:computed(()=>1===selectLineCount.value),src:images["../assets/images/VerticalCorr.svg"].default,shortcut:VerticalCorr.shortcutKeys.join(" + ")},{command:VerticalCorrContinue.commandName,name:"连续垂直纠正",disabled:computed(()=>1===selectLineCount.value),src:images["../assets/images/VerticalCorrContinue.svg"].default,shortcut:VerticalCorrContinue.shortcutKeys.join(" + ")},{command:ViewAngle.commandName,name:"角度显示",disabled:computed(()=>2===selectLineCount.value&&defaultComponent.selectLines[0].isSameEndpoint(defaultComponent.selectLines[1])),show:computed(()=>!isMobileRef.value),src:images["../assets/images/angle.svg"].default,shortcut:ViewAngle.shortcutKeys.join(" + ")},{command:SelectAll.commandName,name:"全选",disabled:computed(()=>selectLineCount.value!==editor.renderManager.lines.length),src:images["../assets/images/selectAll.svg"].default,shortcut:SelectAll.shortcutKeys.join(" + ")},{command:DeleteSelectLine.commandName,name:"删除",disabled:computed(()=>selectLineCount.value>0||selectWinLineCount.value>0),src:images["../assets/images/deleteSelectLine.svg"].default,shortcut:DeleteSelectLine.shortcutKeys.join(" + "),action(){editor.commandManager.start(DeleteSelectLine.commandName,defaultComponent.getSelectData())}},{command:PropertiesPanel.commandName,name:"属性面板",disabled:computed(()=>!0),src:images["../assets/images/属性面板.svg"].default,shortcut:PropertiesPanel.shortcutKeys.join(" + "),action(){variable.set("currentKeyDown","i"),queueMicrotask(()=>variable.set("currentKeyUp","i"))}}],currentMainCommand=computed(()=>commandList.find(item=>currentCommand.value===item.command)),isMainCommand=computed(()=>commandList.findIndex(item=>item.command===currentCommand.value&&"default"!==item.command)>-1),z=ref(0),showConfirm=ref(!1);watch(dxfVisible,()=>{localStorage.setItem("dxfVisible",dxfVisible.value+""),dxfSystem.Variable.set("dxfVisible",dxfVisible.value)}),watch(z,v=>{dxfSystem.Dxf.originalZAverage=Number(v)});let cancelWatch=null;return dxfSystem.addEventRecord("EditorToolContent",dxfSystem.Variable.addEventListener("dxfVisible",e=>dxfVisible.value=e.value),drawLine.addEventListener("appendLine",e=>drawLineCount.value=e.points.length),dxfSystem.Dxf.addEventListener("dataChange",()=>{z.value=dxfSystem.Dxf.originalZAverage}),defaultComponent.addEventListener("selectLineChange",()=>{selectLineCount.value=defaultComponent.selectLines.length,hasWindowLine.value=defaultComponent.selectLines.some(l=>l.userData.isWindow)}),defaultComponent.addEventListener("selectWinLineChange",()=>{selectWinLineCount.value=defaultComponent.selectHoleLine?1:0}),...["rollback","completed","revokeRollback"].map(key=>editor.commandManager.addEventListener(key,()=>{setTimeout(()=>{rollbackCount.value=editor.commandManager.operationList.length,revokeRollbackCount.value=editor.commandManager.rollbackList.length})})),editor.commandManager.addEventListener("started",e=>{currentCommand.value=e.name,drawLineCount.value=0}),editor.commandManager.addEventListener("executing",e=>{const commandFlow=editor.commandManager.getCommandFlow(e.name),data=commandFlow.getData(commandFlow.currentIndex);cancelWatch&&(cancelWatch(),cancelWatch=null),isRef(data.showConfirm)?(cancelWatch=watch(data.showConfirm,b=>showConfirm.value=b),showConfirm.value=data.showConfirm.value):showConfirm.value=!!data.showConfirm})),onMounted(()=>{localStorage.getItem("dxfVisible")&&(dxfVisible.value="true"==localStorage.getItem("dxfVisible"))}),onUnmounted(()=>{cancelWatch&&cancelWatch(),domEventRegister.mouseMoveEventProxylock=!1,dxfSystem.cancelEventRecord("EditorToolContent")}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[isPc.value?(openBlock(),createElementBlock("div",_hoisted_1$1,[createElementVNode("ul",_hoisted_2,[(openBlock(),createElementBlock(Fragment,null,renderList(commandList,item=>(openBlock(),createElementBlock(Fragment,{key:item.command},[item.show?(openBlock(),createElementBlock("li",{key:0,onClick:$event=>startCurrentCommandItem(item),class:normalizeClass([{"bg-(--primary-color)! text-white":currentCommand.value===item.command},"gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])},[createElementVNode("div",_hoisted_4,[createElementVNode("div",_hoisted_5,[createElementVNode("img",{class:"size-[14px]",src:item.src,alt:"",srcset:""},null,8,_hoisted_6)]),createElementVNode("span",_hoisted_7,toDisplayString(item.name),1)]),currentCommand.value===item.command?(openBlock(),createElementBlock("div",_hoisted_8,[createElementVNode("div",{title:"取消命令(Esc)",class:"active:scale-[0.7] transition-all flex items-center justify-center",onClick:_cache[0]||(_cache[0]=e=>(unref(editor).cancelCommand(),e.stopPropagation()))},[..._cache[26]||(_cache[26]=[createElementVNode("svg",{fill:"#fff",width:"16",height:"16",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[createElementVNode("path",{d:"M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z"}),createElementVNode("path",{d:"M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z"})],-1)])]),item.confirm?.value?(openBlock(),createElementBlock("div",{key:0,onClick:commandConfirm,title:"确认命令(Enter)",class:"active:scale-[0.7] transition-all flex items-center justify-center"},[..._cache[27]||(_cache[27]=[createElementVNode("svg",{fill:"#fff",width:"16",height:"16",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[createElementVNode("path",{d:"M512 1024c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384-172.8-384-384-384z m-12.8 556.8c-12.8 12.8-32 19.2-51.2 19.2-19.2 0-38.4-6.4-51.2-19.2L275.2 569.6c-25.6-25.6-25.6-70.4 0-96 25.6-25.6 70.4-25.6 96 0L448 544l198.4-204.8c25.6-25.6 70.4-25.6 96 0 25.6 25.6 25.6 70.4 0 96l-243.2 249.6z"})],-1)])])):createCommentVNode("",!0)])):item.shortcut?(openBlock(),createElementBlock("div",_hoisted_9,toDisplayString(item.shortcut),1)):createCommentVNode("",!0)],10,_hoisted_3)):createCommentVNode("",!0)],64))),64))]),createElementVNode("div",_hoisted_10,[createVNode(unref(ElCheckbox),{size:"small",modelValue:dxfVisible.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>dxfVisible.value=$event)},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode("Dxf",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{size:"small",modelValue:unref(editor).renderManager.lineAdsorption.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>unref(editor).renderManager.lineAdsorption.value=$event)},{default:withCtx(()=>[..._cache[29]||(_cache[29]=[createTextVNode("线吸附",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{disabled:!unref(editor).renderManager.lineAdsorption.value,size:"small",modelValue:unref(editor).renderManager.pointAdsorption.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>unref(editor).renderManager.pointAdsorption.value=$event)},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode("点吸附",-1)])]),_:1},8,["disabled","modelValue"])]),createVNode(Transition,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_11,[createVNode(TransitionGroup,null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(otherCommandList,item=>withDirectives(createElementVNode("div",{onClick:$event=>item.disabled.value&&"default"===currentCommand.value&&(item.action?item.action():unref(editor).commandManager.start(item.command,[...unref(defaultComponent).selectLines])),title:`${item.name}(${item.shortcut})`,class:normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border border-[#ccc] rounded-[4px] transition-all cursor-pointer",{"opacity-30 bg-[#ccc] cursor-no-drop! active:scale-[1]!":!item.disabled.value||"default"!==currentCommand.value,[item.class??""]:!0}]),key:item.command},[createElementVNode("img",{class:"size-[14px]",src:item.src},null,8,_hoisted_13)],10,_hoisted_12),[[vShow,!(!1===item.show?.value)]])),64))]),_:1})])]),_:1}),"admin"===__props.permission?(openBlock(),createBlock(unref(ElDropdown),{key:0,trigger:"hover",style:{width:"100%"},placement:"right-end"},{dropdown:withCtx(()=>[createVNode(unref(ElDropdownMenu),null,{default:withCtx(()=>[createVNode(unref(ElDropdownItem),{onClick:selectLocalFile},{default:withCtx(()=>[..._cache[32]||(_cache[32]=[createTextVNode(" 选择文件 ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[4]||(_cache[4]=$event=>unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))},{default:withCtx(()=>[..._cache[33]||(_cache[33]=[createTextVNode(" 下载Json ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[5]||(_cache[5]=$event=>unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))},{default:withCtx(()=>[..._cache[34]||(_cache[34]=[createTextVNode(" 下载DXF ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[6]||(_cache[6]=$event=>unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))},{default:withCtx(()=>[..._cache[35]||(_cache[35]=[createTextVNode(" 下载JPG ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[7]||(_cache[7]=$event=>unref(whiteModel).downloadGltf("test.glb",!0))},{default:withCtx(()=>[..._cache[36]||(_cache[36]=[createTextVNode(" 下载白膜 ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[8]||(_cache[8]=$event=>unref(threeVJia).download())},{default:withCtx(()=>[..._cache[37]||(_cache[37]=[createTextVNode(" 下载三维家JSON ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>["admin"===__props.permission?(openBlock(),createBlock(unref(ElDropdown),{key:0,trigger:"hover",style:{width:"100%",outline:"unset"},placement:"right-end"},{dropdown:withCtx(()=>[createVNode(unref(ElInput),{modelValue:z.value,"onUpdate:modelValue":_cache[9]||(_cache[9]=$event=>z.value=$event),placeholder:"z",type:"number"},null,8,["modelValue"])]),default:withCtx(()=>[_cache[38]||(_cache[38]=createElementVNode("div",{class:"w-full"},"z值调整",-1))]),_:1})):createCommentVNode("",!0)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[10]||(_cache[10]=withModifiers(()=>{},["stop"])),onClick:_cache[11]||(_cache[11]=$event=>console.log("选中线段:",unref(defaultComponent).selectLines,"选中窗户:",unref(defaultComponent).selectHoleLine))},"打印选中",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[12]||(_cache[12]=withModifiers(()=>{},["stop"])),onClick:withModifiers(ringTest,["stop","prevent"])},"回环测试",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[13]||(_cache[13]=withModifiers(()=>{},["stop"])),onClick:withModifiers(angleTest,["stop","prevent"])},"角度测试",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[14]||(_cache[14]=withModifiers(()=>{},["stop"])),onClick:withModifiers(intersectionTest,["stop","prevent"])},"交点测试",32)]),_:1})]),_:1})]),default:withCtx(()=>[createVNode(unref(ElButton),{size:"small",class:"mt-[10px] w-full"},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode("其他功能",-1)])]),_:1})]),_:1})):createCommentVNode("",!0)])):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([{"translate-y-full":isMainCommand.value},"z-8 absolute left-0 bottom-0 transition-transform w-full bg-white p-[5px] box-border text-[14px]"]),onMousedown:_cache[18]||(_cache[18]=e=>e.stopPropagation()),onPointerdown:_cache[19]||(_cache[19]=e=>e.stopPropagation())},[createElementVNode("div",_hoisted_14,[createVNode(unref(ElCheckbox),{size:"small",modelValue:dxfVisible.value,"onUpdate:modelValue":_cache[15]||(_cache[15]=$event=>dxfVisible.value=$event)},{default:withCtx(()=>[..._cache[39]||(_cache[39]=[createTextVNode("Dxf",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{size:"small",modelValue:unref(editor).renderManager.lineAdsorption.value,"onUpdate:modelValue":_cache[16]||(_cache[16]=$event=>unref(editor).renderManager.lineAdsorption.value=$event)},{default:withCtx(()=>[..._cache[40]||(_cache[40]=[createTextVNode("线吸附",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{disabled:!unref(editor).renderManager.lineAdsorption.value,size:"small",modelValue:unref(editor).renderManager.pointAdsorption.value,"onUpdate:modelValue":_cache[17]||(_cache[17]=$event=>unref(editor).renderManager.pointAdsorption.value=$event)},{default:withCtx(()=>[..._cache[41]||(_cache[41]=[createTextVNode("点吸附",-1)])]),_:1},8,["disabled","modelValue"])]),createElementVNode("ul",_hoisted_15,[(openBlock(),createElementBlock(Fragment,null,renderList(commandList,item=>(openBlock(),createElementBlock(Fragment,{key:item.command},[item.show?(openBlock(),createElementBlock("li",{key:0,onClick:$event=>startCurrentCommandItem(item),class:normalizeClass([{"bg-(--primary-color)!":currentCommand.value===item.command},"gap-[10px] relative hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])},[createElementVNode("div",_hoisted_17,[createElementVNode("img",{class:"size-[20px]",src:item.src,alt:"",srcset:""},null,8,_hoisted_18)])],10,_hoisted_16)):createCommentVNode("",!0)],64))),64))]),createElementVNode("div",_hoisted_19,[createVNode(TransitionGroup,null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(otherCommandList,item=>withDirectives(createElementVNode("div",{onClick:$event=>item.disabled.value&&"default"===currentCommand.value&&(item.action?item.action():unref(editor).commandManager.start(item.command,[...unref(defaultComponent).selectLines])),title:`${item.name}(${item.shortcut})`,class:normalizeClass(["size-[28px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border rounded-[4px] transition-all cursor-pointer",{"opacity-30 bg-[#ccc] cursor-no-drop! active:scale-[1]!":!item.disabled.value||"default"!==currentCommand.value,[item.class??""]:!0}]),key:item.command},[createElementVNode("img",{class:"size-[20px]",src:item.src},null,8,_hoisted_21)],10,_hoisted_20),[[vShow,!(!1===item.show?.value)]])),64))]),_:1})])],34)),(openBlock(),createBlock(Teleport,{to:unref(domContainer).dialogLayer},[isMainCommand.value?(openBlock(),createElementBlock("div",{key:0,onMousemove:_cache[21]||(_cache[21]=e=>e.stopPropagation()),onClick:_cache[22]||(_cache[22]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[23]||(_cache[23]=withModifiers(()=>{},["stop"])),onPointermove:_cache[24]||(_cache[24]=withModifiers(()=>{},["stop"])),onMousedown:_cache[25]||(_cache[25]=withModifiers(()=>{},["stop"])),class:"cursor-pointer z-8 box-border bg-[rgba(0,0,0,0.5)] rounded-[6px] p-[5px] absolute left-[50%] translate-x-[-50%] top-[20px] flex gap-[5px] items-center"},[createElementVNode("button",{onClick:_cache[20]||(_cache[20]=withModifiers(e=>(unref(editor).cancelCommand(),e.stopPropagation()),["stop"])),class:"bg-transparent! button cursor-pointer"},[..._cache[42]||(_cache[42]=[createElementVNode("svg",{fill:"#fff",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},[createElementVNode("path",{d:"M952.532295 495.269967 767.686357 310.423005c-9.060353-9.060353-23.75196-9.060353-32.81743 0l-37.363979 37.362956c-9.060353 9.060353-9.060353 23.757077 0 32.81743l81.538061 81.538061L407.384337 462.141452c-12.812817 0-23.199375 10.386558-23.199375 23.199375l0 52.845579c0 12.815887 10.386558 23.204491 23.199375 23.204491l371.479593 0-81.538061 81.538061c-9.060353 9.060353-9.060353 23.757077 0 32.81743l37.368072 37.363979c9.060353 9.05933 23.75503 9.05933 32.815383 0l147.653875-147.653875c0-0.005117 0.005117-0.005117 0.005117-0.005117l37.368072-37.368072C961.592648 519.020904 961.592648 504.33032 952.532295 495.269967L952.532295 495.269967zM634.083499 64.754816l-499.803213 0c-38.441521 0-69.608358 31.166837-69.608358 69.608358l0 754.806002c0 38.446637 31.166837 69.608358 69.608358 69.608358l499.803213 0c38.441521 0 69.608358-31.16172 69.608358-69.608358l0-97.937566c0-12.811794-10.386558-23.204491-23.204491-23.204491l-50.29243 0c-12.812817 0-23.205515 10.392698-23.205515 23.204491l0 37.257555c0 34.328853 0 34.328853-34.791387 34.328853L195.199751 862.818017c-34.801621 0-34.801621 0.00614-34.801621-34.806737L160.39813 194.712657c0-34.900881-0.074701-34.802644 34.801621-34.802644l376.99726 0c34.798551 0 34.791387 0.285502 34.791387 34.329876l0 38.353516c0 12.815887 10.392698 23.204491 23.205515 23.204491l50.29243 0c12.817933 0 23.204491-10.388605 23.204491-23.204491L703.690834 134.363174C703.691857 95.921653 672.52502 64.754816 634.083499 64.754816L634.083499 64.754816zM634.083499 64.754816"})],-1)])]),showConfirm.value?(openBlock(),createElementBlock("button",{key:0,onClick:withModifiers(commandConfirm,["stop"]),class:"button bg-transparent! cursor-pointer"},[..._cache[43]||(_cache[43]=[createElementVNode("svg",{fill:"#28c932",viewBox:"0 0 1026 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},[createElementVNode("path",{d:"M79.288 400c19.2 0 38.4 9.6 54.4 25.6l240 249.6c12.8 16 19.2 16 35.2 0 147.2-153.6 294.4-304 441.6-457.6 16-16 32-35.2 48-51.2 28.8-28.8 70.4-32 99.2-6.4 32 25.6 38.4 73.6 9.6 105.6-32 38.4-67.2 73.6-102.4 108.8-150.4 156.8-300.8 313.6-454.4 470.4-38.4 38.4-80 41.6-115.2 6.4-105.6-108.8-211.2-217.6-313.6-326.4-22.4-25.6-28.8-54.4-12.8-83.2 12.8-25.6 35.2-41.6 70.4-41.6z"})],-1)])])):createCommentVNode("",!0)],32)):createCommentVNode("",!0),isMainCommand.value&¤tMainCommand.value?(openBlock(),createElementBlock("div",_hoisted_22,[createElementVNode("div",_hoisted_23,toDisplayString(currentMainCommand.value.name),1)])):createCommentVNode("",!0)],8,["to"]))],64))}}),EditorToolContent=/* @__PURE__ */_export_sfc(_sfc_main$1,[["__scopeId","data-v-a092e898"]]);class StorageHelper{static get(key,defaultValue=void 0){const value=localStorage.getItem(key);return void 0===value?defaultValue:value}static getBoolean(key,defaultValue=!1){return"true"===this.get(key,defaultValue?"true":"false")}static getNumber(key,defaultValue=0){const v=this.get(key,defaultValue);return"number"==typeof v?v:Number(v)}static getJson(key,defaultValue){const v=this.get(key,defaultValue);try{if(v)return JSON.parse(v)}catch(error){}return defaultValue}static set(key,vaalue){localStorage.setItem(key,String(vaalue))}static setJson(key,value){this.set(key,JSON.stringify(value))}}const _hoisted_1=["innerHTML"],_sfc_main=/* @__PURE__ */defineComponent({__name:"EditorTool",props:{dxfSystem:{},permission:{}},setup(__props){const props=__props,isPc=computed(()=>!isMobileRef.value),toolBarExpand=ref(StorageHelper.getBoolean("toolBarExpand",!0)),promptMessage=ref(),editor=props.dxfSystem.findComponentByType(Editor);return watch(toolBarExpand,()=>{localStorage.setItem("toolBarExpand",toolBarExpand.value+"")}),editor.commandManager.addEventListener("executing",e=>{const commandFlow=editor.commandManager.getCommandFlow(e.name),data=commandFlow.getData(commandFlow.currentIndex);promptMessage.value=data.prompt}),(_ctx,_cache)=>isPc.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(_sfc_main$7,{showTitle:isPc.value,showContent:toolBarExpand.value,"onUpdate:showContent":_cache[0]||(_cache[0]=$event=>toolBarExpand.value=$event),title:"控制面板",name:"PropertiesPanel",style:{"z-index":"9"},onClickIcon:_cache[1]||(_cache[1]=$event=>toolBarExpand.value=!toolBarExpand.value)},{icon:withCtx(()=>[(openBlock(),createElementBlock("svg",{fill:"#666",class:normalizeClass([{"rotate-90":toolBarExpand.value},"transition-all"]),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12"},[..._cache[2]||(_cache[2]=[createElementVNode("path",{d:"M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z"},null,-1)])],2))]),default:withCtx(()=>[toolBarExpand.value?(openBlock(),createBlock(EditorToolContent,{key:0,dxfSystem:__props.dxfSystem,permission:__props.permission},null,8,["dxfSystem","permission"])):createCommentVNode("",!0)]),_:1},8,["showTitle","showContent"]),promptMessage.value?(openBlock(),createElementBlock("div",{key:0,innerHTML:promptMessage.value,class:"text-white pointer-events-none z-8 text-[12px] absolute left-[20px] bottom-[20px] rounded-[8px] min-w-[150px] bg-white/15 p-[10px]"},null,8,_hoisted_1)):createCommentVNode("",!0)],64)):(openBlock(),createBlock(EditorToolContent,{key:1,dxfSystem:__props.dxfSystem,permission:__props.permission},null,8,["dxfSystem","permission"]))}});class Editor extends Component{static name="Editor";container=new THREE.Group;get renderer(){return this.parent?.findComponentByName("Renderer")}get dxf(){return this.parent?.findComponentByName("Dxf")}get variable(){return this.parent?.findComponentByName("Variable")}get eventInput(){return this.parent?.findComponentByName("EventInput")}get renderManager(){return this.parent?.findComponentByName("RenderManager")}get domEventRegister(){return this.parent?.findComponentByName("DomEventRegister")}get domContainer(){return this.parent?.findComponentByName("DomContainer")}commandManager=new CommandManager;plane=new THREE.Mesh(new THREE.PlaneGeometry(2e3,2e3,2,2));app;domElement=document.createElement("div");viewPermission;imgEl=document.createElement("img");imgWidth=80;constructor(viewPermission){super(),this.viewPermission=viewPermission,Object.assign(this.imgEl.style,{position:"absolute",left:"5px",top:"5px",width:`${this.imgWidth}px`,height:`${this.imgWidth}px`,borderRadius:"10px",objectFit:"contain",background:"rgba(255,255,255,0.2)",pointerEvents:"none",cursor:"pointer",transition:"all 0.25s"}),this.imgEl.addEventListener("mousedown",e=>e.stopPropagation()),this.imgEl.addEventListener("mouseup",e=>e.stopPropagation()),this.imgEl.addEventListener("mousemove",e=>e.stopPropagation()),this.imgEl.draggable=!1}onAddFromParent(parent2){setTimeout(()=>this.openEdit(),10);const grid=new THREE.GridHelper(200,100,6710886,4473924);grid.rotation.x=.5*Math.PI,grid.position.z=-.01,this.container.add(grid),this.container.add(this.plane),this.plane.visible=!1;const cancelEvent=this.addEventListener("update",()=>{this.domContainer.dialogLayer.appendChild(this.domElement),isMobileRef.value||this.domContainer.dialogLayer.appendChild(this.imgEl),cancelEvent()});setTimeout(()=>{this.app=createApp(_sfc_main,{dxfSystem:this.parent,permission:this.viewPermission}),this.app.mount(this.domElement)}),parent2.CorrectionDxf.addEventListener("cadChange",async()=>{this.imgEl.src&&URL.revokeObjectURL(this.imgEl.src),setTimeout(async()=>{this.imgEl.src=URL.createObjectURL(await parent2.CorrectionDxf.toDxfImageBlob("Centimeters","image/png","transparent"))})}),this.domEventRegister.addEventListener("mousedown",e=>{e.x<this.imgWidth+10&&e.x>10&&e.y<this.imgWidth&&e.y>10&&Object.assign(this.imgEl.style,{width:`${Math.min(10*this.imgWidth,.9*this.renderer.width)}px`,height:`${Math.min(10*this.imgWidth,.9*this.renderer.height)}px`,background:"rgba(0,0,0,1)",zIndex:100})}),this.domEventRegister.addEventListener("mousemove",e=>{e.x<this.imgWidth+10&&e.x>10&&e.y<this.imgWidth&&e.y>10||Object.assign(this.imgEl.style,{width:`${this.imgWidth}px`,height:`${this.imgWidth}px`,background:"rgba(255,255,255,0.2)",zIndex:0})})}cancelCommand(){this.dispatchEvent({type:"cancelCommand"})}coords=new THREE.Vector2;pointerPosition=new THREE.Vector2;_exitEditCallBack;openEdit(){const renderer=this.renderer,domEventRegister=this.domEventRegister,dxf2=this.dxf,orbitControls=renderer.orbitControls,camera=renderer.camera,center=dxf2.box.center,cameraPosition=renderer.camera.position.clone(),target=orbitControls?.target?.clone(),size=new THREE.Vector2,raycaster=new THREE.Raycaster,coords=this.coords,pointerPosition=this.pointerPosition;this.container.position.z=dxf2.originalZAverage,renderer.scene.add(this.container),orbitControls&&(camera.position.set(center.x,center.y,15),orbitControls.target.set(center.x,center.y,0),orbitControls.enableRotate=!1);const mousemoveFun=()=>{renderer.renderer.getSize(size);const x=domEventRegister.pointer.x/size.x*2-1,y=-(domEventRegister.pointer.y/size.y*2-1);coords.set(x,y),raycaster.setFromCamera(coords,renderer.camera.children.length?renderer.camera.children[0]:renderer.camera);const intersections=raycaster.intersectObject(this.plane);intersections.length&&(pointerPosition.copy(intersections[0].point),this.dispatchEvent({type:"pointerPositionChange",position:pointerPosition}))};isMobileRef.value||domEventRegister.addEventListener("mousemove",mousemoveFun),isMobileRef.value&&(domEventRegister.addEventListener("pointermove",mousemoveFun),domEventRegister.addEventListener("pointerdown",mousemoveFun)),this.commandManager.disabled=!1,this.commandManager.start("default"),this._exitEditCallBack=()=>{domEventRegister.removeEventListener("mousemove",mousemoveFun),orbitControls&&(camera.position.copy(cameraPosition),orbitControls.enableRotate=!0,orbitControls.target.copy(target))}}exitEdit(){"function"==typeof this._exitEditCallBack&&(this._exitEditCallBack(),this._exitEditCallBack=void 0,this.commandManager.disabled=!0)}destroy(){this.commandManager.destroy(),super.destroy(),this.exitEdit(),this.renderer.scene.remove(this.container),this.domElement.remove(),this.app?.unmount()}}function Editor_(dxfSystem,option={}){dxfSystem.addComponent(new Editor(option.viewPermission)),dxfSystem.addComponent(new RenderManager),dxfSystem.addComponent(new DefaultCommand),dxfSystem.addComponent(new DrawLine),dxfSystem.addComponent(new DrawDoorLine),dxfSystem.addComponent(new DrawWindow),dxfSystem.addComponent(new PointDrag),dxfSystem.addComponent(new DeleteSelectLine),dxfSystem.addComponent(new MergeLine),dxfSystem.addComponent(new VerticalCorr),dxfSystem.addComponent(new VerticalCorrContinue),dxfSystem.addComponent(new TwoPointConnection),dxfSystem.addComponent(new TwoLineConnectionLine),dxfSystem.addComponent(new SelectAll),dxfSystem.addComponent(new ViewAngle),dxfSystem.addComponent(new ClippingLine),dxfSystem.addComponent(new PropertiesPanel),dxfSystem.addComponent(new RayDistance),dxfSystem.addComponent(new ManualDistance),dxfSystem.addComponent(new DrawHole),dxfSystem.addComponent(new DrawBalconyRailing)}const EditorPlugin=Object.assign(Editor_,{create:(option={})=>dxfSystem=>Editor_(dxfSystem,option)});export{EditorPlugin,Editor_};
|
|
1
|
+
import{g as getDefaultExportFromCjs,C as Component,V as Variable,L as LineSegment,Q as Quadtree,P as Point,u as uuid,m as mToMm,a as mergeChainsLine,W as WH,R as Rectangle,D as DEFAULT_WALL_WIDTH,b as Lines,c as WallHole,d as LineSegmentUtils,e as clippingLineUserData,f as mmTom,h as LineDashed,i as LinePipeline,j as PointSpatialHash,B as Box2,k as cloneUserData,l as Pipeline,n as WallGroupManager,o as PointUtils,H as HeightQuery,p as drawText,q as WhiteModel,T as ThreeVJia,S as SelectLocalFile,M as MiniCircles,r as CommandManager}from"./build.js";import*as THREE from"three";import{Vector3,InstancedBufferGeometry,Float32BufferAttribute,InstancedInterleavedBuffer,InterleavedBufferAttribute,WireframeGeometry,Box3,Sphere,ShaderMaterial,ShaderLib,UniformsUtils,Vector2,UniformsLib,Mesh,Vector4,Line3,Matrix4,MathUtils,Group}from"three";import"clipper-lib";import"dxf-writer";import{i as isMobileRef,b as isMobile,D as DomEventRegister,a as DomContainer}from"./DomEventRegister.js";import"three/addons/controls/OrbitControls.js";import{defineComponent,useModel,ref,computed,watch,nextTick,onMounted,onUnmounted,openBlock,createElementBlock,normalizeClass,createElementVNode,normalizeStyle,createStaticVNode,toDisplayString,renderSlot,createCommentVNode,mergeModels,warn,getCurrentInstance,unref,getCurrentScope,onScopeDispose,shallowRef,watchEffect,readonly,isRef,reactive,inject,onBeforeUnmount,onBeforeMount,provide,createBlock,Teleport,mergeProps,withDirectives,cloneVNode,Comment,Fragment,Text,createVNode,withCtx,toRef,Transition,vShow,onDeactivated,markRaw,useAttrs as useAttrs$1,useSlots,resolveDynamicComponent,withModifiers,onActivated,onUpdated,createTextVNode,toRaw,vModelCheckbox,toRefs,renderList,resolveComponent,normalizeProps,guardReactiveProps,createSlots,shallowReactive,isVNode,render as render$1,createApp,h,vModelText,TransitionGroup}from"vue";import{CSS2DObject}from"three/addons/renderers/CSS2DRenderer.js";const _hoisted_1$d={class:"flex flex-row"},_hoisted_2$6={class:"flex text-nowrap text-[12px] items-center pointer-events-none"},_hoisted_3$3={key:1,class:"p-[5px]"},_sfc_main$7=/* @__PURE__ */defineComponent({__name:"DragContainer",props:/* @__PURE__ */mergeModels({name:{},title:{},position:{}},{showContent:{default:!0},showContentModifiers:{},showTitle:{default:!0},showTitleModifiers:{}}),emits:/* @__PURE__ */mergeModels(["clickIcon"],["update:showContent","update:showTitle"]),setup(__props,{emit:__emit}){function setEditorToolPosition(left,top,rect=elRef.value.getBoundingClientRect(),toolBarRect=toolBarRef.value.getBoundingClientRect()){const maxX=rect.width-toolBarRect.width,maxY=rect.height-toolBarRect.height;left=Math.max(0,Math.min(left,maxX)),top=Math.max(0,Math.min(top,maxY)),toolBarPosition.value={left:left,top:top}}function dragMoveHelper(e){if(isMobileRef.value&&e instanceof MouseEvent)return;let offsetX=0,offsetY=0;if(isdrag.value=!0,e instanceof MouseEvent)offsetX=e.offsetX,offsetY=e.offsetY;else if(e instanceof TouchEvent){const rect2=e.target.getBoundingClientRect(),touch=e.touches[0];offsetX=touch.pageX-rect2.left,offsetY=touch.pageY-rect2.top}const cusor=document.body.style.cursor;document.body.style.cursor="move";const rect=elRef.value.getBoundingClientRect(),toolBarRect=toolBarRef.value.getBoundingClientRect(),move=e2=>{setEditorToolPosition(e2.pageX-rect.left-offsetX,e2.pageY-rect.top-offsetY,rect,toolBarRect),e2.stopPropagation(),e2.preventDefault(),document.body.style.cursor="move"},end=()=>{document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",end),document.body.style.cursor=cusor,isdrag.value=!1},touchmove=e2=>{if(e2.touches.length){const touch=e2.touches[0];setEditorToolPosition(touch.pageX-rect.left-offsetX,touch.pageY-rect.top-offsetY,rect,toolBarRect),e2.stopPropagation(),document.body.style.cursor="move",e2.stopPropagation(),e2.preventDefault()}},touchend=()=>{document.removeEventListener("touchmove",touchmove),document.removeEventListener("touchend",touchend),document.body.style.cursor=cusor,isdrag.value=!1};isMobileRef.value?(document.addEventListener("touchmove",touchmove,{passive:!1}),document.addEventListener("touchend",touchend)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",end)),e.stopPropagation(),e.preventDefault()}function onClickIcon(e){emits("clickIcon"),e.stopPropagation()}const props=__props,emits=__emit,showContent=useModel(__props,"showContent"),showTitle=useModel(__props,"showTitle"),elRef=ref(),toolBarRef=ref(),toolBarPosition=ref({left:props.position?.x??10,top:props.position?.y??100}),resizeObserver=new ResizeObserver(()=>setEditorToolPosition(toolBarPosition.value.left,toolBarPosition.value.top)),isdrag=ref(!1),isPc=computed(()=>!isMobileRef.value);if(watch(showContent,()=>{showContent.value&&nextTick(()=>setEditorToolPosition(toolBarPosition.value.left,toolBarPosition.value.top))}),props.name&&!props.position&&localStorage.getItem(props.name)){watch(toolBarPosition,()=>localStorage.setItem(props.name,JSON.stringify(toolBarPosition.value)));const{left:left,top:top}=JSON.parse(localStorage.getItem(props.name)??"{}");toolBarPosition.value={left:left,top:top}}return onMounted(()=>{nextTick(()=>resizeObserver.observe(elRef.value))}),onUnmounted(()=>{resizeObserver.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{onClick:_cache[1]||(_cache[1]=e=>e.stopPropagation()),ref_key:"elRef",ref:elRef,class:normalizeClass([{"pointer-events-none":isdrag.value},"editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-20 flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"])},[createElementVNode("div",{ref_key:"toolBarRef",ref:toolBarRef,style:normalizeStyle({left:toolBarPosition.value.left+"px",top:toolBarPosition.value.top+"px"}),class:normalizeClass(["overflow-hidden pointer-events-auto w-fit transition-[border-radius] text-[#333] absolute z-11 bg-white select-none max-w-full",{"rounded-[8px]":showContent.value&&isPc.value}]),onMousedown:_cache[0]||(_cache[0]=e=>e.stopPropagation())},[showTitle.value?(openBlock(),createElementBlock("div",{key:0,onTouchstart:dragMoveHelper,onMousedown:dragMoveHelper,class:normalizeClass([{"border-b-[#eee] border-b":showContent.value},"flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])},[createElementVNode("div",_hoisted_1$d,[_cache[2]||(_cache[2]=createStaticVNode('<div class="p-[2px_5px] size-[20px] flex items-center pointer-events-none"><svg fill="#aaa" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M352 128a134.4 134.4 0 0 1 128.832 96H921.6a38.4 38.4 0 0 1 0 76.8H480.832a134.4 134.4 0 0 1-257.664 0H102.4a38.4 38.4 0 1 1 0-76.8h120.768A134.4 134.4 0 0 1 352 128z m0 76.8a57.6 57.6 0 1 0 0 115.2 57.6 57.6 0 0 0 0-115.2z"></path><path d="M64 467.2m38.4 0l819.2 0q38.4 0 38.4 38.4l0 0q0 38.4-38.4 38.4l-819.2 0q-38.4 0-38.4-38.4l0 0q0-38.4 38.4-38.4Z"></path><path d="M672 614.4a134.4 134.4 0 0 1 128.832 96H921.6a38.4 38.4 0 0 1 0 76.8h-120.768a134.4 134.4 0 0 1-257.664 0H102.4a38.4 38.4 0 0 1 0-76.8h440.768A134.4 134.4 0 0 1 672 614.4z m0 76.8a57.6 57.6 0 1 0 0 115.2 57.6 57.6 0 0 0 0-115.2z"></path></svg></div>',1)),createElementVNode("h5",_hoisted_2$6,toDisplayString(__props.title),1)]),createElementVNode("div",{onMousedown:onClickIcon,onTouchstart:onClickIcon,class:"ml-[20px] cursor-pointer flex items-center p-[0px_5px]"},[renderSlot(_ctx.$slots,"icon",{},()=>[_cache[3]||(_cache[3]=createElementVNode("svg",{fill:"#666",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},[createElementVNode("path",{d:"M23.079385 23.079385a78.769231 78.769231 0 0 1 111.379692 0L512 400.541538 889.540923 23.079385a78.769231 78.769231 0 0 1 103.975385-6.537847l7.404307 6.537847a78.769231 78.769231 0 0 1 0 111.379692L623.458462 512l377.462153 377.540923a78.769231 78.769231 0 0 1 6.537847 103.975385l-6.537847 7.404307a78.769231 78.769231 0 0 1-111.379692 0L512 623.458462l-377.540923 377.462153a78.769231 78.769231 0 0 1-103.975385 6.537847l-7.404307-6.537847a78.769231 78.769231 0 0 1 0-111.379692L400.541538 512 23.079385 134.459077A78.769231 78.769231 0 0 1 16.541538 30.483692z"})],-1))])],32)],34)):createCommentVNode("",!0),showContent.value?(openBlock(),createElementBlock("div",_hoisted_3$3,[renderSlot(_ctx.$slots,"default")])):createCommentVNode("",!0)],38)],2))}}),__vite_glob_0_0=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_1=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='279'%20height='279'%20viewBox='0%200%20279%20279'%3e%3cdefs%3e%3cstyle%3e%20.cls-1,%20.cls-2%20{%20fill:%20none;%20stroke:%20%23555;%20stroke-width:%2010px;%20}%20.cls-2%20{%20fill-rule:%20evenodd;%20}%20%3c/style%3e%3c/defs%3e%3ccircle%20id='椭圆_1'%20data-name='椭圆%201'%20class='cls-1'%20cx='139.5'%20cy='139.5'%20r='150'/%3e%3cpath%20id='直线_1'%20data-name='直线%201'%20class='cls-2'%20d='M35.281,156.783v-1.048H245.814v1.048H35.281Z'/%3e%3cpath%20id='直线_2'%20data-name='直线%202'%20class='cls-2'%20d='M140.024,38.423h1.047v118.36h-1.047V38.423Z'/%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_2=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5569'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M522.1888%20811.3152a412.1088%20412.1088%200%200%200-114.5344-269.7728l-244.48%20269.7728h359.0144zM450.816%20493.824c83.5072%2085.3504%20132.7104%20197.4784%20136.5504%20317.4912h417.5872v63.232H18.9952L676.1472%20149.4016l48.9472%2041.7792-274.2784%20302.6432z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_3=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769133028297'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5962'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M23.079385%2023.079385a78.769231%2078.769231%200%200%201%20111.379692%200L512%20400.541538%20889.540923%2023.079385a78.769231%2078.769231%200%200%201%20103.975385-6.537847l7.404307%206.537847a78.769231%2078.769231%200%200%201%200%20111.379692L623.458462%20512l377.462153%20377.540923a78.769231%2078.769231%200%200%201%206.537847%20103.975385l-6.537847%207.404307a78.769231%2078.769231%200%200%201-111.379692%200L512%20623.458462l-377.540923%20377.462153a78.769231%2078.769231%200%200%201-103.975385%206.537847l-7.404307-6.537847a78.769231%2078.769231%200%200%201%200-111.379692L400.541538%20512%2023.079385%20134.459077A78.769231%2078.769231%200%200%201%2016.541538%2030.483692z'%20fill='%23000000'%20p-id='5963'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_4=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_5=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8193'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M426.666667%20255.872c0%2031.232-8.405333%2060.544-23.04%2085.76L512%20451.498667l287.061333-287.061334a85.333333%2085.333333%200%200%201%20120.661334%200l-516.693334%20516.693334a170.666667%20170.666667%200%201%201-60.330666-60.330667l108.970666-108.970667-108.970666-108.970666A170.666667%20170.666667%200%201%201%20426.666667%20255.872z%20m-85.333334%200a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z%20m578.389334%20603.392a85.333333%2085.333333%200%200%201-120.661334%200l-226.858666-226.858667%2060.373333-60.330666%20287.146667%20287.146666zM682.666667%20469.205333h85.333333v85.333334h-85.333333v-85.333334z%20m170.666666%200h85.333334v85.333334h-85.333334v-85.333334z%20m-597.333333%200h85.333333v85.333334H256v-85.333334z%20m-170.666667%200h85.333334v85.333334H85.333333v-85.333334z%20m170.666667%20384a85.333333%2085.333333%200%201%200%200-170.666666%2085.333333%2085.333333%200%200%200%200%20170.666666z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_6=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_7=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_8=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_9=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1767852327874'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1652'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M264.90827%20999.628849H986.622027a12.339175%2012.339175%200%200%200%2012.390375-12.185576V268.238312h-211.506777a36.966326%2036.966326%200%200%201-37.375925-36.607927V24.373199H264.90827A12.595175%2012.595175%200%200%200%20255.999488%2027.957192a12.083176%2012.083176%200%200%200-3.583993%208.601583v950.884498c0%206.707187%205.529589%2012.185576%2012.441575%2012.185576z'%20fill='%23FFFFFF'%20p-id='1653'%3e%3c/path%3e%3cpath%20d='M993.892412%20243.76476L775.16645%2029.493189v202.137196a12.287975%2012.287975%200%200%200%2012.390375%2012.134375h206.335587z'%20fill='%23FFFFFF'%20p-id='1654'%3e%3c/path%3e%3cpath%20d='M1013.041174%20228.046392L791.294417%2010.754026a37.427125%2037.427125%200%200%200-26.521547-10.751978H264.90827c-20.633559%200-37.375925%2016.383967-37.375925%2036.556727v950.884498c0%2020.17276%2016.742367%2036.556727%2037.375925%2036.556727H986.622027c20.633559%200%2037.324725-16.383967%2037.324725-36.556727V253.90234c0-9.727981-3.942392-18.995162-10.956778-25.855948zM775.06405%2029.390789l218.828362%20214.373971h-206.335587a12.339175%2012.339175%200%200%201-12.492775-12.134375V29.390789z%20m211.609177%20970.23806H264.90827a12.595175%2012.595175%200%200%201-8.857582-3.583993%2012.083176%2012.083176%200%200%201-3.583993-8.601583V36.558775c0-6.707187%205.529589-12.185576%2012.441575-12.185576h485.27263v207.257186c0%2020.22396%2016.742367%2036.607927%2037.375925%2036.607927h211.455577v719.204961a12.339175%2012.339175%200%200%201-12.339175%2012.185576z'%20fill='%23605E5C'%20opacity='.64'%20p-id='1655'%3e%3c/path%3e%3cpath%20d='M972.798054%20358.401331a51.199898%2051.199898%200%200%201%2051.199898%2051.199898v352.716094a51.199898%2051.199898%200%200%201-51.199898%2051.199898H51.199898a51.199898%2051.199898%200%200%201-51.199898-51.199898V409.601229a51.199898%2051.199898%200%200%201%2051.199898-51.199898h921.598156z%20m2.252796%2025.804749H53.145494a25.599949%2025.599949%200%200%200-25.599949%2025.599948v355.17369a25.599949%2025.599949%200%200%200%2025.599949%2025.599949h921.905356a25.599949%2025.599949%200%200%200%2025.599949-25.599949V409.806028a25.599949%2025.599949%200%200%200-25.599949-25.599948z'%20fill='%230563B2'%20p-id='1656'%3e%3c/path%3e%3cpath%20d='M53.145494%20384.20608h921.905356a25.599949%2025.599949%200%200%201%2025.599949%2025.599948v355.17369a25.599949%2025.599949%200%200%201-25.599949%2025.599949H53.145494a25.599949%2025.599949%200%200%201-25.599949-25.599949V409.806028a25.599949%2025.599949%200%200%201%2025.599949-25.599948z'%20fill='%23FFFFFF'%20p-id='1657'%3e%3c/path%3e%3cpath%20d='M326.604147%20396.698855v129.94534c-19.81436-26.265547-43.315113-39.167922-70.963058-39.167922-34.099132%200-61.286277%2012.441575-80.639839%2037.324725-18.431963%2023.039954-27.187146%2052.070296-27.187146%2087.091026%200%2036.403127%209.215982%2066.355067%2027.647945%2089.395021%2019.81436%2024.88315%2047.462305%2037.324725%2082.943834%2037.324726%2031.334337%200%2055.295889-10.598379%2071.884656-31.795137v25.34395h48.844703V396.698855H326.604147z%20m-58.521483%20133.170933c16.588767%200%2030.873538%206.911986%2041.932716%2020.735959%2011.980776%2014.745571%2018.431963%2035.02073%2018.431963%2060.364679v3.686393c0%2023.039954-5.06879%2042.393515-14.74557%2057.139085-11.059178%2016.127968-27.187146%2024.422351-47.462305%2024.422352-23.500753%200-40.550319-8.294383-51.148698-24.883151-9.215982-13.823972-13.363173-33.638333-13.363173-59.443081s4.607991-45.15831%2014.284771-58.521483c11.059178-15.667169%2028.108744-23.500753%2052.070296-23.500753zM416.613567%20493.92746l82.022236%20111.513377L406.015188%20732.160584h61.747076l59.903881-88.012624%2059.443081%2088.012624h61.747076l-92.620614-126.719747%2082.022235-111.513377h-61.286277l-49.305501%2072.806255-49.766301-72.806255zM769.278461%20403.150042c-21.196758%200-37.785524%205.529589-48.844702%2017.510365-11.519977%2011.519977-17.049566%2027.647945-17.049566%2047.923104v25.343949h-52.991894v42.854314h52.991894V732.160584h52.531095v-195.37881h60.825479v-42.854314h-60.825479v-23.961552c0-7.833584%201.382397-13.363173%205.06879-17.049566%203.686393-3.686393%208.755182-5.529589%2015.667169-5.529589h43.315113v-44.236711h-50.687899z'%20fill='%230563B2'%20p-id='1658'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_10=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_11=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_12=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_13=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_14=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_15=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_16=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_17=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1759051895215'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1800'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M272.5888%20886.784v70.8608H203.2128V886.784h69.376z%20m416.256-256.6144l270.6944%20152.5248-270.6944%20148.1216v-114.8928H64.4608v-70.8608h624.384v-114.8928z%20m-416.256-26.88v70.912H203.2128v-70.912h69.376z%20m0-141.7216V532.48H203.2128V461.568h69.376z%20m-34.7136-398.336L385.024%20319.7952H272.5888V390.656H203.2128V319.8464H90.7776l147.0976-256.6656z'%20fill='%23444444'%20p-id='1801'%3e%3c/path%3e%3cpath%20d='M566.272%2073.3184l173.2608%20264.192V512h71.8848V337.5104l173.2608-264.192H898.048l-122.2656%20197.2224-122.88-197.2224H566.272z'%20fill='%230077FF'%20p-id='1802'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_18=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_19=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1779330751027'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10579'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M80%20448h160v128h-160v-128zM784%20448h160v128h-160v-128z'%20fill='%23D9D9D9'%20p-id='10580'%3e%3c/path%3e%3cpath%20d='M880%20672v-48H736V576h-80v-48H736v-32h-80V448H736v-48h144V352h-704v48H288V448h80v48H288v32h80V576H288v48H176V672h704zM128%20624H32v-224h96v-96h800v96h64v224h-64v54.4l-1.6%2041.6H128v-96zM240%20448h-160v128h160v-128z%20m704%200h-160v128h160v-128z%20m-544%200h96v48h-96V448z%20m224%200h-96v48h96V448z%20m-224%2080h96V576h-96v-48z%20m224%200h-96V576h96v-48z'%20fill='%23262626'%20p-id='10581'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_20=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769079533165'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4803'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M352%20128a134.4%20134.4%200%200%201%20128.832%2096H921.6a38.4%2038.4%200%200%201%200%2076.8H480.832a134.4%20134.4%200%200%201-257.664%200H102.4a38.4%2038.4%200%201%201%200-76.8h120.768A134.4%20134.4%200%200%201%20352%20128z%20m0%2076.8a57.6%2057.6%200%201%200%200%20115.2%2057.6%2057.6%200%200%200%200-115.2z'%20fill='%23666666'%20p-id='4804'%3e%3c/path%3e%3cpath%20d='M64%20467.2m38.4%200l819.2%200q38.4%200%2038.4%2038.4l0%200q0%2038.4-38.4%2038.4l-819.2%200q-38.4%200-38.4-38.4l0%200q0-38.4%2038.4-38.4Z'%20fill='%23666666'%20p-id='4805'%3e%3c/path%3e%3cpath%20d='M672%20614.4a134.4%20134.4%200%200%201%20128.832%2096H921.6a38.4%2038.4%200%200%201%200%2076.8h-120.768a134.4%20134.4%200%200%201-257.664%200H102.4a38.4%2038.4%200%200%201%200-76.8h440.768A134.4%20134.4%200%200%201%20672%20614.4z%20m0%2076.8a57.6%2057.6%200%201%200%200%20115.2%2057.6%2057.6%200%200%200%200-115.2z'%20fill='%23666666'%20p-id='4806'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_21=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1782447219271'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1817'%20width='16'%20height='16'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M904.17152%2081.92a49.01888%2049.01888%200%200%201%2029.40928%2088.23808v642.16064a63.744%2063.744%200%200%201-24.50432%20122.5728%2063.72352%2063.72352%200%200%201-33.98656-117.6576h-0.32768l-0.01024-49.01888H139.43808v44.10368a63.744%2063.744%200%200%201-24.51456%20122.5728%2063.72352%2063.72352%200%200%201-33.97632-117.6576h-0.33792v-647.0656a49.01888%2049.01888%200%201%201%2058.83904%200l-0.01024%2068.61824h735.31392v-68.62848A48.9472%2048.9472%200%200%201%20855.1936%20133.12l-0.04096-2.18112A49.01888%2049.01888%200%200%201%20904.17152%2081.92zM114.92352%20846.6432a24.51456%2024.51456%200%201%200%200%2049.02912%2024.51456%2024.51456%200%200%200%200-49.01888z%20m794.15296%200a24.51456%2024.51456%200%201%200%200%2049.02912%2024.51456%2024.51456%200%200%200%200-49.01888zM266.88512%20376.05376H139.43808v333.34272h127.44704V376.04352z%20m205.89568%200H325.71392v333.34272H472.7808V376.04352z%20m205.88544%200H531.59936v333.34272h147.06688V376.04352z%20m196.08576%200H737.49504v333.34272h137.25696V376.04352z%20m0-78.4384H139.43808v19.6096h735.31392v-19.6096z'%20fill='%23050505'%20p-id='1818'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),__vite_glob_0_22=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769568667919'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11114'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20617.386667c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v182.954667a32%2032%200%200%201-32.213333%2031.829333%2032%2032%200%200%201-32.170667-31.829333v-182.954667A32%2032%200%200%201%20512%20617.386667zM96.170667%20297.216c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v365.909334a32%2032%200%200%201-32.213333%2031.829333%2032%2032%200%200%201-32.170667-31.829333V329.045333a32%2032%200%200%201%2032.170667-31.829333zM927.829333%20297.216c17.792%200%2032.213333%2014.250667%2032.213334%2031.829333v365.909334a32%2032%200%200%201-32.213334%2031.829333%2032%2032%200%200%201-32.170666-31.829333V329.045333a32%2032%200%200%201%2032.170666-31.829333zM396.8%20580.992a32.426667%2032.426667%200%200%201%2045.525333%200%2031.658667%2031.658667%200%200%201%200%2045.056l-46.208%2045.696a32.426667%2032.426667%200%200%201-45.482666%200%2031.616%2031.616%200%200%201%200-45.056l46.208-45.653333zM581.674667%20580.949333a32.426667%2032.426667%200%200%201%2045.482666%200l46.208%2045.738667a31.658667%2031.658667%200%200%201%200%2045.056%2032.426667%2032.426667%200%200%201-45.482666%200l-46.208-45.738667a31.616%2031.616%200%200%201%200-45.056zM214.485333%20441.6a32.426667%2032.426667%200%200%201%2043.093334%202.133333c9.941333%209.898667%2011.904%2024.576%206.058666%2036.437334h109.781334a32%2032%200%200%201%2032.170666%2031.829333%2032%2032%200%200%201-32.170666%2031.872H263.637333a31.573333%2031.573333%200%200%201-6.101333%2036.437333%2032.426667%2032.426667%200%200%201-43.050667%202.133334l-2.432-2.133334-46.208-45.781333a31.616%2031.616%200%200%201%200-45.013333L212.053333%20443.733333l2.432-2.133333zM766.464%20443.733333a32.426667%2032.426667%200%200%201%2045.482667%200l46.208%2045.781334%202.218666%202.389333a31.616%2031.616%200%200%201-2.218666%2042.666667L811.946667%20580.266667l-2.432%202.133333a32.426667%2032.426667%200%200%201-43.093334-2.133333%2031.573333%2031.573333%200%200%201-6.101333-36.437334H650.666667a32%2032%200%200%201-32.170667-31.872%2032%2032%200%200%201%2032.170667-31.829333h109.781333a31.488%2031.488%200%200%201%206.058667-36.437333zM512%20466.304c25.514667%200%2046.208%2020.48%2046.208%2045.738667%200%2025.258667-20.693333%2045.696-46.208%2045.696s-46.208-20.48-46.208-45.696c0-25.258667%2020.693333-45.738667%2046.208-45.738667zM350.848%20352.256a32.426667%2032.426667%200%200%201%2045.482667%200.085333l46.08%2045.696a31.658667%2031.658667%200%200%201-0.128%2045.098667%2032.426667%2032.426667%200%200%201-45.482667-0.085333L350.72%20397.312a31.616%2031.616%200%200%201%200.128-45.056zM627.882667%20352.298667a32.426667%2032.426667%200%200%201%2045.482666%200%2031.616%2031.616%200%200%201%200%2045.056l-46.208%2045.653333a32.426667%2032.426667%200%200%201-45.482666%200%2031.616%2031.616%200%200%201%200-45.013333l46.208-45.696zM512%20160c17.749333%200%2032.213333%2014.250667%2032.213333%2031.829333v182.954667A32%2032%200%200%201%20512%20406.613333a32%2032%200%200%201-32.170667-31.829333V191.829333A32%2032%200%200%201%20512%20160z'%20p-id='11115'%3e%3c/path%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"})),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue";"production"===process.env.NODE_ENV||Object.freeze({}),"production"===process.env.NODE_ENV||Object.freeze([]);const NOOP=()=>{},hasOwnProperty$e=Object.prototype.hasOwnProperty,hasOwn=(val,key)=>hasOwnProperty$e.call(val,key),isArray$1=Array.isArray,isFunction$1=val=>"function"==typeof val,isString=val=>"string"==typeof val,isObject$2=val=>null!==val&&"object"==typeof val,cacheStringFunction=(Object.prototype.toString,fn2=>{const cache=/* @__PURE__ */Object.create(null);return str=>cache[str]||(cache[str]=fn2(str))}),camelizeRE=/-\w/g;cacheStringFunction(str=>str.replace(camelizeRE,c=>c.slice(1).toUpperCase())),cacheStringFunction(str=>str.charAt(0).toUpperCase()+str.slice(1));var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$g=Object.prototype,hasOwnProperty$d=objectProto$g.hasOwnProperty,nativeObjectToString$1=objectProto$g.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;var nativeObjectToString=Object.prototype.toString;var symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?function(value){var isOwn=hasOwnProperty$d.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString$1.call(value);return unmasked&&(isOwn?value[symToStringTag$1]=tag:delete value[symToStringTag$1]),result}(value):function(value){return nativeObjectToString.call(value)}(value)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var isArray=Array.isArray,symbolProto$2=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function isObject$1(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isFunction(value){if(!isObject$1(value))return!1;var tag=baseGetTag(value);return"[object Function]"==tag||"[object GeneratorFunction]"==tag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}var uid,coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"";var funcToString$2=Function.prototype.toString;function toSource(func){if(null!=func){try{return funcToString$2.call(func)}catch(e){}try{return func+""}catch(e){}}return""}var reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$e=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$c=objectProto$e.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(value){return!(!isObject$1(value)||(func=value,maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value));var func}function getNative(object,key){var value=function(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(value)?value:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=/* @__PURE__ */function(){function object(){}return function(proto){if(!isObject$1(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=void 0,result}}();var nativeNow=Date.now;var func,count,lastCalled,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:(value=string,function(){return value}),writable:!0});var value}:function(value){return value},setToString=(func=baseSetToString,count=0,lastCalled=0,function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)});var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function eq(value,other){return value===other||value!=value&&other!=other}var hasOwnProperty$b=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];hasOwnProperty$b.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=void 0;void 0===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}var nativeMax=Math.max;function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}var objectProto$c=Object.prototype;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto$c)}function baseIsArguments(value){return isObjectLike(value)&&"[object Arguments]"==baseGetTag(value)}var objectProto$b=Object.prototype,hasOwnProperty$a=objectProto$b.hasOwnProperty,propertyIsEnumerable$1=objectProto$b.propertyIsEnumerable,isArguments=baseIsArguments(/* @__PURE__ */function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$a.call(value,"callee")&&!propertyIsEnumerable$1.call(value,"callee")};var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer$1=freeModule$2&&freeModule$2.exports===freeExports$2?root.Buffer:void 0,isBuffer=(Buffer$1?Buffer$1.isBuffer:void 0)||function(){return!1},typedArrayTags={};function baseUnary(func){return function(value){return func(value)}}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule$1&&freeModule$1.exports===freeExports$1&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]},hasOwnProperty$9=Object.prototype.hasOwnProperty;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?function(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty$9.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function overArg(func,transform){return function(arg){return func(transform(arg))}}var nativeKeys=overArg(Object.keys,Object),hasOwnProperty$8=Object.prototype.hasOwnProperty;function keys(object){return isArrayLike(object)?arrayLikeKeys(object):function(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty$8.call(object,key)&&"constructor"!=key&&result.push(key);return result}(object)}var hasOwnProperty$7=Object.prototype.hasOwnProperty;function baseKeysIn(object){if(!isObject$1(object))return function(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty$7.call(object,key))&&result.push(key);return result}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;var nativeCreate=getNative(Object,"create");var hasOwnProperty$6=Object.prototype.hasOwnProperty;var hasOwnProperty$5=Object.prototype.hasOwnProperty;function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?void 0:result}return hasOwnProperty$6.call(data,key)?data[key]:void 0},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty$5.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this};var splice=Array.prototype.splice;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]},ListCache.prototype.has=function(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this};var Map$1=getNative(root,"Map");function getMapData(map,key){var value,type,data=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?data["string"==typeof key?"string":"hash"]:data.map}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this};function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError("Expected a function");var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(func){var result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache;return result}(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result});function castPath(value,object){return isArray(value)?value:function(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object)}(value,object)?[value]:stringToPath(function(value){return null==value?"":baseToString(value)}(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function flatten(array){return(null==array?0:array.length)?baseFlatten(array,1):[]}function flatRest(func){return setToString(function(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),function(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}(func,this,otherArgs)}}(func,void 0,flatten),func+"")}var getPrototype=overArg(Object.getPrototypeOf,Object),funcProto=Function.prototype,objectProto$5=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$4=objectProto$5.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty$4.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map$1||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(object){return null==object?[]:(object=Object(object),function(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}(nativeGetSymbols$1(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;var getSymbolsIn=Object.getOwnPropertySymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView&&"[object DataView]"!=getTag(new DataView(new ArrayBuffer(1)))||Map$1&&"[object Map]"!=getTag(new Map$1)||Promise$1&&"[object Promise]"!=getTag(Promise$1.resolve())||Set$1&&"[object Set]"!=getTag(new Set$1)||WeakMap$1&&"[object WeakMap]"!=getTag(new WeakMap$1))&&(getTag=function(value){var result=baseGetTag(value),Ctor="[object Object]"==result?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return"[object DataView]";case mapCtorString:return"[object Map]";case promiseCtorString:return"[object Promise]";case setCtorString:return"[object Set]";case weakMapCtorString:return"[object WeakMap]"}return result});var hasOwnProperty$3=Object.prototype.hasOwnProperty;var Uint8Array$1=root.Uint8Array;function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer)),result}var reFlags=/\w*$/;var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function initCloneByTag(object,tag,isDeep){var symbol,regexp,result,Ctor=object.constructor;switch(tag){case"[object ArrayBuffer]":return cloneArrayBuffer(object);case"[object Boolean]":case"[object Date]":return new Ctor(+object);case"[object DataView]":return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}(object,isDeep);case"[object Map]":case"[object Set]":return new Ctor;case"[object Number]":case"[object String]":return new Ctor(object);case"[object RegExp]":return(result=new(regexp=object).constructor(regexp.source,reFlags.exec(regexp))).lastIndex=regexp.lastIndex,result;case"[object Symbol]":return symbol=object,symbolValueOf$1?Object(symbolValueOf$1.call(symbol)):{}}}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&"[object Map]"==getTag(value)};var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&"[object Set]"==getTag(value)},cloneableTags={};function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),void 0!==result)return result;if(!isObject$1(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty$3.call(array,"index")&&(result.index=array.index,result.input=array.input),result}(value),!isDeep)return function(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}(value,result)}else{var tag=getTag(value),isFunc="[object Function]"==tag||"[object GeneratorFunction]"==tag;if(isBuffer(value))return function(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}(value,isDeep);if("[object Object]"==tag||"[object Arguments]"==tag||isFunc&&!object){if(result=isFlat||isFunc?{}:function(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&©Object(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,function(object,source){return object&©Object(source,keys(source),object)}(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}):isMap(value)&&value.forEach(function(subValue,key2){result.set(key2,baseClone(subValue,bitmask,customizer,key2,value,stack))});var props=isArr?void 0:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return function(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););}(props||value,function(subValue,key2){props&&(subValue=value[key2=subValue]),assignValue(result,key2,baseClone(subValue,bitmask,customizer,key2,value,stack))}),result}cloneableTags["[object Arguments]"]=cloneableTags["[object Array]"]=cloneableTags["[object ArrayBuffer]"]=cloneableTags["[object DataView]"]=cloneableTags["[object Boolean]"]=cloneableTags["[object Date]"]=cloneableTags["[object Float32Array]"]=cloneableTags["[object Float64Array]"]=cloneableTags["[object Int8Array]"]=cloneableTags["[object Int16Array]"]=cloneableTags["[object Int32Array]"]=cloneableTags["[object Map]"]=cloneableTags["[object Number]"]=cloneableTags["[object Object]"]=cloneableTags["[object RegExp]"]=cloneableTags["[object Set]"]=cloneableTags["[object String]"]=cloneableTags["[object Symbol]"]=cloneableTags["[object Uint8Array]"]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags["[object Uint16Array]"]=cloneableTags["[object Uint32Array]"]=!0,cloneableTags["[object Error]"]=cloneableTags["[object Function]"]=cloneableTags["[object WeakMap]"]=!1;function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(key=othIndex,!seen.has(key)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex);var key})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set2){var index=-1,result=Array(set2.size);return set2.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$2=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty$1=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array$1(object),new Uint8Array$1(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty$1.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty$1.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$2.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasIn(object,path){return null!=object&&function(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}(object,path,baseHasIn)}function fromPairs(pairs){for(var index=-1,length=null==pairs?0:pairs.length,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result}function parent(object,path){return path.length<2?object:baseGet(object,function(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}(path,0,-1))}function isEqual(value,other){return baseIsEqual(value,other)}function isNil(value){return null==value}var hasOwnProperty=Object.prototype.hasOwnProperty;function baseUnset(object,path){var index=-1,length=(path=castPath(path,object)).length;if(!length)return!0;for(var isRootPrimitive=null==object||"object"!=typeof object&&"function"!=typeof object;++index<length;){var key=path[index];if("string"==typeof key){if("__proto__"===key&&!hasOwnProperty.call(object,"__proto__"))return!1;if("constructor"===key&&index+1<length&&"string"==typeof path[index+1]&&"prototype"===path[index+1]){if(isRootPrimitive&&0===index)continue;return!1}}}var obj=parent(object,path);return null==obj||delete obj[toKey(function(array){var length=null==array?0:array.length;return length?array[length-1]:void 0}(path))]}function customOmitClone(value){return isPlainObject(value)?void 0:value}var omit=flatRest(function(object,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,7,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result});function baseSet(object,path,value,customizer){if(!isObject$1(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if("__proto__"===key||"constructor"===key||"prototype"===key)return object;if(index!=lastIndex){var objValue=nested[key];void 0===(newValue=void 0)&&(newValue=isObject$1(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}function basePick(object,paths){return function(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}(object,paths,function(value,path){return hasIn(object,path)})}var pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)});const isUndefined=val=>void 0===val,isBoolean=val=>"boolean"==typeof val,isNumber=val=>"number"==typeof val,isElement=e=>"undefined"!=typeof Element&&e instanceof Element,isPropAbsent=prop=>isNil(prop),keysOf=arr=>Object.keys(arr),epPropKey="__epPropKey",buildProp=(prop,key)=>{if(!isObject$2(prop)||isObject$2(val=prop)&&val.__epPropKey)return prop;var val;const{values:values,required:required,default:defaultValue,type:type,validator:validator}=prop,epProp={type:type,required:!!required,validator:values||validator?val=>{let valid=!1,allowedValues=[];if(values&&(allowedValues=Array.from(values),hasOwn(prop,"default")&&allowedValues.push(defaultValue),valid||=allowedValues.includes(val)),validator&&(valid||=validator(val)),!valid&&allowedValues.length>0){const allowValuesText=[...new Set(allowedValues)].map(value=>JSON.stringify(value)).join(", ");warn(`Invalid prop: validation failed${key?` for prop "${key}"`:""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`)}return valid}:void 0,[epPropKey]:!0};return hasOwn(prop,"default")&&(epProp.default=defaultValue),epProp},buildProps=props=>fromPairs(Object.entries(props).map(([key,option])=>[key,buildProp(option,key)])),teleportProps=buildProps({to:{type:[String,Object],required:!0},disabled:Boolean});var ElementPlusError=class extends Error{constructor(m){super(m),this.name="ElementPlusError"}};function debugWarn(scope,message2){{const error=isString(scope)?new ElementPlusError(`[${scope}] ${message2}`):scope;console.warn(error)}}const DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/;function computedEager(fn2,options){const result=shallowRef();return watchEffect(()=>{result.value=fn2()},{...options,flush:null!=void 0?void 0:"sync"}),readonly(result)}function tryOnScopeDispose(fn2){return!!getCurrentScope()&&(onScopeDispose(fn2),!0)}function toValue(r){return"function"==typeof r?r():unref(r)}const isClient="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const toString=Object.prototype.toString,noop=()=>{},isIOS=/* @__PURE__ */getIsIOS();function getIsIOS(){var _a,_b;return isClient&&(null==(_a=null==window?void 0:window.navigator)?void 0:_a.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(null==(_b=null==window?void 0:window.navigator)?void 0:_b.maxTouchPoints)>2&&/iPad|Macintosh/.test(null==window?void 0:window.navigator.userAgent))}const defaultWindow=isClient?window:void 0;isClient&&window.document;function unrefElement(elRef){var _a;const plain=toValue(elRef);return null!=(_a=null==plain?void 0:plain.$el)?_a:plain}function useEventListener(...args){let target,events,listeners,options;if("string"==typeof args[0]||Array.isArray(args[0])?([events,listeners,options]=args,target=defaultWindow):[target,events,listeners,options]=args,!target)return noop;Array.isArray(events)||(events=[events]),Array.isArray(listeners)||(listeners=[listeners]);const cleanups=[],cleanup=()=>{cleanups.forEach(fn2=>fn2()),cleanups.length=0},stopWatch=watch(()=>[unrefElement(target),toValue(options)],([el,options2])=>{if(cleanup(),!el)return;const optionsClone=(val=options2,"[object Object]"===toString.call(val)?{...options2}:options2);var val;cleanups.push(...events.flatMap(event=>listeners.map(listener=>((el,event,listener,options2)=>(el.addEventListener(event,listener,options2),()=>el.removeEventListener(event,listener,options2)))(el,event,listener,optionsClone))))},{immediate:!0,flush:"post"}),stop=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(stop),stop}let _iOSWorkaround=!1;function onClickOutside(target,handler,options={}){const{window:window2=defaultWindow,ignore:ignore=[],capture:capture=!0,detectIframe:detectIframe=!1}=options;if(!window2)return noop;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(window2.document.body.children).forEach(el=>el.addEventListener("click",noop)),window2.document.documentElement.addEventListener("click",noop));let shouldListen=!0;const shouldIgnore=event=>toValue(ignore).some(target2=>{if("string"==typeof target2)return Array.from(window2.document.querySelectorAll(target2)).some(el=>el===event.target||event.composedPath().includes(el));{const el=unrefElement(target2);return el&&(event.target===el||event.composedPath().includes(el))}});const listener=event=>{const el=unrefElement(target);null!=event.target&&(el instanceof Element||!function(target2){const vm=toValue(target2);return vm&&16===vm.$.subTree.shapeFlag}(target)||!function(target2,event){const vm=toValue(target2),children=vm.$.subTree&&vm.$.subTree.children;return!(null==children||!Array.isArray(children))&&children.some(child=>child.el===event.target||event.composedPath().includes(child.el))}(target,event))&&el&&el!==event.target&&!event.composedPath().includes(el)&&(0===event.detail&&(shouldListen=!shouldIgnore(event)),shouldListen?handler(event):shouldListen=!0)};let isProcessingClick=!1;const cleanup=[useEventListener(window2,"click",event=>{isProcessingClick||(isProcessingClick=!0,setTimeout(()=>{isProcessingClick=!1},0),listener(event))},{passive:!0,capture:capture}),useEventListener(window2,"pointerdown",e=>{const el=unrefElement(target);shouldListen=!shouldIgnore(e)&&!(!el||e.composedPath().includes(el))},{passive:!0}),detectIframe&&useEventListener(window2,"blur",event=>{setTimeout(()=>{var _a;const el=unrefElement(target);"IFRAME"!==(null==(_a=window2.document.activeElement)?void 0:_a.tagName)||(null==el?void 0:el.contains(window2.document.activeElement))||handler(event)},0)})].filter(Boolean);return()=>cleanup.forEach(fn2=>fn2())}function useSupported(callback){const isMounted=function(){const isMounted=ref(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}();return computed(()=>(isMounted.value,Boolean(callback())))}function useResizeObserver(target,callback,options={}){const{window:window2=defaultWindow,...observerOptions}=options;let observer;const isSupported=useSupported(()=>window2&&"ResizeObserver"in window2),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{const _targets=toValue(target);return Array.isArray(_targets)?_targets.map(el=>unrefElement(el)):[unrefElement(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window2){observer=new ResizeObserver(callback);for(const _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:"post"}),stop=()=>{cleanup(),stopWatch()};return tryOnScopeDispose(stop),{isSupported:isSupported,stop:stop}}const useDeprecated=({from:from,replacement:replacement,scope:scope,version:version,ref:ref2,type:type="API"},condition)=>{watch(()=>unref(condition),val=>{val&&debugWarn(scope,`[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.\nFor more detail, please visit: ${ref2}\n`)},{immediate:!0})},isHTMLElement=e=>"undefined"!=typeof Element&&e instanceof Element,isFocusable=element=>{if(element.tabIndex>0||0===element.tabIndex&&null!==element.getAttribute("tabIndex"))return!0;if(element.tabIndex<0||element.hasAttribute("disabled")||"true"===element.getAttribute("aria-disabled"))return!1;switch(element.nodeName){case"A":return!!element.href&&"ignore"!==element.rel;case"INPUT":return!("hidden"===element.type||"file"===element.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},focusElement=(el,options)=>{if(!el||!el.focus)return;let cleanup=!1;!isHTMLElement(el)||isFocusable(el)||el.getAttribute("tabindex")||(el.setAttribute("tabindex","-1"),cleanup=!0),el.focus(options),isHTMLElement(el)&&cleanup&&el.removeAttribute("tabindex")},isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);function addUnit(value,defaultUnit="px"){return value||0===value?isNumber(value)||isString(val=value)&&!Number.isNaN(Number(val))?`${value}${defaultUnit}`:isString(value)?value:void debugWarn("utils/dom/style","binding value must be a string or number"):"";var val}var en_default={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value",alphaDescription:"alpha {alpha}, current color is {color}",hueLabel:"pick hue value",hueDescription:"hue {hue}, current color is {color}",svLabel:"pick saturation and brightness value",svDescription:"saturation {saturation}, brightness {brightness}, current color is {color}",predefineDescription:"select {value} as the color"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum",selectAllLabel:"Select all rows",selectRowLabel:"Select this row",expandRowLabel:"Expand this row",collapseRowLabel:"Collapse this row",sortLabel:"Sort by {column}",filterLabel:"Filter by {column}"},tag:{close:"Close this tag"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const buildTranslator=locale=>(path,option)=>translate(path,option,unref(locale)),translate=(path,option,locale)=>get(locale,path,path).replace(/\{(\w+)\}/g,(_,key)=>`${option?.[key]??`{${key}}`}`),localeContextKey=/* @__PURE__ */Symbol("localeContextKey"),useLocale=localeOverrides=>{const locale=localeOverrides||inject(localeContextKey,ref());return(locale=>({lang:computed(()=>unref(locale).name),locale:isRef(locale)?locale:ref(locale),t:buildTranslator(locale)}))(computed(()=>locale.value||en_default))},_bem=(namespace,block,blockSuffix,element,modifier)=>{let cls=`${namespace}-${block}`;return blockSuffix&&(cls+=`-${blockSuffix}`),element&&(cls+=`__${element}`),modifier&&(cls+=`--${modifier}`),cls},namespaceContextKey=/* @__PURE__ */Symbol("namespaceContextKey"),useGetDerivedNamespace=namespaceOverrides=>{const derivedNamespace=namespaceOverrides||(getCurrentInstance()?inject(namespaceContextKey,ref("el")):ref("el"));return computed(()=>unref(derivedNamespace)||"el")},useNamespace=(block,namespaceOverrides)=>{const namespace=useGetDerivedNamespace(namespaceOverrides);return{namespace:namespace,b:(blockSuffix="")=>_bem(namespace.value,block,blockSuffix,"",""),e:element=>element?_bem(namespace.value,block,"",element,""):"",m:modifier=>modifier?_bem(namespace.value,block,"","",modifier):"",be:(blockSuffix,element)=>blockSuffix&&element?_bem(namespace.value,block,blockSuffix,element,""):"",em:(element,modifier)=>element&&modifier?_bem(namespace.value,block,"",element,modifier):"",bm:(blockSuffix,modifier)=>blockSuffix&&modifier?_bem(namespace.value,block,blockSuffix,"",modifier):"",bem:(blockSuffix,element,modifier)=>blockSuffix&&element&&modifier?_bem(namespace.value,block,blockSuffix,element,modifier):"",is:(name,...args)=>{const state=!(args.length>=1)||args[0];return name&&state?`is-${name}`:""},cssVar:object=>{const styles={};for(const key in object)object[key]&&(styles[`--${namespace.value}-${key}`]=object[key]);return styles},cssVarName:name=>`--${namespace.value}-${name}`,cssVarBlock:object=>{const styles={};for(const key in object)object[key]&&(styles[`--${namespace.value}-${block}-${key}`]=object[key]);return styles},cssVarBlockName:name=>`--${namespace.value}-${block}-${name}`}},composeEventHandlers=(theirsHandler,oursHandler,{checkForDefaultPrevented:checkForDefaultPrevented=!0}={})=>event=>{const shouldPrevent=theirsHandler?.(event);if(!1===checkForDefaultPrevented||!shouldPrevent)return oursHandler?.(event)},whenMouse=handler=>e=>"mouse"===e.pointerType?handler(e):void 0,getEventCode=event=>{if(event.code&&"Unidentified"!==event.code)return event.code;const key=getEventKey(event);return key?Object.values(EVENT_CODE).includes(key)?key:" "===key?EVENT_CODE.space:"":""},getEventKey=event=>{let key=event.key&&"Unidentified"!==event.key?event.key:"";if(!key&&"keyup"===event.type&&isClient&&/android/i.test(window.navigator.userAgent)){const target=event.target;key=target.value.charAt(target.selectionStart-1)}return key},_prop=buildProp({type:Boolean,default:null}),_event=buildProp({type:Function}),useProp=name=>{const vm=getCurrentInstance();return computed(()=>vm?.proxy?.$props?.[name])};var L="top",W="bottom",T="right",P="left",me="auto",Q=[L,W,T,P],Y="start",Z="end",je="viewport",ee="popper",De=Q.reduce(function(e,t){return e.concat([t+"-"+Y,t+"-"+Z])},[]),Ee=[].concat(Q,[me]).reduce(function(e,t){return e.concat([t,t+"-"+Y,t+"-"+Z])},[]),it=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function V(e){return e?(e.nodeName||"").toLowerCase():null}function B(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function G(e){return e instanceof B(e).Element||e instanceof Element}function R(e){return e instanceof B(e).HTMLElement||e instanceof HTMLElement}function Ae(e){return"undefined"!=typeof ShadowRoot&&(e instanceof B(e).ShadowRoot||e instanceof ShadowRoot)}var ke={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},a=t.elements[n];!R(a)||!V(a)||(Object.assign(a.style,r),Object.keys(o).forEach(function(c){var s=o[c];!1===s?a.removeAttribute(c):a.setAttribute(c,!0===s?"":s)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],a=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]).reduce(function(i,f){return i[f]="",i},{});!R(o)||!V(o)||(Object.assign(o.style,s),Object.keys(a).forEach(function(i){o.removeAttribute(i)}))})}},requires:["computeStyles"]};function C(e){return e.split("-")[0]}var J=Math.max,ve=Math.min,te=Math.round;function Le(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function at(){return!/^((?!chrome|android).)*safari/i.test(Le())}function ne(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&R(e)&&(o=e.offsetWidth>0&&te(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&te(r.height)/e.offsetHeight||1);var s=(G(e)?B(e):window).visualViewport,i=!at()&&n,f=(r.left+(i&&s?s.offsetLeft:0))/o,u=(r.top+(i&&s?s.offsetTop:0))/a,m=r.width/o,h2=r.height/a;return{width:m,height:h2,top:u,right:f+m,bottom:u+h2,left:f,x:f,y:u}}function Pe(e){var t=ne(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function st(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return B(e).getComputedStyle(e)}function Rt(e){return["table","td","th"].indexOf(V(e))>=0}function N(e){return((G(e)?e.ownerDocument:e.document)||window.document).documentElement}function ye(e){return"html"===V(e)?e:e.assignedSlot||e.parentNode||(Ae(e)?e.host:null)||N(e)}function ft(e){return R(e)&&"fixed"!==I(e).position?e.offsetParent:null}function se(e){for(var t=B(e),n=ft(e);n&&Rt(n)&&"static"===I(n).position;)n=ft(n);return n&&("html"===V(n)||"body"===V(n)&&"static"===I(n).position)?t:n||function(e){var t=/firefox/i.test(Le());if(/Trident/i.test(Le())&&R(e)&&"fixed"===I(e).position)return null;var o=ye(e);for(Ae(o)&&(o=o.host);R(o)&&["html","body"].indexOf(V(o))<0;){var a=I(o);if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||t&&"filter"===a.willChange||t&&a.filter&&"none"!==a.filter)return o;o=o.parentNode}return null}(e)||t}function Me(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function fe(e,t,n){return J(e,ve(t,n))}function ut(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pt(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var lt={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,c=n.modifiersData.popperOffsets,s=C(n.placement),i=Me(s),u=[P,T].indexOf(s)>=0?"height":"width";if(a&&c){var m=function(e,t){return ut("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pt(e,Q))}(o.padding,n),h2=Pe(a),l="y"===i?L:P,g="y"===i?W:T,p=n.rects.reference[u]+n.rects.reference[i]-c[i]-n.rects.popper[u],y=c[i]-n.rects.reference[i],b=se(a),x=b?"y"===i?b.clientHeight||0:b.clientWidth||0:0,O=p/2-y/2,d=m[l],v=x-h2[u]-m[g],w=x/2-h2[u]/2+O,$=fe(d,w,v),j=i;n.modifiersData[r]=((t={})[j]=$,t.centerOffset=$-w,t)}},effect:function(e){var t=e.state,r=e.options.element,o=void 0===r?"[data-popper-arrow]":r;null!=o&&("string"==typeof o&&!(o=t.elements.popper.querySelector(o))||st(t.elements.popper,o)&&(t.elements.arrow=o))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function re(e){return e.split("-")[1]}var It={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,m=e.isFixed,h2=c.x,l=void 0===h2?0:h2,g=c.y,p=void 0===g?0:g,y="function"==typeof u?u({x:l,y:p}):{x:l,y:p};l=y.x,p=y.y;var b=c.hasOwnProperty("x"),x=c.hasOwnProperty("y"),O=P,d=L,v=window;if(f){var w=se(n),$="clientHeight",j="clientWidth";if(w===B(n)&&("static"!==I(w=N(n)).position&&"absolute"===s&&($="scrollHeight",j="scrollWidth")),o===L||(o===P||o===T)&&a===Z)d=W,p-=(m&&w===v&&v.visualViewport?v.visualViewport.height:w[$])-r.height,p*=i?1:-1;if(o===P||(o===L||o===W)&&a===Z)O=T,l-=(m&&w===v&&v.visualViewport?v.visualViewport.width:w[j])-r.width,l*=i?1:-1}var k,A=Object.assign({position:s},f&&It),H=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:te(n*o)/o||0,y:te(r*o)/o||0}}({x:l,y:p},B(n)):{x:l,y:p};return l=H.x,p=H.y,i?Object.assign({},A,((k={})[d]=x?"0":"",k[O]=b?"0":"",k.transform=(v.devicePixelRatio||1)<=1?"translate("+l+"px, "+p+"px)":"translate3d("+l+"px, "+p+"px, 0)",k)):Object.assign({},A,((t={})[d]=x?p+"px":"",t[O]=b?l+"px":"",t.transform="",t))}var We={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,a=n.adaptive,c=void 0===a||a,s=n.roundOffsets,i=void 0===s||s,f={placement:C(t.placement),variation:re(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,dt(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,dt(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ge={passive:!0};var Te={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=void 0===o||o,c=r.resize,s=void 0===c||c,i=B(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(u){u.addEventListener("scroll",n.update,ge)}),s&&i.addEventListener("resize",n.update,ge),function(){a&&f.forEach(function(u){u.removeEventListener("scroll",n.update,ge)}),s&&i.removeEventListener("resize",n.update,ge)}},data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(e){return e.replace(/left|right|bottom|top/g,function(t){return _t[t]})}var zt={start:"end",end:"start"};function ht(e){return e.replace(/start|end/g,function(t){return zt[t]})}function Be(e){var t=B(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Re(e){return ne(N(e)).left+Be(e).scrollLeft}function He(e){var t=I(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function mt(e){return["html","body","#document"].indexOf(V(e))>=0?e.ownerDocument.body:R(e)&&He(e)?e:mt(ye(e))}function ce(e,t){var n;void 0===t&&(t=[]);var r=mt(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=B(r),c=o?[a].concat(a.visualViewport||[],He(r)?r:[]):r,s=t.concat(c);return o?s:s.concat(ce(ye(c)))}function Se(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function vt(e,t,n){return t===je?Se(function(e,t){var n=B(e),r=N(e),o=n.visualViewport,a=r.clientWidth,c=r.clientHeight,s=0,i=0;if(o){a=o.width,c=o.height;var f=at();(f||!f&&"fixed"===t)&&(s=o.offsetLeft,i=o.offsetTop)}return{width:a,height:c,x:s+Re(e),y:i}}(e,n)):G(t)?function(e,t){var n=ne(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Se(function(e){var t,n=N(e),r=Be(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=J(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=J(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Re(e),i=-r.scrollTop;return"rtl"===I(o||n).direction&&(s+=J(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}(N(e)))}function Kt(e,t,n,r){var o="clippingParents"===t?function(e){var t=ce(ye(e)),r=["absolute","fixed"].indexOf(I(e).position)>=0&&R(e)?se(e):e;return G(r)?t.filter(function(o){return G(o)&&st(o,r)&&"body"!==V(o)}):[]}(e):[].concat(t),a=[].concat(o,[n]),c=a[0],s=a.reduce(function(i,f){var u=vt(e,f,r);return i.top=J(u.top,i.top),i.right=ve(u.right,i.right),i.bottom=ve(u.bottom,i.bottom),i.left=J(u.left,i.left),i},vt(e,c,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function yt(e){var i,t=e.reference,n=e.element,r=e.placement,o=r?C(r):null,a=r?re(r):null,c=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2;switch(o){case L:i={x:c,y:t.y-n.height};break;case W:i={x:c,y:t.y+t.height};break;case T:i={x:t.x+t.width,y:s};break;case P:i={x:t.x-n.width,y:s};break;default:i={x:t.x,y:t.y}}var f=o?Me(o):null;if(null!=f){var u="y"===f?"height":"width";switch(a){case Y:i[f]=i[f]-(t[u]/2-n[u]/2);break;case Z:i[f]=i[f]+(t[u]/2-n[u]/2)}}return i}function oe(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,a=n.strategy,c=void 0===a?e.strategy:a,s=n.boundary,i=void 0===s?"clippingParents":s,f=n.rootBoundary,u=void 0===f?je:f,m=n.elementContext,h2=void 0===m?ee:m,l=n.altBoundary,g=void 0!==l&&l,p=n.padding,y=void 0===p?0:p,b=ut("number"!=typeof y?y:pt(y,Q)),x=h2===ee?"reference":ee,O=e.rects.popper,d=e.elements[g?x:h2],v=Kt(G(d)?d:d.contextElement||N(e.elements.popper),i,u,c),w=ne(e.elements.reference),$=yt({reference:w,element:O,placement:o}),j=Se(Object.assign({},O,$)),D=h2===ee?j:w,E={top:v.top-D.top+b.top,bottom:D.bottom-v.bottom+b.bottom,left:v.left-D.left+b.left,right:D.right-v.right+b.right},A=e.modifiersData.offset;if(h2===ee&&A){var H=A[o];Object.keys(E).forEach(function(k){var F=[T,W].indexOf(k)>=0?1:-1,U=[L,W].indexOf(k)>=0?"y":"x";E[k]+=H[U]*F})}return E}var gt={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,c=n.altAxis,s=void 0===c||c,i=n.fallbackPlacements,f=n.padding,u=n.boundary,m=n.rootBoundary,h2=n.altBoundary,l=n.flipVariations,g=void 0===l||l,p=n.allowedAutoPlacements,y=t.options.placement,b=C(y),O=i||(b===y||!g?[be(y)]:function(e){if(C(e)===me)return[];var t=be(e);return[ht(e),t,ht(t)]}(y)),d=[y].concat(O).reduce(function(z,q){return z.concat(C(q)===me?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,c=n.padding,s=n.flipVariations,i=n.allowedAutoPlacements,f=void 0===i?Ee:i,u=re(r),m=u?s?De:De.filter(function(g){return re(g)===u}):Q,h2=m.filter(function(g){return f.indexOf(g)>=0});0===h2.length&&(h2=m);var l=h2.reduce(function(g,p){return g[p]=oe(e,{placement:p,boundary:o,rootBoundary:a,padding:c})[C(p)],g},{});return Object.keys(l).sort(function(g,p){return l[g]-l[p]})}(t,{placement:q,boundary:u,rootBoundary:m,padding:f,flipVariations:g,allowedAutoPlacements:p}):q)},[]),v=t.rects.reference,w=t.rects.popper,$=/* @__PURE__ */new Map,j=!0,D=d[0],E=0;E<d.length;E++){var A=d[E],H=C(A),k=re(A)===Y,F=[L,W].indexOf(H)>=0,U=F?"width":"height",M=oe(t,{placement:A,boundary:u,rootBoundary:m,altBoundary:h2,padding:f}),S=F?k?T:P:k?W:L;v[U]>w[U]&&(S=be(S));var ue=be(S),_=[];if(a&&_.push(M[H]<=0),s&&_.push(M[S]<=0,M[ue]<=0),_.every(function(z){return z})){D=A,j=!1;break}$.set(A,_)}if(j)for(var xe=function(z){var q=d.find(function(de){var ae=$.get(de);if(ae)return ae.slice(0,z).every(function(K){return K})});if(q)return D=q,"break"},ie=g?3:1;ie>0;ie--){if("break"===xe(ie))break}t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function wt(e){return[L,T,W,P].some(function(t){return e[t]>=0})}var xt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,c=oe(t,{elementContext:"reference"}),s=oe(t,{altBoundary:!0}),i=bt(c,r),f=bt(s,o,a),u=wt(i),m=wt(f);t.modifiersData[n]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m})}};var Ot={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=void 0===o?[0,0]:o,c=Ee.reduce(function(u,m){return u[m]=function(e,t,n){var r=C(e),o=[P,L].indexOf(r)>=0?-1:1,a="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=a[0],s=a[1];return c=c||0,s=(s||0)*o,[P,T].indexOf(r)>=0?{x:s,y:c}:{x:c,y:s}}(m,t.rects,a),u},{}),s=c[t.placement],i=s.x,f=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=c}};var Ve={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=yt({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var $t={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=void 0===o||o,c=n.altAxis,s=void 0!==c&&c,i=n.boundary,f=n.rootBoundary,u=n.altBoundary,m=n.padding,h2=n.tether,l=void 0===h2||h2,g=n.tetherOffset,p=void 0===g?0:g,y=oe(t,{boundary:i,rootBoundary:f,padding:m,altBoundary:u}),b=C(t.placement),x=re(t.placement),O=!x,d=Me(b),v=function(e){return"x"===e?"y":"x"}(d),w=t.modifiersData.popperOffsets,$=t.rects.reference,j=t.rects.popper,D="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,E="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(w){if(a){var k,F="y"===d?L:P,U="y"===d?W:T,M="y"===d?"height":"width",S=w[d],ue=S+y[F],_=S-y[U],pe=l?-j[M]/2:0,xe=x===Y?$[M]:j[M],ie=x===Y?-j[M]:-$[M],le=t.elements.arrow,z=l&&le?Pe(le):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},de=q[F],ae=q[U],K=fe(0,$[M],z[M]),Et=O?$[M]/2-pe-K-de-E.mainAxis:xe-K-de-E.mainAxis,At=O?-$[M]/2+pe+K+ae+E.mainAxis:ie+K+ae+E.mainAxis,Oe=t.elements.arrow&&se(t.elements.arrow),kt=Oe?"y"===d?Oe.clientTop||0:Oe.clientLeft||0:0,Ce=null!=(k=null==A?void 0:A[d])?k:0,Pt=S+At-Ce,qe=fe(l?ve(ue,S+Et-Ce-kt):ue,S,l?J(_,Pt):_);w[d]=qe,H[d]=qe-S}if(s){var Ie,Mt="x"===d?L:P,Wt="x"===d?W:T,X=w[v],he="y"===v?"height":"width",Ne=X+y[Mt],Fe=X-y[Wt],$e=-1!==[L,P].indexOf(b),Ue=null!=(Ie=null==A?void 0:A[v])?Ie:0,_e=$e?Ne:X-$[he]-j[he]-Ue+E.altAxis,ze=$e?X+$[he]+j[he]-Ue-E.altAxis:Fe,Xe=l&&$e?function(e,t,n){var r=fe(e,t,n);return r>n?n:r}(_e,X,ze):fe(l?_e:Ne,X,l?ze:Fe);w[v]=Xe,H[v]=Xe-X}t.modifiersData[r]=H}},requiresIfExists:["offset"]};function pn(e,t,n){void 0===n&&(n=!1);var r=R(t),o=R(t)&&function(e){var t=e.getBoundingClientRect(),n=te(t.width)/e.offsetWidth||1,r=te(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=N(t),c=ne(e,o,n),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(r||!r&&!n)&&(("body"!==V(t)||He(a))&&(s=function(e){return e!==B(e)&&R(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):Be(e)}(t)),R(t)?((i=ne(t,!0)).x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=Re(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function ln(e){var t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Set,r=[];function o(a){n.add(a.name),[].concat(a.requires||[],a.requiresIfExists||[]).forEach(function(s){if(!n.has(s)){var i=t.get(s);i&&o(i)}}),r.push(a)}return e.forEach(function(a){t.set(a.name,a)}),e.forEach(function(a){n.has(a.name)||o(a)}),r}function hn(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var jt={placement:"bottom",modifiers:[],strategy:"absolute"};function Dt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&"function"==typeof r.getBoundingClientRect)})}function we(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,a=void 0===o?jt:o;return function(c,s,i){void 0===i&&(i=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},jt,a),modifiersData:{},elements:{reference:c,popper:s},attributes:{},styles:{}},u=[],m=!1,h2={state:f,setOptions:function(p){var y="function"==typeof p?p(f.options):p;g(),f.options=Object.assign({},a,f.options,y),f.scrollParents={reference:G(c)?ce(c):c.contextElement?ce(c.contextElement):[],popper:ce(s)};var b=function(e){var t=ln(e);return it.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}(function(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}([].concat(r,f.options.modifiers)));return f.orderedModifiers=b.filter(function(x){return x.enabled}),f.orderedModifiers.forEach(function(p){var y=p.name,b=p.options,x=void 0===b?{}:b,O=p.effect;if("function"==typeof O){var d=O({state:f,name:y,instance:h2,options:x}),v=function(){};u.push(d||v)}}),h2.update()},forceUpdate:function(){if(!m){var p=f.elements,y=p.reference,b=p.popper;if(Dt(y,b)){f.rects={reference:pn(y,se(b),"fixed"===f.options.strategy),popper:Pe(b)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(j){return f.modifiersData[j.name]=Object.assign({},j.data)});for(var x=0;x<f.orderedModifiers.length;x++)if(!0!==f.reset){var O=f.orderedModifiers[x],d=O.fn,v=O.options,w=void 0===v?{}:v,$=O.name;"function"==typeof d&&(f=d({state:f,options:w,name:$,instance:h2})||f)}else f.reset=!1,x=-1}}},update:hn(function(){return new Promise(function(p){h2.forceUpdate(),p(f)})}),destroy:function(){g(),m=!0}};if(!Dt(c,s))return h2;function g(){u.forEach(function(p){return p()}),u=[]}return h2.setOptions(i).then(function(p){!m&&i.onFirstUpdate&&i.onFirstUpdate(p)}),h2}}we(),we({defaultModifiers:[Te,Ve,We,ke]});var wn=we({defaultModifiers:[Te,Ve,We,ke,Ot,gt,$t,lt,xt]});const usePopper=(referenceElementRef,popperElementRef,opts={})=>{const stateUpdater={name:"updateState",enabled:!0,phase:"write",fn:({state:state})=>{const derivedState=function(state){const elements=Object.keys(state.elements);return{styles:fromPairs(elements.map(element=>[element,state.styles[element]||{}])),attributes:fromPairs(elements.map(element=>[element,state.attributes[element]]))}}(state);Object.assign(states.value,derivedState)},requires:["computeStyles"]},options=computed(()=>{const{onFirstUpdate:onFirstUpdate,placement:placement,strategy:strategy,modifiers:modifiers}=unref(opts);return{onFirstUpdate:onFirstUpdate,placement:placement||"bottom",strategy:strategy||"absolute",modifiers:[...modifiers||[],stateUpdater,{name:"applyStyles",enabled:!1}]}}),instanceRef=shallowRef(),states=ref({styles:{popper:{position:unref(options).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),destroy=()=>{instanceRef.value&&(instanceRef.value.destroy(),instanceRef.value=void 0)};return watch(options,newOptions=>{const instance=unref(instanceRef);instance&&instance.setOptions(newOptions)},{deep:!0}),watch([referenceElementRef,popperElementRef],([referenceElement,popperElement])=>{destroy(),referenceElement&&popperElement&&(instanceRef.value=wn(referenceElement,popperElement,unref(options)))}),onBeforeUnmount(()=>{destroy()}),{state:computed(()=>({...unref(instanceRef)?.state||{}})),styles:computed(()=>unref(states).styles),attributes:computed(()=>unref(states).attributes),update:()=>unref(instanceRef)?.update(),forceUpdate:()=>unref(instanceRef)?.forceUpdate(),instanceRef:computed(()=>unref(instanceRef))}};function useTimeout(){let timeoutHandle;const cancelTimeout=()=>window.clearTimeout(timeoutHandle);return tryOnScopeDispose(()=>cancelTimeout()),{registerTimeout:(fn2,delay)=>{cancelTimeout(),timeoutHandle=window.setTimeout(fn2,delay)},cancelTimeout:cancelTimeout}}const defaultIdInjection={prefix:Math.floor(1e4*Math.random()),current:0},ID_INJECTION_KEY=/* @__PURE__ */Symbol("elIdInjection"),useIdInjection=()=>getCurrentInstance()?inject(ID_INJECTION_KEY,defaultIdInjection):defaultIdInjection,useId=deterministicId=>{const idInjection=useIdInjection();isClient||idInjection!==defaultIdInjection||debugWarn("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const namespace=useGetDerivedNamespace();return computedEager(()=>unref(deterministicId)||`${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`)};let registeredEscapeHandlers=[];const cachedHandler=event=>{getEventCode(event)===EVENT_CODE.esc&®isteredEscapeHandlers.forEach(registeredHandler=>registeredHandler(event))},usePopperContainerId=()=>{const namespace=useGetDerivedNamespace(),idInjection=useIdInjection(),id=computed(()=>`${namespace.value}-popper-container-${idInjection.prefix}`);return{id:id,selector:computed(()=>`#${id.value}`)}},usePopperContainer=()=>{const{id:id,selector:selector}=usePopperContainerId();return onBeforeMount(()=>{isClient&&(document.body.querySelector(selector.value)||(id=>{const container=document.createElement("div");container.id=id,document.body.appendChild(container)})(id.value))}),{id:id,selector:selector}},useDelayedToggleProps=buildProps({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),FORWARD_REF_INJECTION_KEY=/* @__PURE__ */Symbol("elForwardRef"),initial={current:0},zIndex=ref(0),ZINDEX_INJECTION_KEY=/* @__PURE__ */Symbol("elZIndexContextKey"),zIndexContextKey=/* @__PURE__ */Symbol("zIndexContextKey"),useZIndex=zIndexOverrides=>{const increasingInjection=getCurrentInstance()?inject(ZINDEX_INJECTION_KEY,initial):initial,zIndexInjection=zIndexOverrides||(getCurrentInstance()?inject(zIndexContextKey,void 0):void 0),initialZIndex=computed(()=>{const zIndexFromInjection=unref(zIndexInjection);return isNumber(zIndexFromInjection)?zIndexFromInjection:2e3}),currentZIndex=computed(()=>initialZIndex.value+zIndex.value);return isClient||inject(ZINDEX_INJECTION_KEY)||debugWarn("ZIndexInjection","Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed\nusage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })"),{initialZIndex:initialZIndex,currentZIndex:currentZIndex,nextZIndex:()=>(increasingInjection.current++,zIndex.value=increasingInjection.current,currentZIndex.value)}};const useSizeProp=buildProp({type:String,values:["","default","small","large"],required:!1}),SIZE_INJECTION_KEY=/* @__PURE__ */Symbol("size");const emptyValuesContextKey=/* @__PURE__ */Symbol("emptyValuesContextKey"),useEmptyValuesProps=buildProps({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:val=>(val=isFunction$1(val)?val():val,isArray$1(val)?val.every(item=>!item):!val)}}),ariaProps=buildProps({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),useAriaProps=arias=>pick(ariaProps,arias),withPropsDefaultsSetter=target=>{const _p=target.props,props=isArray$1(_p)?fromPairs(_p.map(key=>[key,{}])):_p;target.setPropsDefaults=defaults=>{if(props){for(const[key,value]of Object.entries(defaults)){const prop=props[key];hasOwn(props,key)&&(isPlainObject(prop)?props[key]={...prop,default:value}:props[key]={type:prop,default:value})}target.props=props}}},withInstall=(main,extra)=>{if(main.install=app=>{for(const comp of[main,...Object.values(extra??{})])app.component(comp.name,comp)},extra)for(const[key,comp]of Object.entries(extra))main[key]=comp;return withPropsDefaultsSetter(main),main},withNoopInstall=component=>(component.install=NOOP,withPropsDefaultsSetter(component),component);const ElTeleport=withInstall(/* @__PURE__ */defineComponent({__name:"teleport",props:teleportProps,setup:__props=>(_ctx,_cache)=>_ctx.disabled?renderSlot(_ctx.$slots,"default",{key:0}):(openBlock(),createBlock(Teleport,{key:1,to:_ctx.to},[renderSlot(_ctx.$slots,"default")],8,["to"]))}));var arrow_down_default=/* @__PURE__ */defineComponent({name:"ArrowDown",__name:"arrow-down",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),circle_check_default=/* @__PURE__ */defineComponent({name:"CircleCheck",__name:"circle-check",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),circle_close_filled_default=/* @__PURE__ */defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),circle_close_default=/* @__PURE__ */defineComponent({name:"CircleClose",__name:"circle-close",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),close_default=/* @__PURE__ */defineComponent({name:"Close",__name:"close",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),hide_default=/* @__PURE__ */defineComponent({name:"Hide",__name:"hide",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),info_filled_default=/* @__PURE__ */defineComponent({name:"InfoFilled",__name:"info-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),loading_default=/* @__PURE__ */defineComponent({name:"Loading",__name:"loading",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),success_filled_default=/* @__PURE__ */defineComponent({name:"SuccessFilled",__name:"success-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),view_default=/* @__PURE__ */defineComponent({name:"View",__name:"view",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),warning_filled_default=/* @__PURE__ */defineComponent({name:"WarningFilled",__name:"warning-filled",setup:__props=>(_ctx,_cache)=>(openBlock(),createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))});const iconPropType=[String,Object,Function],TypeComponents={Close:close_default,SuccessFilled:success_filled_default,InfoFilled:info_filled_default,WarningFilled:warning_filled_default,CircleCloseFilled:circle_close_filled_default},TypeComponentsMap={primary:info_filled_default,success:success_filled_default,warning:warning_filled_default,error:circle_close_filled_default,info:info_filled_default},ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default};const ElIcon=withInstall(/* @__PURE__ */defineComponent({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:buildProps({size:{type:[Number,String]},color:{type:String}}),setup(__props){const props=__props,ns=useNamespace("icon"),style=computed(()=>{const{size:size,color:color}=props,fontSize=addUnit(size);return fontSize||color?{fontSize:fontSize,"--color":color}:{}});return(_ctx,_cache)=>(openBlock(),createElementBlock("i",mergeProps({class:unref(ns).b(),style:style.value},_ctx.$attrs),[renderSlot(_ctx.$slots,"default")],16))}})),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),POPPER_INJECTION_KEY=/* @__PURE__ */Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=/* @__PURE__ */Symbol("popperContent");var arrow_default=/* @__PURE__ */defineComponent({name:"ElPopperArrow",inheritAttrs:!1,__name:"arrow",setup(__props,{expose:__expose}){const ns=useNamespace("popper"),{arrowRef:arrowRef,arrowStyle:arrowStyle}=inject(POPPER_CONTENT_INJECTION_KEY,void 0);return onBeforeUnmount(()=>{arrowRef.value=void 0}),__expose({arrowRef:arrowRef}),(_ctx,_cache)=>(openBlock(),createElementBlock("span",{ref_key:"arrowRef",ref:arrowRef,class:normalizeClass(unref(ns).e("arrow")),style:normalizeStyle(unref(arrowStyle)),"data-popper-arrow":""},null,6))}});const popperTriggerProps=buildProps({virtualRef:{type:Object},virtualTriggering:Boolean,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onContextmenu:{type:Function},id:String,open:Boolean}),NAME="ElOnlyChild",OnlyChild=/* @__PURE__ */defineComponent({name:NAME,setup(_,{slots:slots,attrs:attrs}){const forwardRefDirective=(setForwardRef=inject(FORWARD_REF_INJECTION_KEY)?.setForwardRef??NOOP,{mounted(el){setForwardRef(el)},updated(el){setForwardRef(el)},unmounted(){setForwardRef(null)}});var setForwardRef;return()=>{const defaultSlot=slots.default?.(attrs);if(!defaultSlot)return null;const[firstLegitNode,length]=findFirstLegitChild(defaultSlot);return firstLegitNode?(length>1&&debugWarn(NAME,"requires exact only one valid child."),withDirectives(cloneVNode(firstLegitNode,attrs),[[forwardRefDirective]])):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(node){if(!node)return[null,0];const children=node,len=children.filter(c=>c.type!==Comment).length;for(const child of children){if(isObject$2(child))switch(child.type){case Comment:continue;case Text:case"svg":return[wrapTextContent(child),len];case Fragment:return findFirstLegitChild(child.children);default:return[child,len]}return[wrapTextContent(child),len]}return[null,0]}function wrapTextContent(s){const ns=useNamespace("only-child");return createVNode("span",{class:ns.e("content")},[s])}var trigger_default$1=/* @__PURE__ */defineComponent({name:"ElPopperTrigger",inheritAttrs:!1,__name:"trigger",props:popperTriggerProps,setup(__props,{expose:__expose}){const props=__props,{role:role,triggerRef:triggerRef}=inject(POPPER_INJECTION_KEY,void 0);var forwardRef;forwardRef=triggerRef,provide(FORWARD_REF_INJECTION_KEY,{setForwardRef:el=>{forwardRef.value=el}});const ariaControls=computed(()=>ariaHaspopup.value?props.id:void 0),ariaDescribedby=computed(()=>{if(role&&"tooltip"===role.value)return props.open&&props.id?props.id:void 0}),ariaHaspopup=computed(()=>{if(role&&"tooltip"!==role.value)return role.value}),ariaExpanded=computed(()=>ariaHaspopup.value?`${props.open}`:void 0);let virtualTriggerAriaStopWatch;const TRIGGER_ELE_EVENTS=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return onMounted(()=>{watch(()=>props.virtualRef,virtualEl=>{virtualEl&&(triggerRef.value=unrefElement(virtualEl))},{immediate:!0}),watch(triggerRef,(el,prevEl)=>{virtualTriggerAriaStopWatch?.(),virtualTriggerAriaStopWatch=void 0,isElement(prevEl)&&TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&prevEl.removeEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),isElement(el)&&(TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&el.addEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),isFocusable(el)&&(virtualTriggerAriaStopWatch=watch([ariaControls,ariaDescribedby,ariaHaspopup,ariaExpanded],watches=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((key,idx)=>{isNil(watches[idx])?el.removeAttribute(key):el.setAttribute(key,watches[idx])})},{immediate:!0}))),isElement(prevEl)&&isFocusable(prevEl)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(key=>prevEl.removeAttribute(key))},{immediate:!0})}),onBeforeUnmount(()=>{if(virtualTriggerAriaStopWatch?.(),virtualTriggerAriaStopWatch=void 0,triggerRef.value&&isElement(triggerRef.value)){const el=triggerRef.value;TRIGGER_ELE_EVENTS.forEach(eventName=>{const handler=props[eventName];handler&&el.removeEventListener(eventName.slice(2).toLowerCase(),handler,["onFocus","onBlur"].includes(eventName))}),triggerRef.value=void 0}}),__expose({triggerRef:triggerRef}),(_ctx,_cache)=>__props.virtualTriggering?createCommentVNode("v-if",!0):(openBlock(),createBlock(unref(OnlyChild),mergeProps({key:0},_ctx.$attrs,{"aria-controls":ariaControls.value,"aria-describedby":ariaDescribedby.value,"aria-expanded":ariaExpanded.value,"aria-haspopup":ariaHaspopup.value}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Array,default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:Object,default:()=>({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,...popperArrowProps,id:String,style:{type:[String,Array,Object]},className:{type:[String,Array,Object]},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:[String,Array,Object]},popperStyle:{type:[String,Array,Object]},referenceEl:{type:Object},triggerTargetEl:{type:Object},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...useAriaProps(["ariaLabel"]),loop:Boolean}),popperContentEmits={mouseenter:evt=>evt instanceof MouseEvent,mouseleave:evt=>evt instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},formContextKey=/* @__PURE__ */Symbol("formContextKey"),formItemContextKey=/* @__PURE__ */Symbol("formItemContextKey"),useFormSize=(fallback,ignore={})=>{const emptyRef=ref(void 0),size=ignore.prop?emptyRef:useProp("size"),globalConfig2=ignore.global?emptyRef:(()=>{const injectedSize=inject(SIZE_INJECTION_KEY,{});return computed(()=>unref(injectedSize.size)||"")})(),form=ignore.form?{size:void 0}:inject(formContextKey,void 0),formItem=ignore.formItem?{size:void 0}:inject(formItemContextKey,void 0);return computed(()=>size.value||unref(fallback)||formItem?.size||form?.size||globalConfig2.value||"")},useFormDisabled=fallback=>{const disabled=useProp("disabled"),form=inject(formContextKey,void 0);return computed(()=>disabled.value??unref(fallback)??form?.disabled??!1)},useFormItem=()=>({form:inject(formContextKey,void 0),formItem:inject(formItemContextKey,void 0)}),useFormItemInputId=(props,{formItemContext:formItemContext,disableIdGeneration:disableIdGeneration,disableIdManagement:disableIdManagement})=>{disableIdGeneration||(disableIdGeneration=ref(!1)),disableIdManagement||(disableIdManagement=ref(!1));const instance=getCurrentInstance(),inputId=ref();let idUnwatch;const isLabeledByFormItem=computed(()=>!!(!props.label&&!props.ariaLabel&&formItemContext&&formItemContext.inputIds&&formItemContext.inputIds?.length<=1));return onMounted(()=>{idUnwatch=watch([toRef(props,"id"),disableIdGeneration],([id,disableIdGeneration2])=>{const newId=id??(disableIdGeneration2?void 0:useId().value);newId!==inputId.value&&(formItemContext?.removeInputId&&!(()=>{let parent2=instance?.parent;for(;parent2;){if("ElFormItem"===parent2.type.name)return!1;if("ElLabelWrap"===parent2.type.name)return!0;parent2=parent2.parent}return!1})()&&(inputId.value&&formItemContext.removeInputId(inputId.value),disableIdManagement?.value||disableIdGeneration2||!newId||formItemContext.addInputId(newId)),inputId.value=newId)},{immediate:!0})}),onUnmounted(()=>{idUnwatch&&idUnwatch(),formItemContext?.removeInputId&&inputId.value&&formItemContext.removeInputId(inputId.value)}),{isLabeledByFormItem:isLabeledByFormItem,inputId:inputId}},FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},FOCUS_TRAP_INJECTION_KEY=/* @__PURE__ */Symbol("elFocusTrap"),focusReason=ref(),lastUserFocusTimestamp=ref(0),lastAutomatedFocusTimestamp=ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=element=>{const nodes=[],walker=document.createTreeWalker(element,NodeFilter.SHOW_ELEMENT,{acceptNode:node=>{const isHiddenInput="INPUT"===node.tagName&&"hidden"===node.type;return node.disabled||node.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node.tabIndex>=0||node===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes},getVisibleElement=(elements,container)=>{for(const element of elements)if(!isHidden(element,container))return element},isHidden=(element,container)=>{if("hidden"===getComputedStyle(element).visibility)return!0;for(;element;){if(container&&element===container)return!1;if("none"===getComputedStyle(element).display)return!0;element=element.parentElement}return!1},tryFocus=(element,shouldSelect)=>{if(element){const prevFocusedElement=document.activeElement;focusElement(element,{preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),element!==prevFocusedElement&&(element=>element instanceof HTMLInputElement&&"select"in element)(element)&&shouldSelect&&element.select()}};function removeFromStack(list,item){const copy=[...list],idx=list.indexOf(item);return-1!==idx&©.splice(idx,1),copy}const focusableStack=(()=>{let stack=[];return{push:layer=>{const currentLayer=stack[0];currentLayer&&layer!==currentLayer&¤tLayer.pause(),stack=removeFromStack(stack,layer),stack.unshift(layer)},remove:layer=>{stack=removeFromStack(stack,layer),stack[0]?.resume?.()}}})(),notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},createFocusOutPreventedEvent=detail=>new CustomEvent("focus-trap.focusout-prevented",{...FOCUSOUT_PREVENTED_OPTS,detail:detail});var _plugin_vue_export_helper_default=(sfc,props)=>{const target=sfc.__vccOpts||sfc;for(const[key,val]of props)target[key]=val;return target};var focus_trap_default$1=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:["focusAfterTrapped","focusAfterReleased","focusin","focusout","focusout-prevented","release-requested"],setup(props,{emit:emit}){const forwardRef=ref();let lastFocusBeforeTrapped,lastFocusAfterTrapped;const{focusReason:focusReason2}=(onMounted(()=>{0===focusReasonUserCount&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason:focusReason,lastUserFocusTimestamp:lastUserFocusTimestamp,lastAutomatedFocusTimestamp:lastAutomatedFocusTimestamp});var handler;handler=event=>{props.trapped&&!focusLayer.paused&&emit("release-requested",event)},onMounted(()=>{0===registeredEscapeHandlers.length&&document.addEventListener("keydown",cachedHandler),isClient&®isteredEscapeHandlers.push(handler)}),onBeforeUnmount(()=>{registeredEscapeHandlers=registeredEscapeHandlers.filter(registeredHandler=>registeredHandler!==handler),0===registeredEscapeHandlers.length&&isClient&&document.removeEventListener("keydown",cachedHandler)});const focusLayer={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},onKeydown=e=>{if(!props.loop&&!props.trapped)return;if(focusLayer.paused)return;const{altKey:altKey,ctrlKey:ctrlKey,metaKey:metaKey,currentTarget:currentTarget,shiftKey:shiftKey}=e,{loop:loop}=props,isTabbing=getEventCode(e)===EVENT_CODE.tab&&!altKey&&!ctrlKey&&!metaKey,currentFocusingEl=document.activeElement;if(isTabbing&¤tFocusingEl){const container=currentTarget,[first,last2]=(container=>{const focusable=obtainAllFocusableElements(container);return[getVisibleElement(focusable,container),getVisibleElement(focusable.reverse(),container)]})(container);if(first&&last2)if(shiftKey||currentFocusingEl!==last2){if(shiftKey&&[first,container].includes(currentFocusingEl)){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||(e.preventDefault(),loop&&tryFocus(last2,!0))}}else{const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||(e.preventDefault(),loop&&tryFocus(first,!0))}else if(currentFocusingEl===container){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||e.preventDefault()}}};provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:forwardRef,onKeydown:onKeydown}),watch(()=>props.focusTrapEl,focusTrapEl=>{focusTrapEl&&(forwardRef.value=focusTrapEl)},{immediate:!0}),watch([forwardRef],([forwardRef2],[oldForwardRef])=>{forwardRef2&&(forwardRef2.addEventListener("keydown",onKeydown),forwardRef2.addEventListener("focusin",onFocusIn),forwardRef2.addEventListener("focusout",onFocusOut)),oldForwardRef&&(oldForwardRef.removeEventListener("keydown",onKeydown),oldForwardRef.removeEventListener("focusin",onFocusIn),oldForwardRef.removeEventListener("focusout",onFocusOut))});const trapOnFocus=e=>{emit("focusAfterTrapped",e)},releaseOnFocus=e=>emit("focusAfterReleased",e),onFocusIn=e=>{const trapContainer=unref(forwardRef);if(!trapContainer)return;const target=e.target,relatedTarget=e.relatedTarget,isFocusedInTrap=target&&trapContainer.contains(target);props.trapped||relatedTarget&&trapContainer.contains(relatedTarget)||(lastFocusBeforeTrapped=relatedTarget),isFocusedInTrap&&emit("focusin",e),focusLayer.paused||props.trapped&&(isFocusedInTrap?lastFocusAfterTrapped=target:tryFocus(lastFocusAfterTrapped,!0))},onFocusOut=e=>{const trapContainer=unref(forwardRef);if(!focusLayer.paused&&trapContainer)if(props.trapped){const relatedTarget=e.relatedTarget;isNil(relatedTarget)||trapContainer.contains(relatedTarget)||setTimeout(()=>{if(!focusLayer.paused&&props.trapped){const focusoutPreventedEvent=createFocusOutPreventedEvent({focusReason:focusReason2.value});emit("focusout-prevented",focusoutPreventedEvent),focusoutPreventedEvent.defaultPrevented||tryFocus(lastFocusAfterTrapped,!0)}},0)}else{const target=e.target;target&&trapContainer.contains(target)||emit("focusout",e)}};async function startTrap(){await nextTick();const trapContainer=unref(forwardRef);if(trapContainer){focusableStack.push(focusLayer);const prevFocusedElement=trapContainer.contains(document.activeElement)?lastFocusBeforeTrapped:document.activeElement;if(lastFocusBeforeTrapped=prevFocusedElement,!trapContainer.contains(prevFocusedElement)){const focusEvent=new Event("focus-trap.focus-after-trapped",FOCUS_AFTER_TRAPPED_OPTS);trapContainer.addEventListener("focus-trap.focus-after-trapped",trapOnFocus),trapContainer.dispatchEvent(focusEvent),focusEvent.defaultPrevented||nextTick(()=>{let focusStartEl=props.focusStartEl;isString(focusStartEl)||(tryFocus(focusStartEl),document.activeElement!==focusStartEl&&(focusStartEl="first")),"first"===focusStartEl&&((elements,shouldSelect=!1)=>{const prevFocusedElement=document.activeElement;for(const element of elements)if(tryFocus(element,shouldSelect),document.activeElement!==prevFocusedElement)return})(obtainAllFocusableElements(trapContainer),!0),document.activeElement!==prevFocusedElement&&"container"!==focusStartEl||tryFocus(trapContainer)})}}}function stopTrap(){const trapContainer=unref(forwardRef);if(trapContainer){trapContainer.removeEventListener("focus-trap.focus-after-trapped",trapOnFocus);const releasedEvent=new CustomEvent("focus-trap.focus-after-released",{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:focusReason2.value}});trapContainer.addEventListener("focus-trap.focus-after-released",releaseOnFocus),trapContainer.dispatchEvent(releasedEvent),releasedEvent.defaultPrevented||"keyboard"!=focusReason2.value&&lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value&&!trapContainer.contains(document.activeElement)||tryFocus(lastFocusBeforeTrapped??document.body),trapContainer.removeEventListener("focus-trap.focus-after-released",releaseOnFocus),focusableStack.remove(focusLayer),lastFocusBeforeTrapped=null,lastFocusAfterTrapped=null}}return onMounted(()=>{props.trapped&&startTrap(),watch(()=>props.trapped,trapped=>{trapped?startTrap():stopTrap()})}),onBeforeUnmount(()=>{props.trapped&&stopTrap(),forwardRef.value&&(forwardRef.value.removeEventListener("keydown",onKeydown),forwardRef.value.removeEventListener("focusin",onFocusIn),forwardRef.value.removeEventListener("focusout",onFocusOut),forwardRef.value=void 0),lastFocusBeforeTrapped=null,lastFocusAfterTrapped=null}),{onKeydown:onKeydown}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default",{handleKeydown:_ctx.onKeydown})}]]);const buildPopperOptions=(props,modifiers=[])=>{const{placement:placement,strategy:strategy,popperOptions:popperOptions}=props,options={placement:placement,strategy:strategy,...popperOptions,modifiers:[...genModifiers(props),...modifiers]};return function(options,modifiers){modifiers&&(options.modifiers=[...options.modifiers,...modifiers??[]])}(options,popperOptions?.modifiers),options};function genModifiers(options){const{offset:offset,gpuAcceleration:gpuAcceleration,fallbackPlacements:fallbackPlacements}=options;return[{name:"offset",options:{offset:[0,offset??12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:fallbackPlacements}},{name:"computeStyles",options:{gpuAcceleration:gpuAcceleration}}]}const usePopperContent=props=>{const{popperInstanceRef:popperInstanceRef,contentRef:contentRef,triggerRef:triggerRef,role:role}=inject(POPPER_INJECTION_KEY,void 0),arrowRef=ref(),arrowOffset=computed(()=>props.arrowOffset),eventListenerModifier=computed(()=>({name:"eventListeners",enabled:!!props.visible})),arrowModifier=computed(()=>{const arrowEl=unref(arrowRef),offset=unref(arrowOffset)??0;return{name:"arrow",enabled:(value=arrowEl,!(void 0===value)),options:{element:arrowEl,padding:offset}};var value}),options=computed(()=>({onFirstUpdate:()=>{update()},...buildPopperOptions(props,[unref(arrowModifier),unref(eventListenerModifier)])})),computedReference=computed(()=>($el=>{if(isClient)return unrefElement($el)})(props.referenceEl)||unref(triggerRef)),{attributes:attributes,state:state,styles:styles,update:update,forceUpdate:forceUpdate,instanceRef:instanceRef}=usePopper(computedReference,contentRef,options);return watch(instanceRef,instance=>popperInstanceRef.value=instance,{flush:"sync"}),onMounted(()=>{watch(()=>unref(computedReference)?.getBoundingClientRect?.(),()=>{update()})}),onBeforeUnmount(()=>{popperInstanceRef.value=void 0}),{attributes:attributes,arrowRef:arrowRef,contentRef:contentRef,instanceRef:instanceRef,state:state,styles:styles,role:role,forceUpdate:forceUpdate,update:update}};var content_default$1=/* @__PURE__ */defineComponent({name:"ElPopperContent",__name:"content",props:popperContentProps,emits:popperContentEmits,setup(__props,{expose:__expose,emit:__emit}){const emit=__emit,props=__props,{focusStartRef:focusStartRef,trapped:trapped,onFocusAfterReleased:onFocusAfterReleased,onFocusAfterTrapped:onFocusAfterTrapped,onFocusInTrap:onFocusInTrap,onFocusoutPrevented:onFocusoutPrevented,onReleaseRequested:onReleaseRequested}=((props,emit)=>{const trapped=ref(!1),focusStartRef=ref();return onBeforeUnmount(()=>{focusStartRef.value=void 0}),{focusStartRef:focusStartRef,trapped:trapped,onFocusAfterReleased:event=>{"pointer"!==event.detail?.focusReason&&(focusStartRef.value="first",emit("blur"))},onFocusAfterTrapped:()=>{emit("focus")},onFocusInTrap:event=>{props.visible&&!trapped.value&&(event.target&&(focusStartRef.value=event.target),trapped.value=!0)},onFocusoutPrevented:event=>{props.trapping||("pointer"===event.detail.focusReason&&event.preventDefault(),trapped.value=!1)},onReleaseRequested:()=>{trapped.value=!1,emit("close")}}})(props,emit),{attributes:attributes,arrowRef:arrowRef,contentRef:contentRef,styles:styles,instanceRef:instanceRef,role:role,update:update}=usePopperContent(props),{ariaModal:ariaModal,arrowStyle:arrowStyle,contentAttrs:contentAttrs,contentClass:contentClass,contentStyle:contentStyle,updateZIndex:updateZIndex}=((props,{attributes:attributes,styles:styles,role:role})=>{const{nextZIndex:nextZIndex}=useZIndex(),ns=useNamespace("popper"),contentAttrs=computed(()=>unref(attributes).popper),contentZIndex=ref(isNumber(props.zIndex)?props.zIndex:nextZIndex()),contentClass=computed(()=>[ns.b(),ns.is("pure",props.pure),ns.is(props.effect),props.popperClass]),contentStyle=computed(()=>[{zIndex:unref(contentZIndex)},unref(styles).popper,props.popperStyle||{}]);return{ariaModal:computed(()=>"dialog"===role.value?"false":void 0),arrowStyle:computed(()=>unref(styles).arrow||{}),contentAttrs:contentAttrs,contentClass:contentClass,contentStyle:contentStyle,contentZIndex:contentZIndex,updateZIndex:()=>{contentZIndex.value=isNumber(props.zIndex)?props.zIndex:nextZIndex()}}})(props,{styles:styles,attributes:attributes,role:role}),formItemContext=inject(formItemContextKey,void 0);let triggerTargetAriaStopWatch;provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:arrowStyle,arrowRef:arrowRef}),formItemContext&&provide(formItemContextKey,{...formItemContext,addInputId:NOOP,removeInputId:NOOP});const updatePopper=(shouldUpdateZIndex=!0)=>{update(),shouldUpdateZIndex&&updateZIndex()},togglePopperAlive=()=>{updatePopper(!1),props.visible&&props.focusOnShow?trapped.value=!0:!1===props.visible&&(trapped.value=!1)};return onMounted(()=>{watch(()=>props.triggerTargetEl,(triggerTargetEl,prevTriggerTargetEl)=>{triggerTargetAriaStopWatch?.(),triggerTargetAriaStopWatch=void 0;const el=unref(triggerTargetEl||contentRef.value),prevEl=unref(prevTriggerTargetEl||contentRef.value);isElement(el)&&(triggerTargetAriaStopWatch=watch([role,()=>props.ariaLabel,ariaModal,()=>props.id],watches=>{["role","aria-label","aria-modal","id"].forEach((key,idx)=>{isNil(watches[idx])?el.removeAttribute(key):el.setAttribute(key,watches[idx])})},{immediate:!0})),prevEl!==el&&isElement(prevEl)&&["role","aria-label","aria-modal","id"].forEach(key=>{prevEl.removeAttribute(key)})},{immediate:!0}),watch(()=>props.visible,togglePopperAlive,{immediate:!0})}),onBeforeUnmount(()=>{triggerTargetAriaStopWatch?.(),triggerTargetAriaStopWatch=void 0,contentRef.value=void 0}),__expose({popperContentRef:contentRef,popperInstanceRef:instanceRef,updatePopper:updatePopper,contentStyle:contentStyle}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",mergeProps({ref_key:"contentRef",ref:contentRef},unref(contentAttrs),{style:unref(contentStyle),class:unref(contentClass),tabindex:"-1",onMouseenter:_cache[0]||(_cache[0]=e=>_ctx.$emit("mouseenter",e)),onMouseleave:_cache[1]||(_cache[1]=e=>_ctx.$emit("mouseleave",e))}),[createVNode(unref(focus_trap_default$1),{loop:__props.loop,trapped:unref(trapped),"trap-on-focus-in":!0,"focus-trap-el":unref(contentRef),"focus-start-el":unref(focusStartRef),onFocusAfterTrapped:unref(onFocusAfterTrapped),onFocusAfterReleased:unref(onFocusAfterReleased),onFocusin:unref(onFocusInTrap),onFocusoutPrevented:unref(onFocusoutPrevented),onReleaseRequested:unref(onReleaseRequested)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["loop","trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});const ElPopper=withInstall(/* @__PURE__ */defineComponent({name:"ElPopper",inheritAttrs:!1,__name:"popper",props:popperProps,setup(__props,{expose:__expose}){const props=__props,popperProvides={triggerRef:ref(),popperInstanceRef:ref(),contentRef:ref(),referenceRef:ref(),role:computed(()=>props.role)};return __expose(popperProvides),provide(POPPER_INJECTION_KEY,popperProvides),(_ctx,_cache)=>renderSlot(_ctx.$slots,"default")}})),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:teleportProps.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Boolean,default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...useAriaProps(["ariaLabel"])}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:[String,Array],default:"hover"},triggerKeys:{type:Array,default:()=>[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space]},focusOnTarget:Boolean}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=(name=>{const updateEventKey=`update:${name}`,updateEventKeyRaw=`onUpdate:${name}`,useModelToggleEmits=[updateEventKey];return{useModelToggle:({indicator:indicator,toggleReason:toggleReason,shouldHideWhenRouteChanges:shouldHideWhenRouteChanges,shouldProceed:shouldProceed,onShow:onShow,onHide:onHide})=>{const instance=getCurrentInstance(),{emit:emit}=instance,props=instance.props,hasUpdateHandler=computed(()=>isFunction$1(props[updateEventKeyRaw])),isModelBindingAbsent=computed(()=>null===props[name]),doShow=event=>{!0!==indicator.value&&(indicator.value=!0,toggleReason&&(toggleReason.value=event),isFunction$1(onShow)&&onShow(event))},doHide=event=>{!1!==indicator.value&&(indicator.value=!1,toggleReason&&(toggleReason.value=event),isFunction$1(onHide)&&onHide(event))},show=event=>{if(!0===props.disabled||isFunction$1(shouldProceed)&&!shouldProceed())return;const shouldEmit=hasUpdateHandler.value&&isClient;shouldEmit&&emit(updateEventKey,!0),!isModelBindingAbsent.value&&shouldEmit||doShow(event)},hide=event=>{if(!0===props.disabled||!isClient)return;const shouldEmit=hasUpdateHandler.value&&isClient;shouldEmit&&emit(updateEventKey,!1),!isModelBindingAbsent.value&&shouldEmit||doHide(event)},onChange=val=>{isBoolean(val)&&(props.disabled&&val?hasUpdateHandler.value&&emit(updateEventKey,!1):indicator.value!==val&&(val?doShow():doHide()))};return watch(()=>props[name],onChange),shouldHideWhenRouteChanges&&void 0!==instance.appContext.config.globalProperties.$route&&watch(()=>({...instance.proxy.$route}),()=>{shouldHideWhenRouteChanges.value&&indicator.value&&hide()}),onMounted(()=>{onChange(props[name])}),{hide:hide,show:show,toggle:()=>{indicator.value?hide():show()},hasUpdateHandler:hasUpdateHandler}},useModelToggleProps:{[name]:_prop,[updateEventKeyRaw]:_event},useModelToggleEmits:useModelToggleEmits}})("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],TOOLTIP_INJECTION_KEY=/* @__PURE__ */Symbol("elTooltip"),isTriggerType=(trigger,type)=>isArray$1(trigger)?trigger.includes(type):trigger===type,whenTrigger=(trigger,type,handler)=>e=>{isTriggerType(unref(trigger),type)&&handler(e)};var trigger_default=/* @__PURE__ */defineComponent({name:"ElTooltipTrigger",__name:"trigger",props:useTooltipTriggerProps,setup(__props,{expose:__expose}){const props=__props,ns=useNamespace("tooltip"),{controlled:controlled,id:id,open:open,onOpen:onOpen,onClose:onClose,onToggle:onToggle}=inject(TOOLTIP_INJECTION_KEY,void 0),triggerRef=ref(null),stopWhenControlledOrDisabled=()=>{if(unref(controlled)||props.disabled)return!0},trigger=toRef(props,"trigger"),onMouseenter=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"hover",e=>{onOpen(e),props.focusOnTarget&&e.target&&nextTick(()=>{focusElement(e.target,{preventScroll:!0})})})),onMouseleave=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"hover",onClose)),onClick=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"click",e=>{0===e.button&&onToggle(e)})),onFocus=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"focus",onOpen)),onBlur=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"focus",onClose)),onContextMenu=composeEventHandlers(stopWhenControlledOrDisabled,whenTrigger(trigger,"contextmenu",e=>{e.preventDefault(),onToggle(e)})),onKeydown=composeEventHandlers(stopWhenControlledOrDisabled,e=>{const code=getEventCode(e);props.triggerKeys.includes(code)&&(e.preventDefault(),onToggle(e))});return __expose({triggerRef:triggerRef}),(_ctx,_cache)=>(openBlock(),createBlock(unref(trigger_default$1),{id:unref(id),"virtual-ref":__props.virtualRef,open:unref(open),"virtual-triggering":__props.virtualTriggering,class:normalizeClass(unref(ns).e("trigger")),onBlur:unref(onBlur),onClick:unref(onClick),onContextmenu:unref(onContextMenu),onFocus:unref(onFocus),onMouseenter:unref(onMouseenter),onMouseleave:unref(onMouseleave),onKeydown:unref(onKeydown)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}}),content_vue_vue_type_script_setup_true_lang_default=/* @__PURE__ */defineComponent({name:"ElTooltipContent",inheritAttrs:!1,__name:"content",props:useTooltipContentProps,setup(__props,{expose:__expose}){const props=__props,{selector:selector}=usePopperContainerId(),ns=useNamespace("tooltip"),contentRef=ref(),popperContentRef=computedEager(()=>contentRef.value?.popperContentRef);let stopHandle;const{controlled:controlled,id:id,open:open,trigger:trigger,onClose:onClose,onOpen:onOpen,onShow:onShow,onHide:onHide,onBeforeShow:onBeforeShow,onBeforeHide:onBeforeHide}=inject(TOOLTIP_INJECTION_KEY,void 0),transitionClass=computed(()=>props.transition||`${ns.namespace.value}-fade-in-linear`),persistentRef=computed(()=>props.persistent);onBeforeUnmount(()=>{stopHandle?.()});const shouldRender=computed(()=>!!unref(persistentRef)||unref(open)),shouldShow=computed(()=>!props.disabled&&unref(open)),appendTo=computed(()=>props.appendTo||selector.value),contentStyle=computed(()=>props.style??{}),ariaHidden=ref(!0),onTransitionLeave=()=>{onHide(),isFocusInsideContent()&&focusElement(document.body,{preventScroll:!0}),ariaHidden.value=!0},stopWhenControlled=()=>{if(unref(controlled))return!0},onContentEnter=composeEventHandlers(stopWhenControlled,()=>{props.enterable&&isTriggerType(unref(trigger),"hover")&&onOpen()}),onContentLeave=composeEventHandlers(stopWhenControlled,()=>{isTriggerType(unref(trigger),"hover")&&onClose()}),onBeforeEnter=()=>{contentRef.value?.updatePopper?.(),onBeforeShow?.()},onBeforeLeave=()=>{onBeforeHide?.()},onAfterShow=()=>{onShow()},onBlur=()=>{props.virtualTriggering||onClose()},isFocusInsideContent=event=>{const popperContent=contentRef.value?.popperContentRef,activeElement=event?.relatedTarget||document.activeElement;return popperContent?.contains(activeElement)};return watch(()=>unref(open),val=>{val?(ariaHidden.value=!1,stopHandle=onClickOutside(popperContentRef,()=>{var arr;unref(controlled)||(arr=unref(trigger),arr||0===arr?isArray$1(arr)?arr:[arr]:[]).every(item=>"hover"!==item&&"focus"!==item)&&onClose()},{detectIframe:!0})):stopHandle?.()},{flush:"post"}),watch(()=>props.content,()=>{contentRef.value?.updatePopper?.()}),__expose({contentRef:contentRef,isFocusInsideContent:isFocusInsideContent}),(_ctx,_cache)=>(openBlock(),createBlock(unref(ElTeleport),{disabled:!__props.teleported,to:appendTo.value},{default:withCtx(()=>[shouldRender.value||!ariaHidden.value?(openBlock(),createBlock(Transition,{key:0,name:transitionClass.value,appear:!persistentRef.value,onAfterLeave:onTransitionLeave,onBeforeEnter:onBeforeEnter,onAfterEnter:onAfterShow,onBeforeLeave:onBeforeLeave,persisted:""},{default:withCtx(()=>[withDirectives(createVNode(unref(content_default$1),mergeProps({id:unref(id),ref_key:"contentRef",ref:contentRef},_ctx.$attrs,{"aria-label":__props.ariaLabel,"aria-hidden":ariaHidden.value,"boundaries-padding":__props.boundariesPadding,"fallback-placements":__props.fallbackPlacements,"gpu-acceleration":__props.gpuAcceleration,offset:__props.offset,placement:__props.placement,"popper-options":__props.popperOptions,"arrow-offset":__props.arrowOffset,strategy:__props.strategy,effect:__props.effect,enterable:__props.enterable,pure:__props.pure,"popper-class":__props.popperClass,"popper-style":[__props.popperStyle,contentStyle.value],"reference-el":__props.referenceEl,"trigger-target-el":__props.triggerTargetEl,visible:shouldShow.value,"z-index":__props.zIndex,loop:__props.loop,onMouseenter:unref(onContentEnter),onMouseleave:unref(onContentLeave),onBlur:onBlur,onClose:unref(onClose)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","loop","onMouseenter","onMouseleave","onClose"]),[[vShow,shouldShow.value]])]),_:3},8,["name","appear"])):createCommentVNode("v-if",!0)]),_:3},8,["disabled","to"]))}}),content_default=content_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$c=["innerHTML"],_hoisted_2$5={key:1};const ElTooltip=withInstall(/* @__PURE__ */defineComponent({name:"ElTooltip",__name:"tooltip",props:useTooltipProps,emits:tooltipEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit;usePopperContainer();const ns=useNamespace("tooltip"),id=useId(),popperRef=ref(),contentRef=ref(),updatePopper=()=>{const popperComponent=unref(popperRef);popperComponent&&popperComponent.popperInstanceRef?.update()},open=ref(!1),toggleReason=ref(),{show:show,hide:hide,hasUpdateHandler:hasUpdateHandler}=useTooltipModelToggle({indicator:open,toggleReason:toggleReason}),{onOpen:onOpen,onClose:onClose}=(({showAfter:showAfter,hideAfter:hideAfter,autoClose:autoClose,open:open,close:close2})=>{const{registerTimeout:registerTimeout}=useTimeout(),{registerTimeout:registerTimeoutForAutoClose,cancelTimeout:cancelTimeoutForAutoClose}=useTimeout();return{onOpen:(event,delay=unref(showAfter))=>{registerTimeout(()=>{open(event);const _autoClose=unref(autoClose);isNumber(_autoClose)&&_autoClose>0&®isterTimeoutForAutoClose(()=>{close2(event)},_autoClose)},delay)},onClose:(event,delay=unref(hideAfter))=>{cancelTimeoutForAutoClose(),registerTimeout(()=>{close2(event)},delay)}}})({showAfter:toRef(props,"showAfter"),hideAfter:toRef(props,"hideAfter"),autoClose:toRef(props,"autoClose"),open:show,close:hide}),controlled=computed(()=>isBoolean(props.visible)&&!hasUpdateHandler.value),kls=computed(()=>[ns.b(),props.popperClass]);provide(TOOLTIP_INJECTION_KEY,{controlled:controlled,id:id,open:readonly(open),trigger:toRef(props,"trigger"),onOpen:onOpen,onClose:onClose,onToggle:event=>{unref(open)?onClose(event):onOpen(event)},onShow:()=>{emit("show",toggleReason.value)},onHide:()=>{emit("hide",toggleReason.value)},onBeforeShow:()=>{emit("before-show",toggleReason.value)},onBeforeHide:()=>{emit("before-hide",toggleReason.value)},updatePopper:updatePopper}),watch(()=>props.disabled,disabled=>{disabled&&open.value&&(open.value=!1)});return onDeactivated(()=>open.value&&hide()),onBeforeUnmount(()=>{toggleReason.value=void 0}),__expose({popperRef:popperRef,contentRef:contentRef,isFocusInsideContent:event=>contentRef.value?.isFocusInsideContent(event),updatePopper:updatePopper,onOpen:onOpen,onClose:onClose,hide:hide}),(_ctx,_cache)=>(openBlock(),createBlock(unref(ElPopper),{ref_key:"popperRef",ref:popperRef,role:__props.role},{default:withCtx(()=>[createVNode(trigger_default,{disabled:__props.disabled,trigger:__props.trigger,"trigger-keys":__props.triggerKeys,"virtual-ref":__props.virtualRef,"virtual-triggering":__props.virtualTriggering,"focus-on-target":__props.focusOnTarget},{default:withCtx(()=>[_ctx.$slots.default?renderSlot(_ctx.$slots,"default",{key:0}):createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),createVNode(content_default,{ref_key:"contentRef",ref:contentRef,"aria-label":__props.ariaLabel,"boundaries-padding":__props.boundariesPadding,content:__props.content,disabled:__props.disabled,effect:__props.effect,enterable:__props.enterable,"fallback-placements":__props.fallbackPlacements,"hide-after":__props.hideAfter,"gpu-acceleration":__props.gpuAcceleration,offset:__props.offset,persistent:__props.persistent,"popper-class":kls.value,"popper-style":__props.popperStyle,placement:__props.placement,"popper-options":__props.popperOptions,"arrow-offset":__props.arrowOffset,pure:__props.pure,"raw-content":__props.rawContent,"reference-el":__props.referenceEl,"trigger-target-el":__props.triggerTargetEl,"show-after":__props.showAfter,strategy:__props.strategy,teleported:__props.teleported,transition:__props.transition,"virtual-triggering":__props.virtualTriggering,"z-index":__props.zIndex,"append-to":__props.appendTo,loop:__props.loop},{default:withCtx(()=>[renderSlot(_ctx.$slots,"content",{},()=>[__props.rawContent?(openBlock(),createElementBlock("span",{key:0,innerHTML:__props.content},null,8,_hoisted_1$c)):(openBlock(),createElementBlock("span",_hoisted_2$5,toDisplayString(__props.content),1))]),__props.showArrow?(openBlock(),createBlock(unref(arrow_default),{key:0})):createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to","loop"])]),_:3},8,["role"]))}})),inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Object],default:""},modelModifiers:{type:Object,default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:iconPropType,default:circle_close_default},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String],default:()=>({})},autofocus:Boolean,rows:{type:Number,default:2},...useAriaProps(["ariaLabel"]),inputmode:{type:String,default:void 0},name:String}),inputEmits={[UPDATE_MODEL_EVENT]:value=>isString(value),input:value=>isString(value),change:(value,evt)=>isString(value)&&(evt instanceof Event||void 0===evt),focus:evt=>evt instanceof FocusEvent,blur:evt=>evt instanceof FocusEvent,clear:evt=>void 0===evt||evt instanceof MouseEvent,mouseleave:evt=>evt instanceof MouseEvent,mouseenter:evt=>evt instanceof MouseEvent,keydown:evt=>evt instanceof Event,compositionstart:evt=>evt instanceof CompositionEvent,compositionupdate:evt=>evt instanceof CompositionEvent,compositionend:evt=>evt instanceof CompositionEvent};let hiddenTextarea;markRaw(circle_close_default);const HIDDEN_STYLE={height:"0",visibility:"hidden",overflow:isFirefox()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],looseToNumber=val=>{const n=Number.parseFloat(val);return Number.isNaN(n)?val:n};function calcTextareaHeight(targetElement,minRows=1,maxRows){if(!hiddenTextarea){hiddenTextarea=document.createElement("textarea");let hostNode=document.body;!isFirefox()&&targetElement.parentNode&&(hostNode=targetElement.parentNode),hostNode.appendChild(hiddenTextarea)}const{paddingSize:paddingSize,borderSize:borderSize,boxSizing:boxSizing,contextStyle:contextStyle}=function(targetElement){const style=window.getComputedStyle(targetElement),boxSizing=style.getPropertyValue("box-sizing"),paddingSize=Number.parseFloat(style.getPropertyValue("padding-bottom"))+Number.parseFloat(style.getPropertyValue("padding-top")),borderSize=Number.parseFloat(style.getPropertyValue("border-bottom-width"))+Number.parseFloat(style.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(name=>[name,style.getPropertyValue(name)]),paddingSize:paddingSize,borderSize:borderSize,boxSizing:boxSizing}}(targetElement);contextStyle.forEach(([key,value])=>hiddenTextarea?.style.setProperty(key,value)),Object.entries(HIDDEN_STYLE).forEach(([key,value])=>hiddenTextarea?.style.setProperty(key,value,"important")),hiddenTextarea.value=targetElement.value||targetElement.placeholder||"";let height=hiddenTextarea.scrollHeight;const result={};"border-box"===boxSizing?height+=borderSize:"content-box"===boxSizing&&(height-=paddingSize),hiddenTextarea.value="";const singleRowHeight=hiddenTextarea.scrollHeight-paddingSize;if(isNumber(minRows)){let minHeight=singleRowHeight*minRows;"border-box"===boxSizing&&(minHeight=minHeight+paddingSize+borderSize),height=Math.max(minHeight,height),result.minHeight=`${minHeight}px`}if(isNumber(maxRows)){let maxHeight=singleRowHeight*maxRows;"border-box"===boxSizing&&(maxHeight=maxHeight+paddingSize+borderSize),height=Math.min(maxHeight,height)}return result.height=`${height}px`,hiddenTextarea.parentNode?.removeChild(hiddenTextarea),hiddenTextarea=void 0,result}const _hoisted_1$b=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],_hoisted_2$4=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role"];const ElInput=withInstall(/* @__PURE__ */defineComponent({name:"ElInput",inheritAttrs:!1,__name:"input",props:inputProps,emits:inputEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,rawAttrs=useAttrs$1(),attrs=((params={})=>{const{excludeListeners:excludeListeners=!1,excludeKeys:excludeKeys}=params,allExcludeKeys=computed(()=>(excludeKeys?.value||[]).concat(DEFAULT_EXCLUDE_KEYS)),instance=getCurrentInstance();return instance?computed(()=>fromPairs(Object.entries(instance.proxy?.$attrs).filter(([key])=>!(allExcludeKeys.value.includes(key)||excludeListeners&&LISTENER_PREFIX.test(key))))):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),computed(()=>({})))})(),slots=useSlots(),containerKls=computed(()=>["textarea"===props.type?nsTextarea.b():nsInput.b(),nsInput.m(inputSize.value),nsInput.is("disabled",inputDisabled.value),nsInput.is("exceed",inputExceed.value),{[nsInput.b("group")]:slots.prepend||slots.append,[nsInput.m("prefix")]:slots.prefix||props.prefixIcon,[nsInput.m("suffix")]:slots.suffix||props.suffixIcon||props.clearable||props.showPassword,[nsInput.bm("suffix","password-clear")]:showClear.value&&showPwdVisible.value,[nsInput.b("hidden")]:"hidden"===props.type},rawAttrs.class]),wrapperKls=computed(()=>[nsInput.e("wrapper"),nsInput.is("focus",isFocused.value)]),{form:elForm,formItem:elFormItem}=useFormItem(),{inputId:inputId}=useFormItemInputId(props,{formItemContext:elFormItem}),inputSize=useFormSize(),inputDisabled=useFormDisabled(),nsInput=useNamespace("input"),nsTextarea=useNamespace("textarea"),input=shallowRef(),textarea=shallowRef(),hovering=ref(!1),passwordVisible=ref(!1),countStyle=ref(),textareaCalcStyle=shallowRef(props.inputStyle),_ref=computed(()=>input.value||textarea.value),{wrapperRef:wrapperRef,isFocused:isFocused,handleFocus:handleFocus,handleBlur:handleBlur}=function(target,{disabled:disabled,beforeFocus:beforeFocus,afterFocus:afterFocus,beforeBlur:beforeBlur,afterBlur:afterBlur}={}){const{emit:emit}=getCurrentInstance(),wrapperRef=shallowRef(),isFocused=ref(!1),handleFocus=event=>{const cancelFocus=!!isFunction$1(beforeFocus)&&beforeFocus(event);unref(disabled)||isFocused.value||cancelFocus||(isFocused.value=!0,emit("focus",event),afterFocus?.())},handleBlur=event=>{const cancelBlur=!!isFunction$1(beforeBlur)&&beforeBlur(event);unref(disabled)||event.relatedTarget&&wrapperRef.value?.contains(event.relatedTarget)||cancelBlur||(isFocused.value=!1,emit("blur",event),afterBlur?.())};return watch([wrapperRef,()=>unref(disabled)],([el,disabled2])=>{el&&(disabled2?el.removeAttribute("tabindex"):el.setAttribute("tabindex","-1"))}),useEventListener(wrapperRef,"focus",handleFocus,!0),useEventListener(wrapperRef,"blur",handleBlur,!0),useEventListener(wrapperRef,"click",event=>{unref(disabled)||isFocusable(event.target)||wrapperRef.value?.contains(document.activeElement)&&wrapperRef.value!==document.activeElement||target.value?.focus()},!0),{isFocused:isFocused,wrapperRef:wrapperRef,handleFocus:handleFocus,handleBlur:handleBlur}}(_ref,{disabled:inputDisabled,afterBlur(){props.validateEvent&&elFormItem?.validate?.("blur").catch(err=>debugWarn(err))}}),needStatusIcon=computed(()=>elForm?.statusIcon??!1),validateState=computed(()=>elFormItem?.validateState||""),validateIcon=computed(()=>validateState.value&&ValidateComponentsMap[validateState.value]),passwordIcon=computed(()=>passwordVisible.value?view_default:hide_default),containerStyle=computed(()=>[rawAttrs.style]),textareaStyle=computed(()=>[props.inputStyle,textareaCalcStyle.value,{resize:props.resize}]),nativeInputValue=computed(()=>isNil(props.modelValue)?"":String(props.modelValue)),showClear=computed(()=>props.clearable&&!inputDisabled.value&&!props.readonly&&!!nativeInputValue.value&&(isFocused.value||hovering.value)),showPwdVisible=computed(()=>props.showPassword&&!inputDisabled.value&&!!nativeInputValue.value),isWordLimitVisible=computed(()=>props.showWordLimit&&!!props.maxlength&&("text"===props.type||"textarea"===props.type)&&!inputDisabled.value&&!props.readonly&&!props.showPassword),textLength=computed(()=>nativeInputValue.value.length),inputExceed=computed(()=>!!isWordLimitVisible.value&&textLength.value>Number(props.maxlength)),suffixVisible=computed(()=>!!slots.suffix||!!props.suffixIcon||showClear.value||props.showPassword||isWordLimitVisible.value||!!validateState.value&&needStatusIcon.value),hasModelModifiers=computed(()=>!!Object.keys(props.modelModifiers).length),[recordCursor,setCursor]=function(input){let selectionInfo;return[function(){if(null==input.value)return;const{selectionStart:selectionStart,selectionEnd:selectionEnd,value:value}=input.value;null!=selectionStart&&null!=selectionEnd&&(selectionInfo={selectionStart:selectionStart,selectionEnd:selectionEnd,value:value,beforeTxt:value.slice(0,Math.max(0,selectionStart)),afterTxt:value.slice(Math.max(0,selectionEnd))})},function(){if(null==input.value||null==selectionInfo)return;const{value:value}=input.value,{beforeTxt:beforeTxt,afterTxt:afterTxt,selectionStart:selectionStart}=selectionInfo;if(null==beforeTxt||null==afterTxt||null==selectionStart)return;let startPos=value.length;if(value.endsWith(afterTxt))startPos=value.length-afterTxt.length;else if(value.startsWith(beforeTxt))startPos=beforeTxt.length;else{const beforeLastChar=beforeTxt[selectionStart-1],newIndex=value.indexOf(beforeLastChar,selectionStart-1);-1!==newIndex&&(startPos=newIndex+1)}input.value.setSelectionRange(startPos,startPos)}]}(input);useResizeObserver(textarea,entries=>{if(onceInitSizeTextarea(),!isWordLimitVisible.value||"both"!==props.resize&&"horizontal"!==props.resize)return;const{width:width}=entries[0].contentRect;countStyle.value={right:`calc(100% - ${width+22-10}px)`}});const resizeTextarea=()=>{const{type:type,autosize:autosize}=props;if(isClient&&"textarea"===type&&textarea.value)if(autosize){const minRows=isObject$2(autosize)?autosize.minRows:void 0,maxRows=isObject$2(autosize)?autosize.maxRows:void 0,textareaStyle2=calcTextareaHeight(textarea.value,minRows,maxRows);textareaCalcStyle.value={overflowY:"hidden",...textareaStyle2},nextTick(()=>{textarea.value.offsetHeight,textareaCalcStyle.value=textareaStyle2})}else textareaCalcStyle.value={minHeight:calcTextareaHeight(textarea.value).minHeight}},onceInitSizeTextarea=(resizeTextarea2=>{let isInit=!1;return()=>{!isInit&&props.autosize&&null!==textarea.value?.offsetParent&&(setTimeout(resizeTextarea2),isInit=!0)}})(resizeTextarea),setNativeInputValue=()=>{const input2=_ref.value,formatterValue=props.formatter?props.formatter(nativeInputValue.value):nativeInputValue.value;input2&&input2.value!==formatterValue&&"file"!==props.type&&(input2.value=formatterValue)},formatValue=value=>{const{trim:trim,number:number}=props.modelModifiers;return trim&&(value=value.trim()),number&&(value=`${looseToNumber(value)}`),props.formatter&&props.parser&&(value=props.parser(value)),value},handleInput=async event=>{if(isComposing.value)return;const{lazy:lazy}=props.modelModifiers;let{value:value}=event.target;lazy?emit("input",value):(value=formatValue(value),String(value)!==nativeInputValue.value?(recordCursor(),emit("update:modelValue",value),emit("input",value),await nextTick(),(props.formatter&&props.parser||!hasModelModifiers.value)&&setNativeInputValue(),setCursor()):props.formatter&&setNativeInputValue())},handleChange=async event=>{let{value:value}=event.target;value=formatValue(value),props.modelModifiers.lazy&&emit("update:modelValue",value),emit("change",value,event),await nextTick(),setNativeInputValue()},{isComposing:isComposing,handleCompositionStart:handleCompositionStart,handleCompositionUpdate:handleCompositionUpdate,handleCompositionEnd:handleCompositionEnd}=function({afterComposition:afterComposition,emit:emit}){const isComposing=ref(!1),handleCompositionUpdate=event=>{emit?.("compositionupdate",event);const text=event.target?.value;isComposing.value=!(text=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text))(text[text.length-1]||"")},handleCompositionEnd=event=>{emit?.("compositionend",event),isComposing.value&&(isComposing.value=!1,nextTick(()=>afterComposition(event)))};return{isComposing:isComposing,handleComposition:event=>{"compositionend"===event.type?handleCompositionEnd(event):handleCompositionUpdate(event)},handleCompositionStart:event=>{emit?.("compositionstart",event),isComposing.value=!0},handleCompositionUpdate:handleCompositionUpdate,handleCompositionEnd:handleCompositionEnd}}({emit:emit,afterComposition:handleInput}),handlePasswordVisible=()=>{passwordVisible.value=!passwordVisible.value},handleMouseLeave=evt=>{hovering.value=!1,emit("mouseleave",evt)},handleMouseEnter=evt=>{hovering.value=!0,emit("mouseenter",evt)},handleKeydown=evt=>{emit("keydown",evt)},clear=evt=>{emit("update:modelValue",""),emit("change",""),emit("clear",evt),emit("input","")};return watch(()=>props.modelValue,()=>{nextTick(()=>resizeTextarea()),props.validateEvent&&elFormItem?.validate?.("change").catch(err=>debugWarn(err))}),watch(nativeInputValue,newValue=>{if(!_ref.value)return;const{trim:trim,number:number}=props.modelModifiers,elValue=_ref.value.value,displayValue=!number&&"number"!==props.type||/^0\d/.test(elValue)?elValue:`${looseToNumber(elValue)}`;displayValue!==newValue&&(document.activeElement===_ref.value&&"range"!==_ref.value.type&&trim&&displayValue.trim()===newValue||setNativeInputValue())}),watch(()=>props.type,async()=>{await nextTick(),setNativeInputValue(),resizeTextarea()}),onMounted(()=>{!props.formatter&&props.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),setNativeInputValue(),nextTick(resizeTextarea)}),__expose({input:input,textarea:textarea,ref:_ref,textareaStyle:textareaStyle,autosize:toRef(props,"autosize"),isComposing:isComposing,focus:()=>_ref.value?.focus(),blur:()=>_ref.value?.blur(),select:()=>{_ref.value?.select()},clear:clear,resizeTextarea:resizeTextarea}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass([containerKls.value,{[unref(nsInput).bm("group","append")]:_ctx.$slots.append,[unref(nsInput).bm("group","prepend")]:_ctx.$slots.prepend}]),style:normalizeStyle(containerStyle.value),onMouseenter:handleMouseEnter,onMouseleave:handleMouseLeave},[createCommentVNode(" input "),"textarea"!==__props.type?(openBlock(),createElementBlock(Fragment,{key:0},[createCommentVNode(" prepend slot "),_ctx.$slots.prepend?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(nsInput).be("group","prepend"))},[renderSlot(_ctx.$slots,"prepend")],2)):createCommentVNode("v-if",!0),createElementVNode("div",{ref_key:"wrapperRef",ref:wrapperRef,class:normalizeClass(wrapperKls.value)},[createCommentVNode(" prefix slot "),_ctx.$slots.prefix||__props.prefixIcon?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(nsInput).e("prefix"))},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("prefix-inner"))},[renderSlot(_ctx.$slots,"prefix"),__props.prefixIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(nsInput).e("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.prefixIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],2)):createCommentVNode("v-if",!0),createElementVNode("input",mergeProps({id:unref(inputId),ref_key:"input",ref:input,class:unref(nsInput).e("inner")},unref(attrs),{name:__props.name,minlength:__props.minlength,maxlength:__props.maxlength,type:__props.showPassword?passwordVisible.value?"text":"password":__props.type,disabled:unref(inputDisabled),readonly:__props.readonly,autocomplete:__props.autocomplete,tabindex:__props.tabindex,"aria-label":__props.ariaLabel,placeholder:__props.placeholder,style:__props.inputStyle,form:__props.form,autofocus:__props.autofocus,role:__props.containerRole,inputmode:__props.inputmode,onCompositionstart:_cache[0]||(_cache[0]=(...args)=>unref(handleCompositionStart)&&unref(handleCompositionStart)(...args)),onCompositionupdate:_cache[1]||(_cache[1]=(...args)=>unref(handleCompositionUpdate)&&unref(handleCompositionUpdate)(...args)),onCompositionend:_cache[2]||(_cache[2]=(...args)=>unref(handleCompositionEnd)&&unref(handleCompositionEnd)(...args)),onInput:handleInput,onChange:handleChange,onKeydown:handleKeydown}),null,16,_hoisted_1$b),createCommentVNode(" suffix slot "),suffixVisible.value?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(nsInput).e("suffix"))},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("suffix-inner"))},[showClear.value&&showPwdVisible.value&&isWordLimitVisible.value?createCommentVNode("v-if",!0):(openBlock(),createElementBlock(Fragment,{key:0},[renderSlot(_ctx.$slots,"suffix"),__props.suffixIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(nsInput).e("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.suffixIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],64)),showClear.value?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("clear")]),onMousedown:withModifiers(unref(NOOP),["prevent"]),onClick:clear},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.clearIcon)))]),_:1},8,["class","onMousedown"])):createCommentVNode("v-if",!0),showPwdVisible.value?(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("password")]),onClick:handlePasswordVisible,onMousedown:withModifiers(unref(NOOP),["prevent"]),onMouseup:withModifiers(unref(NOOP),["prevent"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(passwordIcon.value)))]),_:1},8,["class","onMousedown","onMouseup"])):createCommentVNode("v-if",!0),isWordLimitVisible.value?(openBlock(),createElementBlock("span",{key:3,class:normalizeClass([unref(nsInput).e("count"),unref(nsInput).is("outside","outside"===__props.wordLimitPosition)])},[createElementVNode("span",{class:normalizeClass(unref(nsInput).e("count-inner"))},toDisplayString(textLength.value)+" / "+toDisplayString(__props.maxlength),3)],2)):createCommentVNode("v-if",!0),validateState.value&&validateIcon.value&&needStatusIcon.value?(openBlock(),createBlock(unref(ElIcon),{key:4,class:normalizeClass([unref(nsInput).e("icon"),unref(nsInput).e("validateIcon"),unref(nsInput).is("loading","validating"===validateState.value)])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(validateIcon.value)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],2)):createCommentVNode("v-if",!0)],2),createCommentVNode(" append slot "),_ctx.$slots.append?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(nsInput).be("group","append"))},[renderSlot(_ctx.$slots,"append")],2)):createCommentVNode("v-if",!0)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" textarea "),createElementVNode("textarea",mergeProps({id:unref(inputId),ref_key:"textarea",ref:textarea,class:[unref(nsTextarea).e("inner"),unref(nsInput).is("focus",unref(isFocused)),unref(nsTextarea).is("clearable",__props.clearable)]},unref(attrs),{name:__props.name,minlength:__props.minlength,maxlength:__props.maxlength,tabindex:__props.tabindex,disabled:unref(inputDisabled),readonly:__props.readonly,autocomplete:__props.autocomplete,style:textareaStyle.value,"aria-label":__props.ariaLabel,placeholder:__props.placeholder,form:__props.form,autofocus:__props.autofocus,rows:__props.rows,role:__props.containerRole,onCompositionstart:_cache[3]||(_cache[3]=(...args)=>unref(handleCompositionStart)&&unref(handleCompositionStart)(...args)),onCompositionupdate:_cache[4]||(_cache[4]=(...args)=>unref(handleCompositionUpdate)&&unref(handleCompositionUpdate)(...args)),onCompositionend:_cache[5]||(_cache[5]=(...args)=>unref(handleCompositionEnd)&&unref(handleCompositionEnd)(...args)),onInput:handleInput,onFocus:_cache[6]||(_cache[6]=(...args)=>unref(handleFocus)&&unref(handleFocus)(...args)),onBlur:_cache[7]||(_cache[7]=(...args)=>unref(handleBlur)&&unref(handleBlur)(...args)),onChange:handleChange,onKeydown:handleKeydown}),null,16,_hoisted_2$4),showClear.value?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(nsTextarea).e("icon"),unref(nsTextarea).e("clear")]),onMousedown:withModifiers(unref(NOOP),["prevent"]),onClick:clear},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.clearIcon)))]),_:1},8,["class","onMousedown"])):createCommentVNode("v-if",!0),isWordLimitVisible.value?(openBlock(),createElementBlock("span",{key:1,style:normalizeStyle(countStyle.value),class:normalizeClass([unref(nsInput).e("count"),unref(nsInput).is("outside","outside"===__props.wordLimitPosition)])},toDisplayString(textLength.value)+" / "+toDisplayString(__props.maxlength),7)):createCommentVNode("v-if",!0)],64))],38))}})),scrollbarProps=buildProps({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:[String,Object,Array],default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...useAriaProps(["ariaLabel","ariaOrientation"])}),scrollbarEmits={"end-reached":direction=>["left","right","top","bottom"].includes(direction),scroll:({scrollTop:scrollTop,scrollLeft:scrollLeft})=>[scrollTop,scrollLeft].every(isNumber)},BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),scrollbarContextKey=/* @__PURE__ */Symbol("scrollbarContextKey"),barProps=buildProps({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var thumb_default=/* @__PURE__ */defineComponent({__name:"thumb",props:thumbProps,setup(__props){const props=__props,scrollbar=inject(scrollbarContextKey),ns=useNamespace("scrollbar");scrollbar||function(scope,m){throw new ElementPlusError(`[${scope}] ${m}`)}("Thumb","can not inject scrollbar context");const instance=ref(),thumb=ref(),thumbState=ref({}),visible=ref(!1);let cursorDown=!1,cursorLeave=!1,baseScrollHeight=0,baseScrollWidth=0,originalOnSelectStart=isClient?document.onselectstart:null;const bar=computed(()=>BAR_MAP[props.vertical?"vertical":"horizontal"]),thumbStyle=computed(()=>(({move:move,size:size,bar:bar})=>({[bar.size]:size,transform:`translate${bar.axis}(${move}%)`}))({size:props.size,move:props.move,bar:bar.value})),offsetRatio=computed(()=>instance.value[bar.value.offset]**2/scrollbar.wrapElement[bar.value.scrollSize]/props.ratio/thumb.value[bar.value.offset]),clickThumbHandler=e=>{if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;window.getSelection()?.removeAllRanges(),startDrag(e);const el=e.currentTarget;el&&(thumbState.value[bar.value.axis]=el[bar.value.offset]-(e[bar.value.client]-el.getBoundingClientRect()[bar.value.direction]))},clickTrackHandler=e=>{if(!thumb.value||!instance.value||!scrollbar.wrapElement)return;const thumbPositionPercentage=100*(Math.abs(e.target.getBoundingClientRect()[bar.value.direction]-e[bar.value.client])-thumb.value[bar.value.offset]/2)*offsetRatio.value/instance.value[bar.value.offset];scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*scrollbar.wrapElement[bar.value.scrollSize]/100},startDrag=e=>{e.stopImmediatePropagation(),cursorDown=!0,baseScrollHeight=scrollbar.wrapElement.scrollHeight,baseScrollWidth=scrollbar.wrapElement.scrollWidth,document.addEventListener("mousemove",mouseMoveDocumentHandler),document.addEventListener("mouseup",mouseUpDocumentHandler),originalOnSelectStart=document.onselectstart,document.onselectstart=()=>!1},mouseMoveDocumentHandler=e=>{if(!instance.value||!thumb.value)return;if(!1===cursorDown)return;const prevPage=thumbState.value[bar.value.axis];if(!prevPage)return;const thumbPositionPercentage=100*(-1*(instance.value.getBoundingClientRect()[bar.value.direction]-e[bar.value.client])-(thumb.value[bar.value.offset]-prevPage))*offsetRatio.value/instance.value[bar.value.offset];"scrollLeft"===bar.value.scroll?scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*baseScrollWidth/100:scrollbar.wrapElement[bar.value.scroll]=thumbPositionPercentage*baseScrollHeight/100},mouseUpDocumentHandler=()=>{cursorDown=!1,thumbState.value[bar.value.axis]=0,document.removeEventListener("mousemove",mouseMoveDocumentHandler),document.removeEventListener("mouseup",mouseUpDocumentHandler),restoreOnselectstart(),cursorLeave&&(visible.value=!1)};onBeforeUnmount(()=>{restoreOnselectstart(),document.removeEventListener("mouseup",mouseUpDocumentHandler)});const restoreOnselectstart=()=>{document.onselectstart!==originalOnSelectStart&&(document.onselectstart=originalOnSelectStart)};return useEventListener(toRef(scrollbar,"scrollbarElement"),"mousemove",()=>{cursorLeave=!1,visible.value=!!props.size}),useEventListener(toRef(scrollbar,"scrollbarElement"),"mouseleave",()=>{cursorLeave=!0,visible.value=cursorDown}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:unref(ns).b("fade"),persisted:""},{default:withCtx(()=>[withDirectives(createElementVNode("div",{ref_key:"instance",ref:instance,class:normalizeClass([unref(ns).e("bar"),unref(ns).is(bar.value.key)]),onMousedown:clickTrackHandler,onClick:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"]))},[createElementVNode("div",{ref_key:"thumb",ref:thumb,class:normalizeClass(unref(ns).e("thumb")),style:normalizeStyle(thumbStyle.value),onMousedown:clickThumbHandler},null,38)],34),[[vShow,__props.always||visible.value]])]),_:1},8,["name"]))}}),bar_default=/* @__PURE__ */defineComponent({__name:"bar",props:barProps,setup(__props,{expose:__expose}){const props=__props,scrollbar=inject(scrollbarContextKey),moveX=ref(0),moveY=ref(0),sizeWidth=ref(""),sizeHeight=ref(""),ratioY=ref(1),ratioX=ref(1);return __expose({handleScroll:wrap=>{if(wrap){const offsetHeight=wrap.offsetHeight-4,offsetWidth=wrap.offsetWidth-4;moveY.value=100*wrap.scrollTop/offsetHeight*ratioY.value,moveX.value=100*wrap.scrollLeft/offsetWidth*ratioX.value}},update:()=>{const wrap=scrollbar?.wrapElement;if(!wrap)return;const offsetHeight=wrap.offsetHeight-4,offsetWidth=wrap.offsetWidth-4,originalHeight=offsetHeight**2/wrap.scrollHeight,originalWidth=offsetWidth**2/wrap.scrollWidth,height=Math.max(originalHeight,props.minSize),width=Math.max(originalWidth,props.minSize);ratioY.value=originalHeight/(offsetHeight-originalHeight)/(height/(offsetHeight-height)),ratioX.value=originalWidth/(offsetWidth-originalWidth)/(width/(offsetWidth-width)),sizeHeight.value=height+4<offsetHeight?`${height}px`:"",sizeWidth.value=width+4<offsetWidth?`${width}px`:""}}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(thumb_default,{move:moveX.value,ratio:ratioX.value,size:sizeWidth.value,always:__props.always},null,8,["move","ratio","size","always"]),createVNode(thumb_default,{move:moveY.value,ratio:ratioY.value,size:sizeHeight.value,vertical:"",always:__props.always},null,8,["move","ratio","size","always"])],64))}});const _hoisted_1$a=["tabindex"];const ElScrollbar=withInstall(/* @__PURE__ */defineComponent({name:"ElScrollbar",__name:"scrollbar",props:scrollbarProps,emits:scrollbarEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,ns=useNamespace("scrollbar");let stopResizeObserver,stopWrapResizeObserver,stopResizeListener,wrapScrollTop=0,wrapScrollLeft=0,direction="";const distanceScrollState={bottom:!1,top:!1,right:!1,left:!1},scrollbarRef=ref(),wrapRef=ref(),resizeRef=ref(),barRef=ref(),wrapStyle=computed(()=>{const style={},height=addUnit(props.height),maxHeight=addUnit(props.maxHeight);return height&&(style.height=height),maxHeight&&(style.maxHeight=maxHeight),[props.wrapStyle,style]}),wrapKls=computed(()=>[props.wrapClass,ns.e("wrap"),{[ns.em("wrap","hidden-default")]:!props.native}]),resizeKls=computed(()=>[ns.e("view"),props.viewClass]),DIRECTION_PAIRS={top:"bottom",bottom:"top",left:"right",right:"left"},handleScroll=()=>{if(wrapRef.value){barRef.value?.handleScroll(wrapRef.value);const prevTop=wrapScrollTop,prevLeft=wrapScrollLeft;wrapScrollTop=wrapRef.value.scrollTop,wrapScrollLeft=wrapRef.value.scrollLeft;const arrivedStates={bottom:wrapScrollTop+wrapRef.value.clientHeight>=wrapRef.value.scrollHeight-props.distance,top:wrapScrollTop<=props.distance&&0!==prevTop,right:wrapScrollLeft+wrapRef.value.clientWidth>=wrapRef.value.scrollWidth-props.distance&&prevLeft!==wrapScrollLeft,left:wrapScrollLeft<=props.distance&&0!==prevLeft};if(emit("scroll",{scrollTop:wrapScrollTop,scrollLeft:wrapScrollLeft}),prevTop!==wrapScrollTop&&(direction=wrapScrollTop>prevTop?"bottom":"top"),prevLeft!==wrapScrollLeft&&(direction=wrapScrollLeft>prevLeft?"right":"left"),props.distance>0){if(distanceScrollState[direction])return;(arrivedStates=>{const oppositeDirection=DIRECTION_PAIRS[direction];if(!oppositeDirection)return;const arrived=arrivedStates[direction],oppositeArrived=arrivedStates[oppositeDirection];arrived&&!distanceScrollState[direction]&&(distanceScrollState[direction]=!0),!oppositeArrived&&distanceScrollState[oppositeDirection]&&(distanceScrollState[oppositeDirection]=!1)})(arrivedStates)}arrivedStates[direction]&&emit("end-reached",direction)}};const update=()=>{barRef.value?.update(),distanceScrollState[direction]=!1};return watch(()=>props.noresize,noresize=>{noresize?(stopResizeObserver?.(),stopWrapResizeObserver?.(),stopResizeListener?.()):(({stop:stopResizeObserver}=useResizeObserver(resizeRef,update)),({stop:stopWrapResizeObserver}=useResizeObserver(wrapRef,update)),stopResizeListener=useEventListener("resize",update))},{immediate:!0}),watch(()=>[props.maxHeight,props.height],()=>{props.native||nextTick(()=>{update(),wrapRef.value&&barRef.value?.handleScroll(wrapRef.value)})}),provide(scrollbarContextKey,reactive({scrollbarElement:scrollbarRef,wrapElement:wrapRef})),onActivated(()=>{wrapRef.value&&(wrapRef.value.scrollTop=wrapScrollTop,wrapRef.value.scrollLeft=wrapScrollLeft)}),onMounted(()=>{props.native||nextTick(()=>{update()})}),onUpdated(()=>update()),__expose({wrapRef:wrapRef,update:update,scrollTo:function(arg1,arg2){isObject$2(arg1)?wrapRef.value.scrollTo(arg1):isNumber(arg1)&&isNumber(arg2)&&wrapRef.value.scrollTo(arg1,arg2)},setScrollTop:value=>{isNumber(value)?wrapRef.value.scrollTop=value:debugWarn("ElScrollbar","value must be a number")},setScrollLeft:value=>{isNumber(value)?wrapRef.value.scrollLeft=value:debugWarn("ElScrollbar","value must be a number")},handleScroll:handleScroll}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{ref_key:"scrollbarRef",ref:scrollbarRef,class:normalizeClass(unref(ns).b())},[createElementVNode("div",{ref_key:"wrapRef",ref:wrapRef,class:normalizeClass(wrapKls.value),style:normalizeStyle(wrapStyle.value),tabindex:__props.tabindex,onScroll:handleScroll},[(openBlock(),createBlock(resolveDynamicComponent(__props.tag),{id:__props.id,ref_key:"resizeRef",ref:resizeRef,class:normalizeClass(resizeKls.value),style:normalizeStyle(__props.viewStyle),role:__props.role,"aria-label":__props.ariaLabel,"aria-orientation":__props.ariaOrientation},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,_hoisted_1$a),__props.native?createCommentVNode("v-if",!0):(openBlock(),createBlock(bar_default,{key:0,ref_key:"barRef",ref:barRef,always:__props.always,"min-size":__props.minSize},null,8,["always","min-size"]))],2))}}));const ElBadge=withInstall(/* @__PURE__ */defineComponent({name:"ElBadge",__name:"badge",props:buildProps({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:[String,Object,Array]},offset:{type:Array,default:()=>[0,0]},badgeClass:{type:String}}),setup(__props,{expose:__expose}){const props=__props,ns=useNamespace("badge"),content=computed(()=>props.isDot?"":isNumber(props.value)&&isNumber(props.max)&&props.max<props.value?`${props.max}+`:`${props.value}`),style=computed(()=>[{backgroundColor:props.color,marginRight:addUnit(-props.offset[0]),marginTop:addUnit(props.offset[1])},props.badgeStyle??{}]);return __expose({content:content}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(ns).b())},[renderSlot(_ctx.$slots,"default"),createVNode(Transition,{name:`${unref(ns).namespace.value}-zoom-in-center`},{default:withCtx(()=>[!__props.hidden&&(content.value||__props.isDot||_ctx.$slots.content)?(openBlock(),createElementBlock("sup",{key:0,class:normalizeClass([unref(ns).e("content"),unref(ns).em("content",__props.type),unref(ns).is("fixed",!!_ctx.$slots.default),unref(ns).is("dot",__props.isDot),unref(ns).is("hide-zero",!__props.showZero&&0===__props.value),__props.badgeClass]),style:normalizeStyle(style.value)},[renderSlot(_ctx.$slots,"content",{value:content.value},()=>[createTextVNode(toDisplayString(content.value),1)])],6)):createCommentVNode("v-if",!0)]),_:3},8,["name"])],2))}})),buttonProps=buildProps({size:useSizeProp,disabled:{type:Boolean,default:void 0},type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:iconPropType},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:iconPropType,default:()=>loading_default},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,dashed:{type:Boolean,default:void 0},color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),buttonEmits={click:evt=>evt instanceof MouseEvent},configProviderContextKey=/* @__PURE__ */Symbol(),globalConfig=ref();function useGlobalConfig(key,defaultValue=void 0){const config=getCurrentInstance()?inject(configProviderContextKey,globalConfig):globalConfig;return key?computed(()=>config.value?.[key]??defaultValue):config}const provideGlobalConfig=(config,app,global2=!1)=>{const inSetup=!!getCurrentInstance(),oldConfig=inSetup?useGlobalConfig():void 0,provideFn=inSetup?provide:void 0;if(!provideFn)return void debugWarn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const context=computed(()=>{const cfg=unref(config);return oldConfig?.value?mergeConfig(oldConfig.value,cfg):cfg});return provideFn(configProviderContextKey,context),provideFn(localeContextKey,computed(()=>context.value.locale)),provideFn(namespaceContextKey,computed(()=>context.value.namespace)),provideFn(zIndexContextKey,computed(()=>context.value.zIndex)),provideFn(SIZE_INJECTION_KEY,{size:computed(()=>context.value.size||"")}),provideFn(emptyValuesContextKey,computed(()=>({emptyValues:context.value.emptyValues,valueOnClear:context.value.valueOnClear}))),!global2&&globalConfig.value||(globalConfig.value=context.value),context},mergeConfig=(a,b)=>{const keys2=[.../* @__PURE__ */new Set([...keysOf(a),...keysOf(b)])],obj={};for(const key of keys2)obj[key]=void 0!==b[key]?b[key]:a[key];return obj},configProviderProps=buildProps({a11y:{type:Boolean,default:!0},locale:{type:Object},size:useSizeProp,button:{type:Object},card:{type:Object},dialog:{type:Object},link:{type:Object},experimentalFeatures:{type:Object},keyboardNavigation:{type:Boolean,default:!0},message:{type:Object},zIndex:Number,namespace:{type:String,default:"el"},table:{type:Object},...useEmptyValuesProps}),messageConfig={placement:"top"},buttonGroupContextKey=(/* @__PURE__ */defineComponent({name:"ElConfigProvider",props:configProviderProps,setup(props,{slots:slots}){const config=provideGlobalConfig(props);return watch(()=>props.message,val=>{Object.assign(messageConfig,config?.value?.message??{},val??{})},{immediate:!0,deep:!0}),()=>renderSlot(slots,"default",{config:config?.value})}}),Symbol("buttonGroupContextKey"));function bound01(n,max){(function(n){return"string"==typeof n&&-1!==n.indexOf(".")&&1===parseFloat(n)})(n)&&(n="100%");const isPercent=function(n){return"string"==typeof n&&-1!==n.indexOf("%")}(n);return n=360===max?n:Math.min(max,Math.max(0,parseFloat(n))),isPercent&&(n=parseInt(String(n*max),10)/100),Math.abs(n-max)<1e-6?1:n=360===max?(n<0?n%max+max:n%max)/parseFloat(String(max)):n%max/parseFloat(String(max))}function clamp01(val){return Math.min(1,Math.max(0,val))}function boundAlpha(a){return a=parseFloat(a),(isNaN(a)||a<0||a>1)&&(a=1),a}function convertToPercentage(n){return Number(n)<=1?100*Number(n)+"%":n}function pad2(c){return 1===c.length?"0"+c:String(c)}function rgbToHsl(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=Math.max(r,g,b),min=Math.min(r,g,b);let h2=0,s=0;const l=(max+min)/2;if(max===min)s=0,h2=0;else{const d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h2=(g-b)/d+(g<b?6:0);break;case g:h2=(b-r)/d+2;break;case b:h2=(r-g)/d+4}h2/=6}return{h:h2,s:s,l:l}}function hue2rgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*t*(q-p):t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}function rgbToHsv(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=Math.max(r,g,b),min=Math.min(r,g,b);let h2=0;const v=max,d=max-min,s=0===max?0:d/max;if(max===min)h2=0;else{switch(max){case r:h2=(g-b)/d+(g<b?6:0);break;case g:h2=(b-r)/d+2;break;case b:h2=(r-g)/d+4}h2/=6}return{h:h2,s:s,v:v}}function rgbToHex(r,g,b,allow3Char){const hex=[pad2(Math.round(r).toString(16)),pad2(Math.round(g).toString(16)),pad2(Math.round(b).toString(16))];return allow3Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0):hex.join("")}function rgbToCmyk(r,g,b){let c=1-r/255,m=1-g/255,y=1-b/255,k=Math.min(c,m,y);return 1===k?(c=0,m=0,y=0):(c=(c-k)/(1-k)*100,m=(m-k)/(1-k)*100,y=(y-k)/(1-k)*100),k*=100,{c:Math.round(c),m:Math.round(m),y:Math.round(y),k:Math.round(k)}}function convertHexToDecimal(h2){return parseIntFromHex(h2)/255}function parseIntFromHex(val){return parseInt(val,16)}const names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(color){let rgb={r:0,g:0,b:0},a=1,s=null,v=null,l=null,ok=!1,format=!1;var r,g,b;return"string"==typeof color&&(color=function(color){if(color=color.trim().toLowerCase(),0===color.length)return!1;let named=!1;if(names[color])color=names[color],named=!0;else if("transparent"===color)return{r:0,g:0,b:0,a:0,format:"name"};let match=matchers.rgb.exec(color);if(match)return{r:match[1],g:match[2],b:match[3]};if(match=matchers.rgba.exec(color),match)return{r:match[1],g:match[2],b:match[3],a:match[4]};if(match=matchers.hsl.exec(color),match)return{h:match[1],s:match[2],l:match[3]};if(match=matchers.hsla.exec(color),match)return{h:match[1],s:match[2],l:match[3],a:match[4]};if(match=matchers.hsv.exec(color),match)return{h:match[1],s:match[2],v:match[3]};if(match=matchers.hsva.exec(color),match)return{h:match[1],s:match[2],v:match[3],a:match[4]};if(match=matchers.cmyk.exec(color),match)return{c:match[1],m:match[2],y:match[3],k:match[4]};if(match=matchers.hex8.exec(color),match)return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),a:convertHexToDecimal(match[4]),format:named?"name":"hex8"};if(match=matchers.hex6.exec(color),match)return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"};if(match=matchers.hex4.exec(color),match)return{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),a:convertHexToDecimal(match[4]+match[4]),format:named?"name":"hex8"};if(match=matchers.hex3.exec(color),match)return{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),format:named?"name":"hex"};return!1}(color)),"object"==typeof color&&(isValidCSSUnit(color.r)&&isValidCSSUnit(color.g)&&isValidCSSUnit(color.b)?(r=color.r,g=color.g,b=color.b,rgb={r:255*bound01(r,255),g:255*bound01(g,255),b:255*bound01(b,255)},ok=!0,format="%"===String(color.r).substr(-1)?"prgb":"rgb"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.v)?(s=convertToPercentage(color.s),v=convertToPercentage(color.v),rgb=function(h2,s,v){h2=6*bound01(h2,360),s=bound01(s,100),v=bound01(v,100);const i=Math.floor(h2),f=h2-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6;return{r:255*[v,q,p,p,t,v][mod],g:255*[t,v,v,q,p,p][mod],b:255*[p,p,t,v,v,q][mod]}}(color.h,s,v),ok=!0,format="hsv"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.l)?(s=convertToPercentage(color.s),l=convertToPercentage(color.l),rgb=function(h2,s,l){let r,g,b;if(h2=bound01(h2,360),s=bound01(s,100),l=bound01(l,100),0===s)g=l,b=l,r=l;else{const q=l<.5?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h2+1/3),g=hue2rgb(p,q,h2),b=hue2rgb(p,q,h2-1/3)}return{r:255*r,g:255*g,b:255*b}}(color.h,s,l),ok=!0,format="hsl"):isValidCSSUnit(color.c)&&isValidCSSUnit(color.m)&&isValidCSSUnit(color.y)&&isValidCSSUnit(color.k)&&(rgb=function(c,m,y,k){const kConv=k/100;return{r:255*(1-c/100)*(1-kConv),g:255*(1-m/100)*(1-kConv),b:255*(1-y/100)*(1-kConv)}}(color.c,color.m,color.y,color.k),ok=!0,format="cmyk"),Object.prototype.hasOwnProperty.call(color,"a")&&(a=color.a)),a=boundAlpha(a),{ok:ok,format:color.format||format,r:Math.min(255,Math.max(rgb.r,0)),g:Math.min(255,Math.max(rgb.g,0)),b:Math.min(255,Math.max(rgb.b,0)),a:a}}const CSS_UNIT="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),cmyk:new RegExp("cmyk"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function isValidCSSUnit(color){return"number"==typeof color?!Number.isNaN(color):matchers.CSS_UNIT.test(color)}class TinyColor{constructor(color="",opts={}){if(color instanceof TinyColor)return color;"number"==typeof color&&(color=function(color){return{r:color>>16,g:(65280&color)>>8,b:255&color}}(color)),this.originalInput=color;const rgb=inputToRGB(color);this.originalInput=color,this.r=rgb.r,this.g=rgb.g,this.b=rgb.b,this.a=rgb.a,this.roundA=Math.round(100*this.a)/100,this.format=opts.format??rgb.format,this.gradientType=opts.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=rgb.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const rgb=this.toRgb();return(299*rgb.r+587*rgb.g+114*rgb.b)/1e3}getLuminance(){const rgb=this.toRgb();let R2,G2,B2;const RsRGB=rgb.r/255,GsRGB=rgb.g/255,BsRGB=rgb.b/255;return R2=RsRGB<=.03928?RsRGB/12.92:Math.pow((RsRGB+.055)/1.055,2.4),G2=GsRGB<=.03928?GsRGB/12.92:Math.pow((GsRGB+.055)/1.055,2.4),B2=BsRGB<=.03928?BsRGB/12.92:Math.pow((BsRGB+.055)/1.055,2.4),.2126*R2+.7152*G2+.0722*B2}getAlpha(){return this.a}setAlpha(alpha){return this.a=boundAlpha(alpha),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:s}=this.toHsl();return 0===s}toHsv(){const hsv=rgbToHsv(this.r,this.g,this.b);return{h:360*hsv.h,s:hsv.s,v:hsv.v,a:this.a}}toHsvString(){const hsv=rgbToHsv(this.r,this.g,this.b),h2=Math.round(360*hsv.h),s=Math.round(100*hsv.s),v=Math.round(100*hsv.v);return 1===this.a?`hsv(${h2}, ${s}%, ${v}%)`:`hsva(${h2}, ${s}%, ${v}%, ${this.roundA})`}toHsl(){const hsl=rgbToHsl(this.r,this.g,this.b);return{h:360*hsl.h,s:hsl.s,l:hsl.l,a:this.a}}toHslString(){const hsl=rgbToHsl(this.r,this.g,this.b),h2=Math.round(360*hsl.h),s=Math.round(100*hsl.s),l=Math.round(100*hsl.l);return 1===this.a?`hsl(${h2}, ${s}%, ${l}%)`:`hsla(${h2}, ${s}%, ${l}%, ${this.roundA})`}toHex(allow3Char=!1){return rgbToHex(this.r,this.g,this.b,allow3Char)}toHexString(allow3Char=!1){return"#"+this.toHex(allow3Char)}toHex8(allow4Char=!1){return function(r,g,b,a,allow4Char){const hex=[pad2(Math.round(r).toString(16)),pad2(Math.round(g).toString(16)),pad2(Math.round(b).toString(16)),pad2((d=a,Math.round(255*parseFloat(d)).toString(16)))];var d;return allow4Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))&&hex[3].startsWith(hex[3].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0):hex.join("")}(this.r,this.g,this.b,this.a,allow4Char)}toHex8String(allow4Char=!1){return"#"+this.toHex8(allow4Char)}toHexShortString(allowShortChar=!1){return 1===this.a?this.toHexString(allowShortChar):this.toHex8String(allowShortChar)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const r=Math.round(this.r),g=Math.round(this.g),b=Math.round(this.b);return 1===this.a?`rgb(${r}, ${g}, ${b})`:`rgba(${r}, ${g}, ${b}, ${this.roundA})`}toPercentageRgb(){const fmt=x=>`${Math.round(100*bound01(x,255))}%`;return{r:fmt(this.r),g:fmt(this.g),b:fmt(this.b),a:this.a}}toPercentageRgbString(){const rnd=x=>Math.round(100*bound01(x,255));return 1===this.a?`rgb(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%)`:`rgba(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%, ${this.roundA})`}toCmyk(){return{...rgbToCmyk(this.r,this.g,this.b)}}toCmykString(){const{c:c,m:m,y:y,k:k}=rgbToCmyk(this.r,this.g,this.b);return`cmyk(${c}, ${m}, ${y}, ${k})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const hex="#"+rgbToHex(this.r,this.g,this.b,!1);for(const[key,value]of Object.entries(names))if(hex===value)return key;return!1}toString(format){const formatSet=Boolean(format);format=format??this.format;let formattedString=!1;const hasAlpha=this.a<1&&this.a>=0;return formatSet||!hasAlpha||!format.startsWith("hex")&&"name"!==format?("rgb"===format&&(formattedString=this.toRgbString()),"prgb"===format&&(formattedString=this.toPercentageRgbString()),"hex"!==format&&"hex6"!==format||(formattedString=this.toHexString()),"hex3"===format&&(formattedString=this.toHexString(!0)),"hex4"===format&&(formattedString=this.toHex8String(!0)),"hex8"===format&&(formattedString=this.toHex8String()),"name"===format&&(formattedString=this.toName()),"hsl"===format&&(formattedString=this.toHslString()),"hsv"===format&&(formattedString=this.toHsvString()),"cmyk"===format&&(formattedString=this.toCmykString()),formattedString||this.toHexString()):"name"===format&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new TinyColor(this.toString())}lighten(amount=10){const hsl=this.toHsl();return hsl.l+=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}brighten(amount=10){const rgb=this.toRgb();return rgb.r=Math.max(0,Math.min(255,rgb.r-Math.round(-amount/100*255))),rgb.g=Math.max(0,Math.min(255,rgb.g-Math.round(-amount/100*255))),rgb.b=Math.max(0,Math.min(255,rgb.b-Math.round(-amount/100*255))),new TinyColor(rgb)}darken(amount=10){const hsl=this.toHsl();return hsl.l-=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}tint(amount=10){return this.mix("white",amount)}shade(amount=10){return this.mix("black",amount)}desaturate(amount=10){const hsl=this.toHsl();return hsl.s-=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}saturate(amount=10){const hsl=this.toHsl();return hsl.s+=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}greyscale(){return this.desaturate(100)}spin(amount){const hsl=this.toHsl(),hue=(hsl.h+amount)%360;return hsl.h=hue<0?360+hue:hue,new TinyColor(hsl)}mix(color,amount=50){const rgb1=this.toRgb(),rgb2=new TinyColor(color).toRgb(),p=amount/100,rgba={r:(rgb2.r-rgb1.r)*p+rgb1.r,g:(rgb2.g-rgb1.g)*p+rgb1.g,b:(rgb2.b-rgb1.b)*p+rgb1.b,a:(rgb2.a-rgb1.a)*p+rgb1.a};return new TinyColor(rgba)}analogous(results=6,slices=30){const hsl=this.toHsl(),part=360/slices,ret=[this];for(hsl.h=(hsl.h-(part*results>>1)+720)%360;--results;)hsl.h=(hsl.h+part)%360,ret.push(new TinyColor(hsl));return ret}complement(){const hsl=this.toHsl();return hsl.h=(hsl.h+180)%360,new TinyColor(hsl)}monochromatic(results=6){const hsv=this.toHsv(),{h:h2}=hsv,{s:s}=hsv;let{v:v}=hsv;const res=[],modification=1/results;for(;results--;)res.push(new TinyColor({h:h2,s:s,v:v})),v=(v+modification)%1;return res}splitcomplement(){const hsl=this.toHsl(),{h:h2}=hsl;return[this,new TinyColor({h:(h2+72)%360,s:hsl.s,l:hsl.l}),new TinyColor({h:(h2+216)%360,s:hsl.s,l:hsl.l})]}onBackground(background){const fg=this.toRgb(),bg=new TinyColor(background).toRgb(),alpha=fg.a+bg.a*(1-fg.a);return new TinyColor({r:(fg.r*fg.a+bg.r*bg.a*(1-fg.a))/alpha,g:(fg.g*fg.a+bg.g*bg.a*(1-fg.a))/alpha,b:(fg.b*fg.a+bg.b*bg.a*(1-fg.a))/alpha,a:alpha})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(n){const hsl=this.toHsl(),{h:h2}=hsl,result=[this],increment=360/n;for(let i=1;i<n;i++)result.push(new TinyColor({h:(h2+i*increment)%360,s:hsl.s,l:hsl.l}));return result}equals(color){const comparedColor=new TinyColor(color);return"cmyk"===this.format||"cmyk"===comparedColor.format?this.toCmykString()===comparedColor.toCmykString():this.toRgbString()===comparedColor.toRgbString()}}function darken(color,amount=20){return color.mix("#141414",amount).toString()}var button_default=/* @__PURE__ */defineComponent({name:"ElButton",__name:"button",props:buttonProps,emits:buttonEmits,setup(__props,{expose:__expose,emit:__emit}){const props=__props,emit=__emit,buttonStyle=function(props){const _disabled=useFormDisabled(),ns=useNamespace("button");return computed(()=>{let styles={},buttonColor=props.color;if(buttonColor){const match=buttonColor.match(/var\((.*?)\)/);match&&(buttonColor=window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]));const color=new TinyColor(buttonColor),activeBgColor=props.dark?color.tint(20).toString():darken(color,20);if(props.plain)styles=ns.cssVarBlock({"bg-color":props.dark?darken(color,90):color.tint(90).toString(),"text-color":buttonColor,"border-color":props.dark?darken(color,50):color.tint(50).toString(),"hover-text-color":`var(${ns.cssVarName("color-white")})`,"hover-bg-color":buttonColor,"hover-border-color":buttonColor,"active-bg-color":activeBgColor,"active-text-color":`var(${ns.cssVarName("color-white")})`,"active-border-color":activeBgColor}),_disabled.value&&(styles[ns.cssVarBlockName("disabled-bg-color")]=props.dark?darken(color,90):color.tint(90).toString(),styles[ns.cssVarBlockName("disabled-text-color")]=props.dark?darken(color,50):color.tint(50).toString(),styles[ns.cssVarBlockName("disabled-border-color")]=props.dark?darken(color,80):color.tint(80).toString());else{const hoverBgColor=props.dark?darken(color,30):color.tint(30).toString(),textColor=color.isDark()?`var(${ns.cssVarName("color-white")})`:`var(${ns.cssVarName("color-black")})`;if(styles=ns.cssVarBlock({"bg-color":buttonColor,"text-color":textColor,"border-color":buttonColor,"hover-bg-color":hoverBgColor,"hover-text-color":textColor,"hover-border-color":hoverBgColor,"active-bg-color":activeBgColor,"active-border-color":activeBgColor}),_disabled.value){const disabledButtonColor=props.dark?darken(color,50):color.tint(50).toString();styles[ns.cssVarBlockName("disabled-bg-color")]=disabledButtonColor,styles[ns.cssVarBlockName("disabled-text-color")]=props.dark?"rgba(255, 255, 255, 0.5)":`var(${ns.cssVarName("color-white")})`,styles[ns.cssVarBlockName("disabled-border-color")]=disabledButtonColor}}}return styles})}(props),ns=useNamespace("button"),{_ref:_ref,_size:_size,_type:_type,_disabled:_disabled,_props:_props,_plain:_plain,_round:_round,_text:_text,_dashed:_dashed,shouldAddSpace:shouldAddSpace,handleClick:handleClick}=((props,emit)=>{useDeprecated({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},computed(()=>"text"===props.type));const buttonGroupContext=inject(buttonGroupContextKey,void 0),globalConfig2=useGlobalConfig("button"),{form:form}=useFormItem(),_size=useFormSize(computed(()=>buttonGroupContext?.size)),_disabled=useFormDisabled(),_ref=ref(),slots=useSlots(),_type=computed(()=>props.type||buttonGroupContext?.type||globalConfig2.value?.type||""),autoInsertSpace=computed(()=>props.autoInsertSpace??globalConfig2.value?.autoInsertSpace??!1),_plain=computed(()=>props.plain??globalConfig2.value?.plain??!1),_round=computed(()=>props.round??globalConfig2.value?.round??!1),_text=computed(()=>props.text??globalConfig2.value?.text??!1),_dashed=computed(()=>props.dashed??globalConfig2.value?.dashed??!1),_props=computed(()=>"button"===props.tag?{ariaDisabled:_disabled.value||props.loading,disabled:_disabled.value||props.loading,autofocus:props.autofocus,type:props.nativeType}:{}),shouldAddSpace=computed(()=>{const defaultSlot=slots.default?.();if(autoInsertSpace.value&&1===defaultSlot?.length){const slot=defaultSlot[0];if(slot?.type===Text){const text=slot.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(text.trim())}}return!1});return{_disabled:_disabled,_size:_size,_type:_type,_ref:_ref,_props:_props,_plain:_plain,_round:_round,_text:_text,_dashed:_dashed,shouldAddSpace:shouldAddSpace,handleClick:evt=>{_disabled.value||props.loading?evt.stopPropagation():("reset"===props.nativeType&&form?.resetFields(),emit("click",evt))}}})(props,emit),buttonKls=computed(()=>[ns.b(),ns.m(_type.value),ns.m(_size.value),ns.is("disabled",_disabled.value),ns.is("loading",props.loading),ns.is("plain",_plain.value),ns.is("round",_round.value),ns.is("circle",props.circle),ns.is("text",_text.value),ns.is("dashed",_dashed.value),ns.is("link",props.link),ns.is("has-bg",props.bg)]);return __expose({ref:_ref,size:_size,type:_type,disabled:_disabled,shouldAddSpace:shouldAddSpace}),(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(__props.tag),mergeProps({ref_key:"_ref",ref:_ref},unref(_props),{class:buttonKls.value,style:unref(buttonStyle),onClick:unref(handleClick)}),{default:withCtx(()=>[__props.loading?(openBlock(),createElementBlock(Fragment,{key:0},[_ctx.$slots.loading?renderSlot(_ctx.$slots,"loading",{key:0}):(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass(unref(ns).is("loading"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(__props.loadingIcon)))]),_:1},8,["class"]))],64)):__props.icon||_ctx.$slots.icon?(openBlock(),createBlock(unref(ElIcon),{key:1},{default:withCtx(()=>[__props.icon?(openBlock(),createBlock(resolveDynamicComponent(__props.icon),{key:0})):renderSlot(_ctx.$slots,"icon",{key:1})]),_:3})):createCommentVNode("v-if",!0),_ctx.$slots.default?(openBlock(),createElementBlock("span",{key:2,class:normalizeClass({[unref(ns).em("text","expand")]:unref(shouldAddSpace)})},[renderSlot(_ctx.$slots,"default")],2)):createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var button_group_default=/* @__PURE__ */defineComponent({name:"ElButtonGroup",__name:"button-group",props:{size:buttonProps.size,type:buttonProps.type,direction:{type:String,values:["horizontal","vertical"],default:"horizontal"}},setup(__props){const props=__props;provide(buttonGroupContextKey,reactive({size:toRef(props,"size"),type:toRef(props,"type")}));const ns=useNamespace("button");return(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(ns).b("group"),unref(ns).bm("group",props.direction)])},[renderSlot(_ctx.$slots,"default")],2))}});const ElButton=withInstall(button_default,{ButtonGroup:button_group_default});withNoopInstall(button_group_default);var hasRequiredDayjs_min,dayjs_min$1={exports:{}};hasRequiredDayjs_min||(hasRequiredDayjs_min=1,dayjs_min$1.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h2="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t2){var e2=["th","st","nd","rd"],n2=t2%100;return"["+t2+(e2[(n2-20)%10]||e2[n2]||e2[0])+"]"}},m=function(t2,e2,n2){var r2=String(t2);return!r2||r2.length>=e2?t2:""+Array(e2+1-r2.length).join(n2)+t2},v={s:m,z:function(t2){var e2=-t2.utcOffset(),n2=Math.abs(e2),r2=Math.floor(n2/60),i2=n2%60;return(e2<=0?"+":"-")+m(r2,2,"0")+":"+m(i2,2,"0")},m:function t2(e2,n2){if(e2.date()<n2.date())return-t2(n2,e2);var r2=12*(n2.year()-e2.year())+(n2.month()-e2.month()),i2=e2.clone().add(r2,c),s2=n2-i2<0,u2=e2.clone().add(r2+(s2?-1:1),c);return+(-(r2+(n2-i2)/(s2?i2-u2:u2-i2))||0)},a:function(t2){return t2<0?Math.ceil(t2)||0:Math.floor(t2)},p:function(t2){return{M:c,y:h2,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t2]||String(t2||"").toLowerCase().replace(/s$/,"")},u:function(t2){return void 0===t2}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t2){return t2 instanceof _||!(!t2||!t2[p])},w=function t2(e2,n2,r2){var i2;if(!e2)return g;if("string"==typeof e2){var s2=e2.toLowerCase();D[s2]&&(i2=s2),n2&&(D[s2]=n2,i2=s2);var u2=e2.split("-");if(!i2&&u2.length>1)return t2(u2[0])}else{var a2=e2.name;D[a2]=e2,i2=a2}return!r2&&i2&&(g=i2),i2||!r2&&g},O=function(t2,e2){if(S(t2))return t2.clone();var n2="object"==typeof e2?e2:{};return n2.date=t2,n2.args=arguments,new _(n2)},b=v;b.l=w,b.i=S,b.w=function(t2,e2){return O(t2,{locale:e2.$L,utc:e2.$u,x:e2.$x,$offset:e2.$offset})};var _=function(){function M2(t2){this.$L=w(t2.locale,null,!0),this.parse(t2),this.$x=this.$x||t2.x||{},this[p]=!0}var m2=M2.prototype;return m2.parse=function(t2){this.$d=function(t3){var e2=t3.date,n2=t3.utc;if(null===e2)/* @__PURE__ */return new Date(NaN);if(b.u(e2))/* @__PURE__ */return new Date;if(e2 instanceof Date)return new Date(e2);if("string"==typeof e2&&!/Z$/i.test(e2)){var r2=e2.match($);if(r2){var i2=r2[2]-1||0,s2=(r2[7]||"0").substring(0,3);return n2?new Date(Date.UTC(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s2)):new Date(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s2)}}return new Date(e2)}(t2),this.init()},m2.init=function(){var t2=this.$d;this.$y=t2.getFullYear(),this.$M=t2.getMonth(),this.$D=t2.getDate(),this.$W=t2.getDay(),this.$H=t2.getHours(),this.$m=t2.getMinutes(),this.$s=t2.getSeconds(),this.$ms=t2.getMilliseconds()},m2.$utils=function(){return b},m2.isValid=function(){return!(this.$d.toString()===l)},m2.isSame=function(t2,e2){var n2=O(t2);return this.startOf(e2)<=n2&&n2<=this.endOf(e2)},m2.isAfter=function(t2,e2){return O(t2)<this.startOf(e2)},m2.isBefore=function(t2,e2){return this.endOf(e2)<O(t2)},m2.$g=function(t2,e2,n2){return b.u(t2)?this[e2]:this.set(n2,t2)},m2.unix=function(){return Math.floor(this.valueOf()/1e3)},m2.valueOf=function(){return this.$d.getTime()},m2.startOf=function(t2,e2){var n2=this,r2=!!b.u(e2)||e2,f2=b.p(t2),l2=function(t3,e3){var i2=b.w(n2.$u?Date.UTC(n2.$y,e3,t3):new Date(n2.$y,e3,t3),n2);return r2?i2:i2.endOf(a)},$2=function(t3,e3){return b.w(n2.toDate()[t3].apply(n2.toDate("s"),(r2?[0,0,0,0]:[23,59,59,999]).slice(e3)),n2)},y2=this.$W,M3=this.$M,m3=this.$D,v2="set"+(this.$u?"UTC":"");switch(f2){case h2:return r2?l2(1,0):l2(31,11);case c:return r2?l2(1,M3):l2(0,M3+1);case o:var g2=this.$locale().weekStart||0,D2=(y2<g2?y2+7:y2)-g2;return l2(r2?m3-D2:m3+(6-D2),M3);case a:case d:return $2(v2+"Hours",0);case u:return $2(v2+"Minutes",1);case s:return $2(v2+"Seconds",2);case i:return $2(v2+"Milliseconds",3);default:return this.clone()}},m2.endOf=function(t2){return this.startOf(t2,!1)},m2.$set=function(t2,e2){var n2,o2=b.p(t2),f2="set"+(this.$u?"UTC":""),l2=(n2={},n2[a]=f2+"Date",n2[d]=f2+"Date",n2[c]=f2+"Month",n2[h2]=f2+"FullYear",n2[u]=f2+"Hours",n2[s]=f2+"Minutes",n2[i]=f2+"Seconds",n2[r]=f2+"Milliseconds",n2)[o2],$2=o2===a?this.$D+(e2-this.$W):e2;if(o2===c||o2===h2){var y2=this.clone().set(d,1);y2.$d[l2]($2),y2.init(),this.$d=y2.set(d,Math.min(this.$D,y2.daysInMonth())).$d}else l2&&this.$d[l2]($2);return this.init(),this},m2.set=function(t2,e2){return this.clone().$set(t2,e2)},m2.get=function(t2){return this[b.p(t2)]()},m2.add=function(r2,f2){var d2,l2=this;r2=Number(r2);var $2=b.p(f2),y2=function(t2){var e2=O(l2);return b.w(e2.date(e2.date()+Math.round(t2*r2)),l2)};if($2===c)return this.set(c,this.$M+r2);if($2===h2)return this.set(h2,this.$y+r2);if($2===a)return y2(1);if($2===o)return y2(7);var M3=(d2={},d2[s]=e,d2[u]=n,d2[i]=t,d2)[$2]||1,m3=this.$d.getTime()+r2*M3;return b.w(m3,this)},m2.subtract=function(t2,e2){return this.add(-1*t2,e2)},m2.format=function(t2){var e2=this,n2=this.$locale();if(!this.isValid())return n2.invalidDate||l;var r2=t2||"YYYY-MM-DDTHH:mm:ssZ",i2=b.z(this),s2=this.$H,u2=this.$m,a2=this.$M,o2=n2.weekdays,c2=n2.months,f2=n2.meridiem,h3=function(t3,n3,i3,s3){return t3&&(t3[n3]||t3(e2,r2))||i3[n3].slice(0,s3)},d2=function(t3){return b.s(s2%12||12,t3,"0")},$2=f2||function(t3,e3,n3){var r3=t3<12?"AM":"PM";return n3?r3.toLowerCase():r3};return r2.replace(y,function(t3,r3){return r3||function(t4){switch(t4){case"YY":return String(e2.$y).slice(-2);case"YYYY":return b.s(e2.$y,4,"0");case"M":return a2+1;case"MM":return b.s(a2+1,2,"0");case"MMM":return h3(n2.monthsShort,a2,c2,3);case"MMMM":return h3(c2,a2);case"D":return e2.$D;case"DD":return b.s(e2.$D,2,"0");case"d":return String(e2.$W);case"dd":return h3(n2.weekdaysMin,e2.$W,o2,2);case"ddd":return h3(n2.weekdaysShort,e2.$W,o2,3);case"dddd":return o2[e2.$W];case"H":return String(s2);case"HH":return b.s(s2,2,"0");case"h":return d2(1);case"hh":return d2(2);case"a":return $2(s2,u2,!0);case"A":return $2(s2,u2,!1);case"m":return String(u2);case"mm":return b.s(u2,2,"0");case"s":return String(e2.$s);case"ss":return b.s(e2.$s,2,"0");case"SSS":return b.s(e2.$ms,3,"0");case"Z":return i2}return null}(t3)||i2.replace(":","")})},m2.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m2.diff=function(r2,d2,l2){var $2,y2=this,M3=b.p(d2),m3=O(r2),v2=(m3.utcOffset()-this.utcOffset())*e,g2=this-m3,D2=function(){return b.m(y2,m3)};switch(M3){case h2:$2=D2()/12;break;case c:$2=D2();break;case f:$2=D2()/3;break;case o:$2=(g2-v2)/6048e5;break;case a:$2=(g2-v2)/864e5;break;case u:$2=g2/n;break;case s:$2=g2/e;break;case i:$2=g2/t;break;default:$2=g2}return l2?$2:b.a($2)},m2.daysInMonth=function(){return this.endOf(c).$D},m2.$locale=function(){return D[this.$L]},m2.locale=function(t2,e2){if(!t2)return this.$L;var n2=this.clone(),r2=w(t2,e2,!0);return r2&&(n2.$L=r2),n2},m2.clone=function(){return b.w(this.$d,this)},m2.toDate=function(){return new Date(this.valueOf())},m2.toJSON=function(){return this.isValid()?this.toISOString():null},m2.toISOString=function(){return this.$d.toISOString()},m2.toString=function(){return this.$d.toUTCString()},M2}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h2],["$D",d]].forEach(function(t2){k[t2[1]]=function(e2){return this.$g(e2,t2[0],t2[1])}}),O.extend=function(t2,e2){return t2.$i||(t2(e2,_,O),t2.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t2){return O(1e3*t2)},O.en=D[g],O.Ls=D,O.p={},O}());const checkboxProps={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:{type:Boolean,default:void 0},checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:useSizeProp,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},ariaLabel:String,...useAriaProps(["ariaControls"])},checkboxEmits={[UPDATE_MODEL_EVENT]:val=>isString(val)||isNumber(val)||isBoolean(val),change:val=>isString(val)||isNumber(val)||isBoolean(val)},checkboxGroupContextKey=/* @__PURE__ */Symbol("checkboxGroupContextKey"),checkboxGroupProps=buildProps({modelValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:void 0},min:Number,max:Number,size:useSizeProp,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},options:{type:Array},props:{type:Object,default:()=>checkboxDefaultProps},type:{type:String,values:["checkbox","button"],default:"checkbox"},...useAriaProps(["ariaLabel"])}),checkboxGroupEmits={[UPDATE_MODEL_EVENT]:val=>isArray$1(val),change:val=>isArray$1(val)},checkboxDefaultProps={label:"label",value:"value",disabled:"disabled"},useCheckboxEvent=(props,{model:model,isLimitExceeded:isLimitExceeded,hasOwnLabel:hasOwnLabel,isDisabled:isDisabled,isLabeledByFormItem:isLabeledByFormItem})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),{formItem:formItem}=useFormItem(),{emit:emit}=getCurrentInstance();function getLabeledValue(value){return[!0,props.trueValue,props.trueLabel].includes(value)?props.trueValue??props.trueLabel??!0:props.falseValue??props.falseLabel??!1}const validateEvent=computed(()=>checkboxGroup?.validateEvent||props.validateEvent);return watch(()=>props.modelValue,()=>{validateEvent.value&&formItem?.validate("change").catch(err=>debugWarn(err))}),{handleChange:function(e){if(isLimitExceeded.value)return;const target=e.target;emit("change",getLabeledValue(target.checked),e)},onClickRoot:async function(e){isLimitExceeded.value||hasOwnLabel.value||isDisabled.value||!isLabeledByFormItem.value||e.composedPath().some(item=>"LABEL"===item.tagName)||(model.value=getLabeledValue([!1,props.falseValue,props.falseLabel].includes(model.value)),await nextTick(),function(checked,e){emit("change",getLabeledValue(checked),e)}(model.value,e))}}},useCheckbox=(props,slots)=>{const{formItem:elFormItem}=useFormItem(),{model:model,isGroup:isGroup,isLimitExceeded:isLimitExceeded}=(props=>{const selfModel=ref(!1),{emit:emit}=getCurrentInstance(),checkboxGroup=inject(checkboxGroupContextKey,void 0),isGroup=computed(()=>!1===isUndefined(checkboxGroup)),isLimitExceeded=ref(!1),model=computed({get:()=>isGroup.value?checkboxGroup?.modelValue?.value:props.modelValue??selfModel.value,set(val){isGroup.value&&isArray$1(val)?(isLimitExceeded.value=void 0!==checkboxGroup?.max?.value&&val.length>checkboxGroup?.max.value&&val.length>model.value.length,!1===isLimitExceeded.value&&checkboxGroup?.changeEvent?.(val)):(emit("update:modelValue",val),selfModel.value=val)}});return{model:model,isGroup:isGroup,isLimitExceeded:isLimitExceeded}})(props),{isFocused:isFocused,isChecked:isChecked,checkboxButtonSize:checkboxButtonSize,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,actualValue:actualValue}=((props,slots,{model:model})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),isFocused=ref(!1),actualValue=computed(()=>isPropAbsent(props.value)?props.label:props.value),isChecked=computed(()=>{const value=model.value;return isBoolean(value)?value:isArray$1(value)?isObject$2(actualValue.value)?value.map(toRaw).some(o=>isEqual(o,actualValue.value)):value.map(toRaw).includes(actualValue.value):null!=value?value===props.trueValue||value===props.trueLabel:!!value});return{checkboxButtonSize:useFormSize(computed(()=>checkboxGroup?.size?.value),{prop:!0}),isChecked:isChecked,isFocused:isFocused,checkboxSize:useFormSize(computed(()=>checkboxGroup?.size?.value)),hasOwnLabel:computed(()=>!!slots.default||!isPropAbsent(actualValue.value)),actualValue:actualValue}})(props,slots,{model:model}),{isDisabled:isDisabled}=(({model:model,isChecked:isChecked})=>{const checkboxGroup=inject(checkboxGroupContextKey,void 0),formContext=inject(formContextKey,void 0),isLimitDisabled=computed(()=>{const max=checkboxGroup?.max?.value,min=checkboxGroup?.min?.value;return!isUndefined(max)&&model.value.length>=max&&!isChecked.value||!isUndefined(min)&&model.value.length<=min&&isChecked.value});return{isDisabled:useFormDisabled(computed(()=>void 0===checkboxGroup?formContext?.disabled??isLimitDisabled.value:checkboxGroup.disabled?.value||isLimitDisabled.value)),isLimitDisabled:isLimitDisabled}})({model:model,isChecked:isChecked}),{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem}=useFormItemInputId(props,{formItemContext:elFormItem,disableIdGeneration:hasOwnLabel,disableIdManagement:isGroup}),{handleChange:handleChange,onClickRoot:onClickRoot}=useCheckboxEvent(props,{model:model,isLimitExceeded:isLimitExceeded,hasOwnLabel:hasOwnLabel,isDisabled:isDisabled,isLabeledByFormItem:isLabeledByFormItem});return props.checked&&(isArray$1(model.value)&&!model.value.includes(actualValue.value)?model.value.push(actualValue.value):model.value=props.trueValue??props.trueLabel??!0),useDeprecated({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>isGroup.value&&isPropAbsent(props.value))),useDeprecated({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>!!props.trueLabel)),useDeprecated({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},computed(()=>!!props.falseLabel)),{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem,isChecked:isChecked,isDisabled:isDisabled,isFocused:isFocused,checkboxButtonSize:checkboxButtonSize,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,model:model,actualValue:actualValue,handleChange:handleChange,onClickRoot:onClickRoot}},_hoisted_1$9=["id","indeterminate","name","tabindex","disabled"];var checkbox_default=/* @__PURE__ */defineComponent({name:"ElCheckbox",__name:"checkbox",props:checkboxProps,emits:checkboxEmits,setup(__props){const props=__props,{inputId:inputId,isLabeledByFormItem:isLabeledByFormItem,isChecked:isChecked,isDisabled:isDisabled,isFocused:isFocused,checkboxSize:checkboxSize,hasOwnLabel:hasOwnLabel,model:model,actualValue:actualValue,handleChange:handleChange,onClickRoot:onClickRoot}=useCheckbox(props,useSlots()),inputBindings=computed(()=>props.trueValue||props.falseValue||props.trueLabel||props.falseLabel?{"true-value":props.trueValue??props.trueLabel??!0,"false-value":props.falseValue??props.falseLabel??!1}:{value:actualValue.value}),ns=useNamespace("checkbox"),compKls=computed(()=>[ns.b(),ns.m(checkboxSize.value),ns.is("disabled",isDisabled.value),ns.is("bordered",props.border),ns.is("checked",isChecked.value)]),spanKls=computed(()=>[ns.e("input"),ns.is("disabled",isDisabled.value),ns.is("checked",isChecked.value),ns.is("indeterminate",props.indeterminate),ns.is("focus",isFocused.value)]);return(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(!unref(hasOwnLabel)&&unref(isLabeledByFormItem)?"span":"label"),{for:!unref(hasOwnLabel)&&unref(isLabeledByFormItem)?null:unref(inputId),class:normalizeClass(compKls.value),"aria-controls":__props.indeterminate?__props.ariaControls:null,"aria-checked":__props.indeterminate?"mixed":void 0,"aria-label":__props.ariaLabel,onClick:unref(onClickRoot)},{default:withCtx(()=>[createElementVNode("span",{class:normalizeClass(spanKls.value)},[withDirectives(createElementVNode("input",mergeProps({id:unref(inputId),"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(model)?model.value=$event:null),class:unref(ns).e("original"),type:"checkbox",indeterminate:__props.indeterminate,name:__props.name,tabindex:__props.tabindex,disabled:unref(isDisabled)},inputBindings.value,{onChange:_cache[1]||(_cache[1]=(...args)=>unref(handleChange)&&unref(handleChange)(...args)),onFocus:_cache[2]||(_cache[2]=$event=>isFocused.value=!0),onBlur:_cache[3]||(_cache[3]=$event=>isFocused.value=!1),onClick:_cache[4]||(_cache[4]=withModifiers(()=>{},["stop"]))}),null,16,_hoisted_1$9),[[vModelCheckbox,unref(model)]]),createElementVNode("span",{class:normalizeClass(unref(ns).e("inner"))},null,2)],2),unref(hasOwnLabel)?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(ns).e("label"))},[renderSlot(_ctx.$slots,"default"),_ctx.$slots.default?createCommentVNode("v-if",!0):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(__props.label),1)],64))],2)):createCommentVNode("v-if",!0)]),_:3},8,["for","class","aria-controls","aria-checked","aria-label","onClick"]))}});const _hoisted_1$8=["name","tabindex","disabled"];var checkbox_button_default=/* @__PURE__ */defineComponent({name:"ElCheckboxButton",__name:"checkbox-button",props:checkboxProps,emits:checkboxEmits,setup(__props){const props=__props,{isFocused:isFocused,isChecked:isChecked,isDisabled:isDisabled,checkboxButtonSize:checkboxButtonSize,model:model,actualValue:actualValue,handleChange:handleChange}=useCheckbox(props,useSlots()),inputBindings=computed(()=>props.trueValue||props.falseValue||props.trueLabel||props.falseLabel?{"true-value":props.trueValue??props.trueLabel??!0,"false-value":props.falseValue??props.falseLabel??!1}:{value:actualValue.value}),checkboxGroup=inject(checkboxGroupContextKey,void 0),ns=useNamespace("checkbox"),activeStyle=computed(()=>{const fillValue=checkboxGroup?.fill?.value??"";return{backgroundColor:fillValue,borderColor:fillValue,color:checkboxGroup?.textColor?.value??"",boxShadow:fillValue?`-1px 0 0 0 ${fillValue}`:void 0}}),labelKls=computed(()=>[ns.b("button"),ns.bm("button",checkboxButtonSize.value),ns.is("disabled",isDisabled.value),ns.is("checked",isChecked.value),ns.is("focus",isFocused.value)]);return(_ctx,_cache)=>(openBlock(),createElementBlock("label",{class:normalizeClass(labelKls.value)},[withDirectives(createElementVNode("input",mergeProps({"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(model)?model.value=$event:null),class:unref(ns).be("button","original"),type:"checkbox",name:__props.name,tabindex:__props.tabindex,disabled:unref(isDisabled)},inputBindings.value,{onChange:_cache[1]||(_cache[1]=(...args)=>unref(handleChange)&&unref(handleChange)(...args)),onFocus:_cache[2]||(_cache[2]=$event=>isFocused.value=!0),onBlur:_cache[3]||(_cache[3]=$event=>isFocused.value=!1),onClick:_cache[4]||(_cache[4]=withModifiers(()=>{},["stop"]))}),null,16,_hoisted_1$8),[[vModelCheckbox,unref(model)]]),_ctx.$slots.default||__props.label?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(ns).be("button","inner")),style:normalizeStyle(unref(isChecked)?activeStyle.value:void 0)},[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(__props.label),1)])],6)):createCommentVNode("v-if",!0)],2))}}),checkbox_group_vue_vue_type_script_setup_true_lang_default=/* @__PURE__ */defineComponent({name:"ElCheckboxGroup",__name:"checkbox-group",props:checkboxGroupProps,emits:checkboxGroupEmits,setup(__props,{emit:__emit}){const props=__props,emit=__emit,ns=useNamespace("checkbox"),checkboxDisabled=useFormDisabled(),{formItem:formItem}=useFormItem(),{inputId:groupId,isLabeledByFormItem:isLabeledByFormItem}=useFormItemInputId(props,{formItemContext:formItem}),changeEvent=async value=>{emit("update:modelValue",value),await nextTick(),emit("change",value)},modelValue=computed({get:()=>props.modelValue,set(val){changeEvent(val)}}),aliasProps=computed(()=>({...checkboxDefaultProps,...props.props})),optionComponent=computed(()=>"button"===props.type?checkbox_button_default:checkbox_default);return provide(checkboxGroupContextKey,{...pick(toRefs(props),["size","min","max","validateEvent","fill","textColor"]),disabled:checkboxDisabled,modelValue:modelValue,changeEvent:changeEvent}),watch(()=>props.modelValue,(newVal,oldValue)=>{props.validateEvent&&!isEqual(newVal,oldValue)&&formItem?.validate("change").catch(err=>debugWarn(err))}),(_ctx,_cache)=>(openBlock(),createBlock(resolveDynamicComponent(__props.tag),{id:unref(groupId),class:normalizeClass(unref(ns).b("group")),role:"group","aria-label":unref(isLabeledByFormItem)?void 0:__props.ariaLabel||"checkbox-group","aria-labelledby":unref(isLabeledByFormItem)?unref(formItem)?.labelId:void 0},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.options,(item,index)=>(openBlock(),createBlock(resolveDynamicComponent(optionComponent.value),mergeProps({key:index},{ref_for:!0},(option=>{const{label:label,value:value,disabled:disabled}=aliasProps.value,base={label:option[label],value:option[value],disabled:option[disabled]};return{...omit(option,[label,value,disabled]),...base}})(item)),null,16))),128))])]),_:3},8,["id","class","aria-label","aria-labelledby"]))}}),checkbox_group_default=checkbox_group_vue_vue_type_script_setup_true_lang_default;const ElCheckbox=withInstall(checkbox_default,{CheckboxButton:checkbox_button_default,CheckboxGroup:checkbox_group_default});withNoopInstall(checkbox_button_default);withNoopInstall(checkbox_group_default);const composeRefs=(...refs)=>el=>{refs.forEach(ref2=>{ref2.value=el})},dropdownProps=buildProps({trigger:{...useTooltipTriggerProps.trigger,type:[String,Array]},triggerKeys:{type:Array,default:()=>[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space,EVENT_CODE.down]},virtualTriggering:useTooltipTriggerProps.virtualTriggering,virtualRef:useTooltipTriggerProps.virtualRef,effect:{...useTooltipContentProps.effect,default:"light"},type:{type:String},placement:{type:String,default:"bottom"},popperOptions:{type:Object,default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:[Number,String],default:0},maxHeight:{type:[Number,String],default:""},popperClass:useTooltipContentProps.popperClass,popperStyle:useTooltipContentProps.popperStyle,disabled:Boolean,role:{type:String,values:roleTypes,default:"menu"},buttonProps:{type:Object},teleported:useTooltipContentProps.teleported,appendTo:useTooltipContentProps.appendTo,persistent:{type:Boolean,default:!0}}),dropdownItemProps=buildProps({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:iconPropType}}),dropdownMenuProps=buildProps({onKeydown:{type:Function}}),DROPDOWN_INJECTION_KEY=/* @__PURE__ */Symbol("elDropdown");var collection_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({inheritAttrs:!1}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]]);var collection_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElCollectionItem",inheritAttrs:!1}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]]);const COLLECTION_ITEM_SIGN="data-el-collection-item",rovingFocusGroupProps=buildProps({style:{type:[String,Array,Object]},currentTabId:{type:String},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:String},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:ElCollection,ElCollectionItem:ElCollectionItem,COLLECTION_INJECTION_KEY:COLLECTION_INJECTION_KEY,COLLECTION_ITEM_INJECTION_KEY:COLLECTION_ITEM_INJECTION_KEY}=(name=>{const COLLECTION_NAME=`El${name}Collection`,COLLECTION_ITEM_NAME=`${COLLECTION_NAME}Item`,COLLECTION_INJECTION_KEY2=Symbol(COLLECTION_NAME),COLLECTION_ITEM_INJECTION_KEY2=Symbol(COLLECTION_ITEM_NAME);return{COLLECTION_INJECTION_KEY:COLLECTION_INJECTION_KEY2,COLLECTION_ITEM_INJECTION_KEY:COLLECTION_ITEM_INJECTION_KEY2,ElCollection:Object.assign({},collection_default,{name:COLLECTION_NAME,setup(){const collectionRef=ref(),itemMap=/* @__PURE__ */new Map;provide(COLLECTION_INJECTION_KEY2,{itemMap:itemMap,getItems:()=>{const collectionEl=unref(collectionRef);if(!collectionEl)return[];const orderedNodes=Array.from(collectionEl.querySelectorAll("[data-el-collection-item]"));return[...itemMap.values()].sort((a,b)=>orderedNodes.indexOf(a.ref)-orderedNodes.indexOf(b.ref))},collectionRef:collectionRef})}}),ElCollectionItem:Object.assign({},collection_item_default,{name:COLLECTION_ITEM_NAME,setup(_,{attrs:attrs}){const collectionItemRef=ref(),collectionInjection=inject(COLLECTION_INJECTION_KEY2,void 0);provide(COLLECTION_ITEM_INJECTION_KEY2,{collectionItemRef:collectionItemRef}),onMounted(()=>{const collectionItemEl=unref(collectionItemRef);collectionItemEl&&collectionInjection.itemMap.set(collectionItemEl,{ref:collectionItemEl,...attrs})}),onBeforeUnmount(()=>{const collectionItemEl=unref(collectionItemRef);collectionInjection.itemMap.delete(collectionItemEl)})}})}})("RovingFocusGroup"),ROVING_FOCUS_GROUP_INJECTION_KEY=/* @__PURE__ */Symbol("elRovingFocusGroup"),ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY=/* @__PURE__ */Symbol("elRovingFocusGroupItem"),MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},focusFirst=elements=>{const{activeElement:prevActive}=document;for(const element of elements){if(element===prevActive)return;if(element.focus(),prevActive!==document.activeElement)return}},EVT_OPTS={bubbles:!1,cancelable:!0};var roving_focus_group_impl_vue_vue_type_script_lang_default=defineComponent({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:rovingFocusGroupProps,emits:["currentTabIdChange","entryFocus"],setup(props,{emit:emit}){const currentTabbedId=ref((props.currentTabId||props.defaultCurrentTabId)??null),isBackingOut=ref(!1),isClickFocus=ref(!1),rovingFocusGroupRef=ref(),{getItems:getItems}=inject(COLLECTION_INJECTION_KEY,void 0),rovingFocusGroupRootStyle=computed(()=>[{outline:"none"},props.style]),onMousedown=composeEventHandlers(e=>{props.onMousedown?.(e)},()=>{isClickFocus.value=!0}),onFocus=composeEventHandlers(e=>{props.onFocus?.(e)},e=>{const isKeyboardFocus=!unref(isClickFocus),{target:target,currentTarget:currentTarget}=e;if(target===currentTarget&&isKeyboardFocus&&!unref(isBackingOut)){const entryFocusEvt=new Event("rovingFocusGroup.entryFocus",EVT_OPTS);if(currentTarget?.dispatchEvent(entryFocusEvt),!entryFocusEvt.defaultPrevented){const items=getItems().filter(item=>item.focusable);focusFirst([items.find(item=>item.active),items.find(item=>item.id===unref(currentTabbedId)),...items].filter(Boolean).map(item=>item.ref))}}isClickFocus.value=!1}),onBlur=composeEventHandlers(e=>{props.onBlur?.(e)},()=>{isBackingOut.value=!1});provide(ROVING_FOCUS_GROUP_INJECTION_KEY,{currentTabbedId:readonly(currentTabbedId),loop:toRef(props,"loop"),tabIndex:computed(()=>unref(isBackingOut)?-1:0),rovingFocusGroupRef:rovingFocusGroupRef,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,orientation:toRef(props,"orientation"),dir:toRef(props,"dir"),onItemFocus:tabbedId=>{emit("currentTabIdChange",tabbedId)},onItemShiftTab:()=>{isBackingOut.value=!0},onBlur:onBlur,onFocus:onFocus,onMousedown:onMousedown,onKeydown:e=>{const focusIntent=(event=>{const key=getEventCode(event);return MAP_KEY_TO_FOCUS_INTENT[key]})(e);if(focusIntent){e.preventDefault();let elements=getItems().filter(item=>item.focusable).map(item=>item.ref);switch(focusIntent){case"last":elements.reverse();break;case"prev":case"next":{"prev"===focusIntent&&elements.reverse();const currentIdx=elements.indexOf(e.currentTarget);elements=props.loop?(atIdx=currentIdx+1,(array=elements).map((_,idx)=>array[(idx+atIdx)%array.length])):elements.slice(currentIdx+1);break}}nextTick(()=>{focusFirst(elements)})}var array,atIdx}}),watch(()=>props.currentTabId,val=>{currentTabbedId.value=val??null}),useEventListener(rovingFocusGroupRef,"rovingFocusGroup.entryFocus",(...args)=>{emit("entryFocus",...args)})}});var roving_focus_group_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:ElCollection,ElRovingFocusGroupImpl:/* @__PURE__ */_plugin_vue_export_helper_default(roving_focus_group_impl_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){return renderSlot(_ctx.$slots,"default")}]])}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_group_impl=resolveComponent("el-roving-focus-group-impl"),_component_el_focus_group_collection=resolveComponent("el-focus-group-collection");return openBlock(),createBlock(_component_el_focus_group_collection,null,{default:withCtx(()=>[createVNode(_component_el_roving_focus_group_impl,normalizeProps(guardReactiveProps(_ctx.$attrs)),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16)]),_:3})}]]);var roving_focus_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({components:{ElRovingFocusCollectionItem:ElCollectionItem},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(props,{emit:emit}){const{currentTabbedId:currentTabbedId,onItemFocus:onItemFocus,onItemShiftTab:onItemShiftTab,onKeydown:onKeydown}=inject(ROVING_FOCUS_GROUP_INJECTION_KEY,void 0),id=useId(),rovingFocusGroupItemRef=ref(),handleMousedown=composeEventHandlers(e=>{emit("mousedown",e)},e=>{props.focusable?onItemFocus(unref(id)):e.preventDefault()}),handleFocus=composeEventHandlers(e=>{emit("focus",e)},()=>{onItemFocus(unref(id))}),handleKeydown=composeEventHandlers(e=>{emit("keydown",e)},e=>{const{shiftKey:shiftKey,target:target,currentTarget:currentTarget}=e;getEventCode(e)===EVENT_CODE.tab&&shiftKey?onItemShiftTab():target===currentTarget&&onKeydown(e)}),isCurrentTab=computed(()=>currentTabbedId.value===unref(id));return provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,{rovingFocusGroupItemRef:rovingFocusGroupItemRef,tabIndex:computed(()=>unref(isCurrentTab)?0:-1),handleMousedown:handleMousedown,handleFocus:handleFocus,handleKeydown:handleKeydown}),{id:id,handleKeydown:handleKeydown,handleFocus:handleFocus,handleMousedown:handleMousedown}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_collection_item=resolveComponent("el-roving-focus-collection-item");return openBlock(),createBlock(_component_el_roving_focus_collection_item,{id:_ctx.id,focusable:_ctx.focusable,active:_ctx.active},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","focusable","active"])}]]),roving_focus_group_default$1=roving_focus_group_default;const{ButtonGroup:ElButtonGroup}=ElButton;var dropdown_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElDropdown",components:{ElButton:ElButton,ElButtonGroup:ElButtonGroup,ElScrollbar:ElScrollbar,ElTooltip:ElTooltip,ElRovingFocusGroup:roving_focus_group_default$1,ElOnlyChild:OnlyChild,ElIcon:ElIcon,ArrowDown:arrow_down_default},props:dropdownProps,emits:["visible-change","click","command"],setup(props,{emit:emit}){const _instance=getCurrentInstance(),ns=useNamespace("dropdown"),{t:t}=useLocale(),triggeringElementRef=ref(),referenceElementRef=ref(),popperRef=ref(),contentRef=ref(),scrollbar=ref(null),currentTabId=ref(null),isUsingKeyboard=ref(!1),wrapStyle=computed(()=>({maxHeight:addUnit(props.maxHeight)})),dropdownTriggerKls=computed(()=>[ns.m(dropdownSize.value)]),trigger=computed(()=>function(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]}(props.trigger)),defaultTriggerId=useId().value,triggerId=computed(()=>props.id||defaultTriggerId);function handleClose(){popperRef.value?.onClose()}const dropdownSize=useFormSize();provide(DROPDOWN_INJECTION_KEY,{contentRef:contentRef,role:computed(()=>props.role),triggerId:triggerId,isUsingKeyboard:isUsingKeyboard,onItemEnter:function(){},onItemLeave:function(){const contentEl=unref(contentRef);trigger.value.includes("hover")&&contentEl?.focus({preventScroll:!0}),currentTabId.value=null},handleClose:handleClose}),provide("elDropdown",{instance:_instance,dropdownSize:dropdownSize,handleClick:function(){popperRef.value?.onClose(void 0,0)},commandHandler:function(...args){emit("command",...args)},trigger:toRef(props,"trigger"),hideOnClick:toRef(props,"hideOnClick")});return{t:t,ns:ns,scrollbar:scrollbar,wrapStyle:wrapStyle,dropdownTriggerKls:dropdownTriggerKls,dropdownSize:dropdownSize,triggerId:triggerId,currentTabId:currentTabId,handleCurrentTabIdChange:function(id){currentTabId.value=id},handlerMainButtonClick:event=>{emit("click",event)},handleClose:handleClose,handleOpen:function(){popperRef.value?.onOpen()},handleBeforeShowTooltip:function(){emit("visible-change",!0)},handleShowTooltip:function(event){isUsingKeyboard.value="keydown"===event?.type,contentRef.value?.focus()},handleBeforeHideTooltip:function(){emit("visible-change",!1)},popperRef:popperRef,contentRef:contentRef,triggeringElementRef:triggeringElementRef,referenceElementRef:referenceElementRef}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_roving_focus_group=resolveComponent("el-roving-focus-group"),_component_el_scrollbar=resolveComponent("el-scrollbar"),_component_el_only_child=resolveComponent("el-only-child"),_component_el_tooltip=resolveComponent("el-tooltip"),_component_el_button=resolveComponent("el-button"),_component_arrow_down=resolveComponent("arrow-down"),_component_el_icon=resolveComponent("el-icon"),_component_el_button_group=resolveComponent("el-button-group");return openBlock(),createElementBlock("div",{class:normalizeClass([_ctx.ns.b(),_ctx.ns.is("disabled",_ctx.disabled)])},[createVNode(_component_el_tooltip,{ref:"popperRef",role:_ctx.role,effect:_ctx.effect,"fallback-placements":["bottom","top"],"popper-options":_ctx.popperOptions,"gpu-acceleration":!1,placement:_ctx.placement,"popper-class":[_ctx.ns.e("popper"),_ctx.popperClass],"popper-style":_ctx.popperStyle,trigger:_ctx.trigger,"trigger-keys":_ctx.triggerKeys,"trigger-target-el":_ctx.contentRef,"show-arrow":_ctx.showArrow,"show-after":"hover"===_ctx.trigger?_ctx.showTimeout:0,"hide-after":"hover"===_ctx.trigger?_ctx.hideTimeout:0,"virtual-ref":_ctx.virtualRef??_ctx.triggeringElementRef,"virtual-triggering":_ctx.virtualTriggering||_ctx.splitButton,disabled:_ctx.disabled,transition:`${_ctx.ns.namespace.value}-zoom-in-top`,teleported:_ctx.teleported,"append-to":_ctx.appendTo,pure:"","focus-on-target":"",persistent:_ctx.persistent,onBeforeShow:_ctx.handleBeforeShowTooltip,onShow:_ctx.handleShowTooltip,onBeforeHide:_ctx.handleBeforeHideTooltip},createSlots({content:withCtx(()=>[createVNode(_component_el_scrollbar,{ref:"scrollbar","wrap-style":_ctx.wrapStyle,tag:"div","view-class":_ctx.ns.e("list")},{default:withCtx(()=>[createVNode(_component_el_roving_focus_group,{loop:_ctx.loop,"current-tab-id":_ctx.currentTabId,orientation:"horizontal",onCurrentTabIdChange:_ctx.handleCurrentTabIdChange},{default:withCtx(()=>[renderSlot(_ctx.$slots,"dropdown")]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange"])]),_:3},8,["wrap-style","view-class"])]),_:2},[_ctx.splitButton?void 0:{name:"default",fn:withCtx(()=>[createVNode(_component_el_only_child,{id:_ctx.triggerId,ref:"triggeringElementRef",role:"button",tabindex:_ctx.tabindex},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["id","tabindex"])]),key:"0"}]),1032,["role","effect","popper-options","placement","popper-class","popper-style","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","append-to","persistent","onBeforeShow","onShow","onBeforeHide"]),_ctx.splitButton?(openBlock(),createBlock(_component_el_button_group,{key:0},{default:withCtx(()=>[createVNode(_component_el_button,mergeProps({ref:"referenceElementRef"},_ctx.buttonProps,{size:_ctx.dropdownSize,type:_ctx.type,disabled:_ctx.disabled,tabindex:_ctx.tabindex,onClick:_ctx.handlerMainButtonClick}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),createVNode(_component_el_button,mergeProps({id:_ctx.triggerId,ref:"triggeringElementRef"},_ctx.buttonProps,{role:"button",size:_ctx.dropdownSize,type:_ctx.type,class:_ctx.ns.e("caret-button"),disabled:_ctx.disabled,tabindex:_ctx.tabindex,"aria-label":_ctx.t("el.dropdown.toggleDropdown")}),{default:withCtx(()=>[createVNode(_component_el_icon,{class:normalizeClass(_ctx.ns.e("icon"))},{default:withCtx(()=>[createVNode(_component_arrow_down)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):createCommentVNode("v-if",!0)],2)}]]),dropdown_item_impl_vue_vue_type_script_lang_default=defineComponent({name:"DropdownItemImpl",components:{ElIcon:ElIcon},props:dropdownItemProps,emits:["pointermove","pointerleave","click","clickimpl"],setup(_,{emit:emit}){const ns=useNamespace("dropdown"),{role:menuRole}=inject(DROPDOWN_INJECTION_KEY,void 0),{collectionItemRef:rovingFocusCollectionItemRef}=inject(COLLECTION_ITEM_INJECTION_KEY,void 0),{rovingFocusGroupItemRef:rovingFocusGroupItemRef,tabIndex:tabIndex,handleFocus:handleFocus,handleKeydown:handleItemKeydown,handleMousedown:handleMousedown}=inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,void 0),itemRef=composeRefs(rovingFocusCollectionItemRef,rovingFocusGroupItemRef),role=computed(()=>"menu"===menuRole.value?"menuitem":"navigation"===menuRole.value?"link":"button"),handleKeydown=composeEventHandlers(e=>{const code=getEventCode(e);if([EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space].includes(code))return e.preventDefault(),e.stopImmediatePropagation(),emit("clickimpl",e),!0},handleItemKeydown);return{ns:ns,itemRef:itemRef,dataset:{[COLLECTION_ITEM_SIGN]:""},role:role,tabIndex:tabIndex,handleFocus:handleFocus,handleKeydown:handleKeydown,handleMousedown:handleMousedown}}});const _hoisted_1$7=["aria-disabled","tabindex","role"];const useDropdown=()=>{const elDropdown=inject("elDropdown",{});return{elDropdown:elDropdown,_elDropdownSize:computed(()=>elDropdown?.dropdownSize)}};var dropdown_item_default=/* @__PURE__ */_plugin_vue_export_helper_default(defineComponent({name:"ElDropdownItem",components:{ElRovingFocusItem:roving_focus_item_default,ElDropdownItemImpl:/* @__PURE__ */_plugin_vue_export_helper_default(dropdown_item_impl_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_icon=resolveComponent("el-icon");return openBlock(),createElementBlock(Fragment,null,[_ctx.divided?(openBlock(),createElementBlock("li",{key:0,role:"separator",class:normalizeClass(_ctx.ns.bem("menu","item","divided"))},null,2)):createCommentVNode("v-if",!0),createElementVNode("li",mergeProps({ref:_ctx.itemRef},{..._ctx.dataset,..._ctx.$attrs},{"aria-disabled":_ctx.disabled,class:[_ctx.ns.be("menu","item"),_ctx.ns.is("disabled",_ctx.disabled)],tabindex:_ctx.tabIndex,role:_ctx.role,onClick:_cache[0]||(_cache[0]=e=>_ctx.$emit("clickimpl",e)),onFocus:_cache[1]||(_cache[1]=(...args)=>_ctx.handleFocus&&_ctx.handleFocus(...args)),onKeydown:_cache[2]||(_cache[2]=withModifiers((...args)=>_ctx.handleKeydown&&_ctx.handleKeydown(...args),["self"])),onMousedown:_cache[3]||(_cache[3]=(...args)=>_ctx.handleMousedown&&_ctx.handleMousedown(...args)),onPointermove:_cache[4]||(_cache[4]=e=>_ctx.$emit("pointermove",e)),onPointerleave:_cache[5]||(_cache[5]=e=>_ctx.$emit("pointerleave",e))}),[_ctx.icon||_ctx.$slots.icon?(openBlock(),createBlock(_component_el_icon,{key:0},{default:withCtx(()=>[renderSlot(_ctx.$slots,"icon",{},()=>[(openBlock(),createBlock(resolveDynamicComponent(_ctx.icon)))])]),_:3})):createCommentVNode("v-if",!0),renderSlot(_ctx.$slots,"default")],16,_hoisted_1$7)],64)}]])},inheritAttrs:!1,props:dropdownItemProps,emits:["pointermove","pointerleave","click"],setup(props,{emit:emit,attrs:attrs}){const{elDropdown:elDropdown}=useDropdown(),_instance=getCurrentInstance(),{onItemEnter:onItemEnter,onItemLeave:onItemLeave}=inject(DROPDOWN_INJECTION_KEY,void 0),handlePointerMove=composeEventHandlers(e=>(emit("pointermove",e),e.defaultPrevented),whenMouse(e=>{if(props.disabled)return void onItemLeave(e);const target=e.currentTarget;target===document.activeElement||target.contains(document.activeElement)||(onItemEnter(e),e.defaultPrevented||target?.focus({preventScroll:!0}))})),handlePointerLeave=composeEventHandlers(e=>(emit("pointerleave",e),e.defaultPrevented),whenMouse(onItemLeave));return{handleClick:composeEventHandlers(e=>{if(!props.disabled)return emit("click",e),"keydown"!==e.type&&e.defaultPrevented},e=>{props.disabled?e.stopImmediatePropagation():(elDropdown?.hideOnClick?.value&&elDropdown.handleClick?.(),elDropdown.commandHandler?.(props.command,_instance,e))}),handlePointerMove:handlePointerMove,handlePointerLeave:handlePointerLeave,propsAndAttrs:computed(()=>({...props,...attrs}))}}}),[["render",function(_ctx,_cache,$props,$setup,$data,$options){const _component_el_dropdown_item_impl=resolveComponent("el-dropdown-item-impl"),_component_el_roving_focus_item=resolveComponent("el-roving-focus-item");return openBlock(),createBlock(_component_el_roving_focus_item,{focusable:!_ctx.disabled},{default:withCtx(()=>[createVNode(_component_el_dropdown_item_impl,mergeProps(_ctx.propsAndAttrs,{onPointerleave:_ctx.handlePointerLeave,onPointermove:_ctx.handlePointerMove,onClickimpl:_ctx.handleClick}),createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:2},[_ctx.$slots.icon?{name:"icon",fn:withCtx(()=>[renderSlot(_ctx.$slots,"icon")]),key:"0"}:void 0]),1040,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])}]]),dropdown_menu_vue_vue_type_script_lang_default=defineComponent({name:"ElDropdownMenu",props:dropdownMenuProps,setup(props){const ns=useNamespace("dropdown"),{_elDropdownSize:_elDropdownSize}=useDropdown(),size=_elDropdownSize.value,{contentRef:contentRef,role:role,triggerId:triggerId,isUsingKeyboard:isUsingKeyboard,handleClose:handleClose}=inject(DROPDOWN_INJECTION_KEY,void 0),{rovingFocusGroupRef:rovingFocusGroupRef,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,onBlur:onBlur,onFocus:onFocus,onKeydown:onKeydown,onMousedown:onMousedown}=inject(ROVING_FOCUS_GROUP_INJECTION_KEY,void 0),{collectionRef:rovingFocusGroupCollectionRef}=inject(COLLECTION_INJECTION_KEY,void 0),dropdownKls=computed(()=>[ns.b("menu"),ns.bm("menu",size?.value)]),dropdownListWrapperRef=composeRefs(contentRef,rovingFocusGroupRef,rovingFocusGroupCollectionRef),handleKeydown=composeEventHandlers(e=>{props.onKeydown?.(e)},e=>{const{currentTarget:currentTarget,target:target}=e,code=getEventCode(e);if(currentTarget.contains(target),EVENT_CODE.tab===code)return handleClose();onKeydown(e)});return{size:size,rovingFocusGroupRootStyle:rovingFocusGroupRootStyle,dropdownKls:dropdownKls,role:role,triggerId:triggerId,dropdownListWrapperRef:dropdownListWrapperRef,handleKeydown:handleKeydown,onBlur:onBlur,handleFocus:function(e){isUsingKeyboard.value&&onFocus(e)},onMousedown:onMousedown}}});const _hoisted_1$6=["role","aria-labelledby"];var dropdown_menu_default=/* @__PURE__ */_plugin_vue_export_helper_default(dropdown_menu_vue_vue_type_script_lang_default,[["render",function(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("ul",{ref:_ctx.dropdownListWrapperRef,class:normalizeClass(_ctx.dropdownKls),style:normalizeStyle(_ctx.rovingFocusGroupRootStyle),tabindex:-1,role:_ctx.role,"aria-labelledby":_ctx.triggerId,onFocusin:_cache[0]||(_cache[0]=(...args)=>_ctx.handleFocus&&_ctx.handleFocus(...args)),onFocusout:_cache[1]||(_cache[1]=(...args)=>_ctx.onBlur&&_ctx.onBlur(...args)),onKeydown:_cache[2]||(_cache[2]=withModifiers((...args)=>_ctx.handleKeydown&&_ctx.handleKeydown(...args),["self"])),onMousedown:_cache[3]||(_cache[3]=withModifiers((...args)=>_ctx.onMousedown&&_ctx.onMousedown(...args),["self"]))},[renderSlot(_ctx.$slots,"default")],46,_hoisted_1$6)}]]);const ElDropdown=withInstall(dropdown_default,{DropdownItem:dropdown_item_default,DropdownMenu:dropdown_menu_default}),ElDropdownItem=withNoopInstall(dropdown_item_default),ElDropdownMenu=withNoopInstall(dropdown_menu_default),messageTypes=["primary","success","info","warning","error"],messagePlacement=["top","top-left","top-right","bottom","bottom-left","bottom-right"],messageDefaults={customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0},messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:[String,Object,Function],default:messageDefaults.message},onClose:{type:Function,default:messageDefaults.onClose},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},plain:{type:Boolean,default:messageDefaults.plain},offset:{type:Number,default:messageDefaults.offset},placement:{type:String,values:messagePlacement,default:messageDefaults.placement},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),placementInstances=shallowReactive({}),getLastOffset=(id,placement)=>{const{prev:prev}=((id,placement)=>{const instances=placementInstances[placement]||[],idx=instances.findIndex(instance=>instance.id===id),current=instances[idx];let prev;return idx>0&&(prev=instances[idx-1]),{current:current,prev:prev}})(id,placement);return prev?prev.vm.exposed.bottom.value:0},_hoisted_1$5=["id"],_hoisted_2$3=["innerHTML"];var message_default=/* @__PURE__ */defineComponent({name:"ElMessage",__name:"message",props:messageProps,emits:{destroy:()=>!0},setup(__props,{expose:__expose,emit:__emit}){const{Close:Close}=TypeComponents,props=__props,emit=__emit,isStartTransition=ref(!1),{ns:ns,zIndex:zIndex2}=function(block,sizeFallback){const config=useGlobalConfig(),ns=useNamespace(block,computed(()=>config.value?.namespace||"el")),locale=useLocale(computed(()=>config.value?.locale)),zIndex2=useZIndex(computed(()=>config.value?.zIndex||2e3)),size=computed(()=>unref(sizeFallback)||config.value?.size||"");return provideGlobalConfig(computed(()=>unref(config)||{})),{ns:ns,locale:locale,zIndex:zIndex2,size:size}}("message"),{currentZIndex:currentZIndex,nextZIndex:nextZIndex}=zIndex2,messageRef=ref(),visible=ref(!1),height=ref(0);let stopTimer;const badgeType=computed(()=>props.type?"error"===props.type?"danger":props.type:"info"),typeClass=computed(()=>{const type=props.type;return{[ns.bm("icon",type)]:type&&TypeComponentsMap[type]}}),iconComponent=computed(()=>props.icon||TypeComponentsMap[props.type]||""),placement=computed(()=>props.placement||"top"),lastOffset=computed(()=>getLastOffset(props.id,placement.value)),offset=computed(()=>((id,offset,placement)=>(placementInstances[placement]||[]).findIndex(instance=>instance.id===id)>0?16:offset)(props.id,props.offset,placement.value)+lastOffset.value),bottom=computed(()=>height.value+offset.value),horizontalClass=computed(()=>placement.value.includes("left")?ns.is("left"):placement.value.includes("right")?ns.is("right"):ns.is("center")),verticalProperty=computed(()=>placement.value.startsWith("top")?"top":"bottom"),customStyle=computed(()=>({[verticalProperty.value]:`${offset.value}px`,zIndex:currentZIndex.value}));function startTimer(){0!==props.duration&&({stop:stopTimer}=function(cb,interval,options={}){const{immediate:immediate=!0}=options,isPending=ref(!1);let timer=null;function clear(){timer&&(clearTimeout(timer),timer=null)}function stop(){isPending.value=!1,clear()}function start(...args){clear(),isPending.value=!0,timer=setTimeout(()=>{isPending.value=!1,timer=null,cb(...args)},toValue(interval))}return immediate&&(isPending.value=!0,isClient&&start()),tryOnScopeDispose(stop),{isPending:readonly(isPending),start:start,stop:stop}}(()=>{close2()},props.duration))}function clearTimer(){stopTimer?.()}function close2(){visible.value=!1,nextTick(()=>{isStartTransition.value||(props.onClose?.(),emit("destroy"))})}return onMounted(()=>{startTimer(),nextZIndex(),visible.value=!0}),watch(()=>props.repeatNum,()=>{clearTimer(),startTimer()}),useEventListener(document,"keydown",function(event){getEventCode(event)===EVENT_CODE.esc&&close2()}),useResizeObserver(messageRef,()=>{height.value=messageRef.value.getBoundingClientRect().height}),__expose({visible:visible,bottom:bottom,close:close2}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:unref(ns).b("fade"),onBeforeEnter:_cache[0]||(_cache[0]=$event=>isStartTransition.value=!0),onBeforeLeave:__props.onClose,onAfterLeave:_cache[1]||(_cache[1]=$event=>_ctx.$emit("destroy")),persisted:""},{default:withCtx(()=>[withDirectives(createElementVNode("div",{id:__props.id,ref_key:"messageRef",ref:messageRef,class:normalizeClass([unref(ns).b(),{[unref(ns).m(__props.type)]:__props.type},unref(ns).is("closable",__props.showClose),unref(ns).is("plain",__props.plain),unref(ns).is("bottom","bottom"===verticalProperty.value),horizontalClass.value,__props.customClass]),style:normalizeStyle(customStyle.value),role:"alert",onMouseenter:clearTimer,onMouseleave:startTimer},[__props.repeatNum>1?(openBlock(),createBlock(unref(ElBadge),{key:0,value:__props.repeatNum,type:badgeType.value,class:normalizeClass(unref(ns).e("badge"))},null,8,["value","type","class"])):createCommentVNode("v-if",!0),iconComponent.value?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(ns).e("icon"),typeClass.value])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(iconComponent.value)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),renderSlot(_ctx.$slots,"default",{},()=>[__props.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),createElementVNode("p",{class:normalizeClass(unref(ns).e("content")),innerHTML:__props.message},null,10,_hoisted_2$3)],2112)):(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(unref(ns).e("content"))},toDisplayString(__props.message),3))]),__props.showClose?(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass(unref(ns).e("closeBtn")),onClick:withModifiers(close2,["stop"])},{default:withCtx(()=>[createVNode(unref(Close))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],46,_hoisted_1$5),[[vShow,visible.value]])]),_:3},8,["name","onBeforeLeave"]))}});let seed=1;const normalizeOptions=params=>{const options=!params||isString(params)||isVNode(params)||isFunction$1(params)?{message:params}:params,normalized={...messageDefaults,...options};return(normalized=>{if(normalized.appendTo){if(isString(normalized.appendTo)){let appendTo=document.querySelector(normalized.appendTo);isElement(appendTo)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),appendTo=document.body),normalized.appendTo=appendTo}}else normalized.appendTo=document.body})(normalized),(normalized=>{!normalized.placement&&isString(messageConfig.placement)&&messageConfig.placement&&(normalized.placement=messageConfig.placement),normalized.placement||(normalized.placement="top"),messagePlacement.includes(normalized.placement)||(debugWarn("ElMessage",`Invalid placement: ${normalized.placement}. Falling back to 'top'.`),normalized.placement="top")})(normalized),isBoolean(messageConfig.grouping)&&!normalized.grouping&&(normalized.grouping=messageConfig.grouping),isNumber(messageConfig.duration)&&3e3===normalized.duration&&(normalized.duration=messageConfig.duration),isNumber(messageConfig.offset)&&16===normalized.offset&&(normalized.offset=messageConfig.offset),isBoolean(messageConfig.showClose)&&!normalized.showClose&&(normalized.showClose=messageConfig.showClose),isBoolean(messageConfig.plain)&&!normalized.plain&&(normalized.plain=messageConfig.plain),normalized},createMessage=({appendTo:appendTo,...options},context)=>{const id="message_"+seed++,userOnClose=options.onClose,container=document.createElement("div"),props={...options,id:id,onClose:()=>{userOnClose?.(),(instance=>{const instances=placementInstances[instance.props.placement||"top"],idx=instances.indexOf(instance);if(-1===idx)return;instances.splice(idx,1);const{handler:handler}=instance;handler.close()})(instance)},onDestroy:()=>{render$1(null,container)}},vnode=createVNode(message_default,props,isFunction$1(props.message)||isVNode(props.message)?{default:isFunction$1(props.message)?props.message:()=>props.message}:null);vnode.appContext=context||message._context,render$1(vnode,container),appendTo.appendChild(container.firstElementChild);const vm=vnode.component,instance={id:id,vnode:vnode,vm:vm,handler:{close:()=>{vm.exposed.close()}},props:vnode.component.props};return instance},message=(options={},context)=>{if(!isClient)return{close:()=>{}};const normalized=normalizeOptions(options),instances=(placement=normalized.placement||"top",placementInstances[placement]||(placementInstances[placement]=shallowReactive([])),placementInstances[placement]);var placement;if(normalized.grouping&&instances.length){const instance2=instances.find(({vnode:vm})=>vm.props?.message===normalized.message);if(instance2)return instance2.props.repeatNum+=1,instance2.props.type=normalized.type,instance2.handler}if(isNumber(messageConfig.max)&&instances.length>=messageConfig.max)return{close:()=>{}};const instance=createMessage(normalized,context);return instances.push(instance),instance.handler};messageTypes.forEach(type=>{message[type]=(options={},appContext)=>message({...normalizeOptions(options),type:type},appContext)}),message.closeAll=function(type){for(const placement in placementInstances)if(hasOwn(placementInstances,placement)){const instances=[...placementInstances[placement]];for(const instance of instances)type&&type!==instance.props.type||instance.handler.close()}},message.closeAllByPlacement=function(placement){placementInstances[placement]&&[...placementInstances[placement]].forEach(instance=>instance.handler.close())},message._context=null;const ElMessage=(name="$message",(fn2=message).install=app=>{fn2._context=app._context,app.config.globalProperties[name]=fn2},fn2);var fn2,name;class Debouncing{timeoutId=null;delay;constructor(delay){this.delay=delay}debounce(func){this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{func(),this.timeoutId=null},this.delay)}cancle(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}}function createHtml(tagName,options){const{is:is,style:style,text:text,html:html,parent:parent2}=options??{},element=document.createElement(tagName,{is:is});return style&&Object.assign(element.style,style),text&&(element.innerText=text),html&&(element.innerHTML=html),parent2&&parent2.appendChild(element),element}const _hoisted_1$4={class:"flex items-center flex-1"},_hoisted_2$2={key:0,class:"flashing-ani flex justify-center items-center"},_hoisted_3$2={key:0,class:"m-[10px_0px] flex gap-[20px]"},_hoisted_4$2={key:1,class:"m-[5px_0]"},_hoisted_5$2={class:"grid grid-cols-4 grid-rows-4 gap-[5px] rounded-[6px] overflow-hidden"},_hoisted_6$2={key:1,class:"row-start-3 row-end-5 col-start-4 col-end-4 leading-[88px]!"},_hoisted_7$2={key:3},_export_sfc=(sfc,props)=>{const target=sfc.__vccOpts||sfc;for(const[key,val]of props)target[key]=val;return target},NumberEditor=/* @__PURE__ */_export_sfc(/* @__PURE__ */defineComponent({__name:"NumberEditor",props:/* @__PURE__ */mergeModels({showCancel:{type:Boolean,default:!0},showMax:{type:Boolean,default:!1},showMin:{type:Boolean,default:!1},showConfirm:{type:Boolean,default:!0}},{modelValue:{default:"0"},modelModifiers:{}}),emits:/* @__PURE__ */mergeModels(["confirm","cancel","max","min"],["update:modelValue"]),setup(__props,{emit:__emit}){const keys2=new Array(10).fill(10).map((_,i)=>String(i));function onKeydown(e){keys2.includes(e.key)?value.value+=e.key:"Backspace"===e.key?value.value=value.value.slice(0,value.value.length-1):"Enter"===e.key&&props.showConfirm?emits("confirm",Number(value.value)):"Delete"===e.key?value.value="":"Escape"===e.key&&props.showCancel&&emits("cancel"),e.stopPropagation()}const props=__props,value=useModel(__props,"modelValue",{get:v=>("number"==typeof v&&(v+=""),v),set:v=>Number("00"===v?"0":v.startsWith("0")?v.slice(1):v)}),emits=__emit,isFocus=ref(!1),inputElRef=ref();return onMounted(()=>{setTimeout(()=>inputElRef.value?.focus(),100)}),(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:"bg-[whitesmoke] p-[10px]",style:normalizeStyle({fontSize:unref(isMobileRef)?"18px":"12px"})},[createElementVNode("div",{ref_key:"inputElRef",ref:inputElRef,onKeydown:onKeydown,onFocus:_cache[0]||(_cache[0]=$event=>isFocus.value=!0),onBlur:_cache[1]||(_cache[1]=$event=>isFocus.value=!1),tabindex:"1",class:"outline-0 w-full p-[5px] rounded-[6px] box-border border-0 bg-white leading-[30px] flex"},[createElementVNode("p",_hoisted_1$4,[createTextVNode(toDisplayString(value.value||"0"),1),isFocus.value?(openBlock(),createElementBlock("span",_hoisted_2$2,"▏")):createCommentVNode("",!0)]),_cache[18]||(_cache[18]=createElementVNode("p",null,"mm",-1))],544),__props.showMin||__props.showMax?(openBlock(),createElementBlock("p",_hoisted_3$2,[__props.showMax?(openBlock(),createElementBlock("button",{key:0,onClick:_cache[2]||(_cache[2]=$event=>emits("max"))},"设置最大值")):createCommentVNode("",!0),__props.showMin?(openBlock(),createElementBlock("button",{key:1,onClick:_cache[3]||(_cache[3]=$event=>emits("min"))},"设置最小值")):createCommentVNode("",!0)])):(openBlock(),createElementBlock("p",_hoisted_4$2)),createElementVNode("ul",_hoisted_5$2,[createElementVNode("li",{onClick:_cache[4]||(_cache[4]=$event=>value.value+="1")},"1"),createElementVNode("li",{onClick:_cache[5]||(_cache[5]=$event=>value.value+="2")},"2"),createElementVNode("li",{onClick:_cache[6]||(_cache[6]=$event=>value.value+="3")},"3"),createElementVNode("li",{onClick:_cache[7]||(_cache[7]=$event=>value.value="")},"清空"),createElementVNode("li",{onClick:_cache[8]||(_cache[8]=$event=>value.value+="4")},"4"),createElementVNode("li",{onClick:_cache[9]||(_cache[9]=$event=>value.value+="5")},"5"),createElementVNode("li",{onClick:_cache[10]||(_cache[10]=$event=>value.value+="6")},"6"),createElementVNode("li",{onClick:_cache[11]||(_cache[11]=$event=>value.value=value.value.slice(0,value.value.length-1))},"✖"),createElementVNode("li",{onClick:_cache[12]||(_cache[12]=$event=>value.value+="7")},"7"),createElementVNode("li",{onClick:_cache[13]||(_cache[13]=$event=>value.value+="8")},"8"),createElementVNode("li",{onClick:_cache[14]||(_cache[14]=$event=>value.value+="9")},"9"),__props.showConfirm?(openBlock(),createElementBlock("li",{key:0,class:"row-start-3 row-end-5 col-start-4 col-end-4 leading-[88px]! confirm",onClick:_cache[15]||(_cache[15]=$event=>emits("confirm",Number(value.value)))},"确认")):(openBlock(),createElementBlock("li",_hoisted_6$2)),createElementVNode("li",{onClick:_cache[16]||(_cache[16]=$event=>value.value+="0"),class:"col-start-1 col-end-3"},"0"),__props.showCancel?(openBlock(),createElementBlock("li",{key:2,onClick:_cache[17]||(_cache[17]=$event=>emits("cancel"))},"取消")):(openBlock(),createElementBlock("li",_hoisted_7$2))])],4))}}),[["__scopeId","data-v-7a78abcb"]]);function createPromise(){let resolve,reject;const promise=new Promise((re2,rt2)=>{resolve=re2,reject=rt2});return{get resolve(){return resolve},get reject(){return reject},get promise(){return promise}}}const customCursor={circle:"url(data:image/svg+xml;base64,PHN2ZyB0PSIxNzc5NzkxMjQ2NjA1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9Ijc5ODkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTUxMiA1MTJtLTMyMCAwYTMyMCAzMjAgMCAxIDAgNjQwIDAgMzIwIDMyMCAwIDEgMC02NDAgMFoiIGZpbGw9IiNmZmZmZmYiIHAtaWQ9Ijc5OTAiPjwvcGF0aD48L3N2Zz4=) 8 8, auto"};class Command extends Component{static interruptKeys=["escape"];static confirmKeys=["enter"];static shortcutKeys=[];get renderer(){return this._renderer||(this._renderer=this.parent?.findComponentByName("Renderer")),this._renderer}get domElement(){return this._domElement||(this._domElement=this.editor?.domContainer?.dialogLayer),this._domElement}get editor(){return this._editor||(this._editor=this.parent?.findComponentByName("Editor")),this._editor}get eventInput(){return this._eventInput||(this._eventInput=this.parent?.findComponentByName("EventInput")),this._eventInput}get renderManager(){return this._renderManager||(this._renderManager=this.parent?.findComponentByName("RenderManager")),this._renderManager}get commandManager(){return this._commandManager||(this._commandManager=this.editor?.commandManager),this._commandManager}get default(){return this._default||(this._default=this.parent?.findComponentByName("DefaultCommand")),this._default}get commandName(){return this.constructor.commandName}get interruptKeys(){return this.constructor.interruptKeys}get shortcutKeys(){return this.constructor.shortcutKeys}get confirmKeys(){return this.constructor.confirmKeys}container=new THREE.Group;constructor(){super(),this.addEventListener("addFromParent",()=>{this.editor.container.add(this.container),this.editor.addEventListener("cancelCommand",()=>{this.cancel()}),this.editor.container.add(this.container)})}initCommandFlow(opt){const{shortcutKeys:shortcutKeys,loop:loop=!1,writeOperationRecord:writeOperationRecord=!0,commandName:commandName=this.commandName,getStartData:getStartData}=opt??{},commandFlow=this.commandManager.addCommandFlow(commandName).add(this.createInterruptHanlder()).addRollback(this.onRollback.bind(this)).addRevokeRollback(this.onRevokeRollback.bind(this)).setLoop(loop);return commandFlow.writeOperationRecord=writeOperationRecord,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.onCompleted(e.data)),shortcutKeys&&(this.eventInput.addKeyCombination(commandName,shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{const data=getStartData?.();this.eventInput.isKeyCombination(commandName)&&await this.commandManager.start(commandName,data)}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(shortcutKeys))),this.commandFlow=commandFlow,commandFlow}onCompleted(_){}onRollback(data){return data}onRevokeRollback(data){return data}onInterrupt(){}cancel(){const commandName=this.commandName||this.constructor.commandName;this.commandManager.currentName===commandName&&(this.commandManager.cancel(),this.onInterrupt())}createInterruptHanlder(){return(next,data)=>{this.addEventRecord("clear",this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyDowns(this.interruptKeys)&&this.cancel()})),next(data)}}get createInterrupt(){return this.createInterruptHanlder.bind(this)}createCursor(cursor){return(next,data)=>{const defaultCursor=this.domElement.style.cursor;this.domElement.style.cursor=cursor,this.addEventRecord("clear",()=>{this.domElement.style.cursor=defaultCursor??"default"}),next(data)}}createFinally(keys2=[]){return()=>{this.cancelEventRecord("clear"),keys2.forEach(k=>this.cancelEventRecord(k))}}formatText(text,color="var(--primary-color)",style=""){return`<span style="color: ${color};${style}">${text}</span>`}setCursor(cursor){this.domElement.style.cursor=customCursor[cursor]||cursor}COMMAND_END_NAME="clear";addCommandEndHandle(...cancels){return this.addEventRecord(this.COMMAND_END_NAME,...cancels)}buttonSimulation(keys2){queueMicrotask(()=>{const variable=this.parent?.findComponentByType(Variable);keys2.forEach(k=>{variable?.set("currentKeyDown",k)}),queueMicrotask(()=>{keys2.forEach(k=>{variable?.set("currentKeyUp",k)})})})}baseNormalLine=new LineSegment;pointLineConstraint(point,baseLine,normalStartPoint,baseNormalLine){if(!baseNormalLine&&normalStartPoint){const normal=baseLine.normal();baseNormalLine=this.baseNormalLine.set(normalStartPoint.clone().add(normal.clone().multiplyScalar(10)),normalStartPoint.clone().add(normal.multiplyScalar(-10)))}const point1=baseLine.projectPoint(point,!1);if(!baseNormalLine)return point1&&point.copy(point1),point;const point2=baseNormalLine.projectPoint(point,!1);return point1&&point2?point.distance(point1)<point.distance(point2)?point.copy(point1):point.copy(point2):point1?point.copy(point1):point2&&point.copy(point2),point}createPointFollowMove(callBack,opt={}){const editor=this.editor,currentPoint=new Point;let globalCenterPoint=null,baseLine=null,baseNormalLine=null;const quadtree=opt.targetLines&&Quadtree.from(opt.targetLines),cancelEvent=editor.addEventListener("pointerPositionChange",()=>{const pointerPosition=Point.from(editor.pointerPosition);if(globalCenterPoint&&editor.eventInput.isKeyDown("shift")){Math.abs(pointerPosition.x-globalCenterPoint.x)>Math.abs(pointerPosition.y-globalCenterPoint.y)?currentPoint.set(pointerPosition.x,globalCenterPoint.y):currentPoint.set(globalCenterPoint.x,pointerPosition.y),callBack(currentPoint,!1)}else if(baseLine&&baseNormalLine&&editor.eventInput.isKeyDown("alt")){const point1=baseLine.projectPoint(pointerPosition,!1),point2=baseNormalLine.projectPoint(pointerPosition,!1);point1&&point2?pointerPosition.distance(point1)<pointerPosition.distance(point2)?currentPoint.copy(point1):currentPoint.copy(point2):point1?currentPoint.copy(point1):point2&¤tPoint.copy(point2),callBack(currentPoint,!1)}else{const{point:point,find:find,line:line2,mode:mode}=editor.renderManager.auxiliaryLineAdsorption(null,quadtree);currentPoint.copy(point),callBack(currentPoint,find,line2,mode)}});return{destroy(){cancelEvent()},setBaseLine(line2,point){if(baseLine=line2,globalCenterPoint=point,line2&&point){const direction=line2.normal();baseNormalLine=new LineSegment(point.clone().add(direction.clone().multiplyScalar(10)),point.clone().add(direction.multiplyScalar(-10)))}else baseNormalLine=null}}}createPointSelector(opt){const getPoint=async mode_=>{if(ended)throw new Error("顶点选择器已经结束,无法继续使用");return mode=mode_,new Promise(resolve=>{resolve_=resolve;const eventClose=this.editor.domEventRegister.addEventListener("click",()=>{point&&!ended&&(mode="null",this.domElement.style.cursor=cursor,resolve({point:Point.from(point),line:line2}),resolve_=null,eventClose())})})},end=()=>{ended||(ended=!0,handle.destroy(),pointMesh.removeFromParent(),resolve_&&resolve_(null),editor.renderManager.setAuxiliaryLineVisible(!1))},{onMove:onMove,targetLines:targetLines,eventRecordNames:eventRecordNames=[]}=opt??{},editor=this.editor,pointMesh=this.renderer.createCircle(new Point(0,0),{size:8,color:65280},this.container);let line2,resolve_,cursor=this.domElement.style.cursor,mode="null",point=null,ended=!1;pointMesh.position.z=.005,pointMesh.visible=!1;const handle=this.createPointFollowMove((p,isAdsorb,l,m)=>{point=null,"null"!==mode&&(line2=l,m||(m="empty"),"all"===mode&&(point=new THREE.Vector3(p.x,p.y,0)),!point&&mode.indexOf(m)>-1&&(point=new THREE.Vector3(p.x,p.y,0))),this.domElement.style.cursor=isAdsorb?"none":cursor,point?(pointMesh.position.copy(point),"none"!==this.domElement.style.cursor&&(cursor=this.domElement.style.cursor),pointMesh.visible=!0):pointMesh.visible=!1,onMove&&onMove(point)},{targetLines:targetLines});return this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],end),{get ended(){return ended},end:end,next:getPoint,setBaseLine(line3,point2){if("all"!==mode)throw new Error("线段方向约束只有在mode等于all时才能设置");handle.setBaseLine(line3,point2)},points:mode_=>({async next(){if(!ended){const result=await getPoint(mode_);if(result)return{value:result,done:!1}}return{value:null,done:!0}},[Symbol.asyncIterator](){return this}}),async awaitEach(callBack,mode_="all"){for await(const result of this.points(mode_))callBack(result);return this}}}createDragPoint(point,opt={}){const{onChange:onChange,onStart:onStart,onEnd:onEnd,onEnter:onEnter,onLeave:onLeave,onClick:onClick,onDblClick:onDblClick,size:size,onLongTouch:onLongTouch,style:style,auxiliaryLine:auxiliaryLine=!1}=opt;point=point.clone();const div=document.createElement("div"),defaultWidth=size?size+"px":isMobileRef.value?"20px":"10px",debouncing=new Debouncing(800),object3D=this.renderer.createText("",point,{position:"absolute",background:"rgba(255,255,255, 0.4)",borderRadius:"100px",width:defaultWidth,height:defaultWidth,pointerEvents:"all",cursor:"move",transition:"0.25s background",border:"solid 1px #fff",...style},this.container);createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:`calc(${defaultWidth} * 1.3)`,height:"1px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"1px",height:`calc(${defaultWidth} * 1.3)`,background:"white",borderRadius:"100px",pointerEvents:"none"}});const move=e=>{e instanceof TouchEvent&&this.editor.domEventRegister.updatePointer(e);const opt2=auxiliaryLine?this.renderManager.auxiliaryLineAdsorption():this.renderManager.adsorption(),{point:pos,line:line2}=opt2;line2?(object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth):(object3D.element.style.width="2px",object3D.element.style.height="2px"),object3D.position.x=pos.x,object3D.position.y=pos.y,point.copy(pos),onChange&&onChange(point,opt2),debouncing.cancle(),e?.stopPropagation(),e?.preventDefault()},mouseup=e=>{object3D.element.style.pointerEvents="all",object3D.element.style.background="rgba(255,255,255, 0.4)",object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth,isMobileRef.value?(object3D.element.removeEventListener("touchmove",move),object3D.element.removeEventListener("touchend",mouseup)):(document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",mouseup),e?.stopPropagation()),e&&onEnd&&setTimeout(()=>onEnd(point),100),debouncing.cancle()},start=()=>{object3D.element.style.background="#00ff00",object3D.element.style.width="2px",object3D.element.style.height="2px",isMobileRef.value?(object3D.element.addEventListener("touchmove",move),object3D.element.addEventListener("touchend",mouseup)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",mouseup)),onStart&&onStart(point),onLongTouch&&debouncing.debounce(()=>(mouseup(null),onLongTouch()))};isMobileRef.value?object3D.element.addEventListener("pointerdown",start):(object3D.element.addEventListener("mousedown",e=>{start(),e.stopPropagation(),e.preventDefault()}),object3D.element.addEventListener("mouseenter",()=>onEnter&&onEnter()),object3D.element.addEventListener("mouseleave",()=>onLeave&&onLeave())),onClick&&object3D.element.addEventListener("click",onClick),onDblClick&&object3D.element.addEventListener("dblclick",onDblClick);return{dragPointMesh:object3D,destroy:()=>{div.remove(),object3D.removeFromParent()},setPoint(point2){point2 instanceof Point?object3D.position.set(point2.x,point2.y,object3D.position.z):object3D.position.copy(point2)}}}createClickPoint(point,onClick){const div=document.createElement("div"),object3D=this.renderer.createText("",point,{position:"absolute",background:"rgb(255,255,255)",borderRadius:"100px",width:"10px",height:"10px",pointerEvents:"all",cursor:"pointer",transition:"0.25s background"},this.container);object3D.element.addEventListener("mousedown",e=>{onClick(),e.stopPropagation(),e.preventDefault()});return()=>{div.remove(),object3D.removeFromParent()}}awaitOnlyKeys(keys2,options={}){const{condition:condition,once:once=!0,eventRecordNames:eventRecordNames=[]}=options;let loopResolve;const{resolve:resolve,promise:promise}=createPromise(),cancelEvent=this.eventInput.addEventListener("codeChange",()=>{if(this.eventInput.isOnlyKeyDowns(keys2)){if(condition&&!condition())return;once?(resolve(!0),cancelEvent()):loopResolve(!0)}});return this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],cancelEvent),Object.assign(promise,{cancel:cancelEvent,[Symbol.asyncIterator]:()=>({async next(){{const{resolve:resolve2,promise:promise2}=createPromise();loopResolve=resolve2;const result=await promise2;if(result)return{value:result,done:!1}}return{value:void 0,done:!0}}}),async awaitEach(callBack){for await(const _ of this)callBack();return this}})}createVueApp(com,props,parent2=this.domElement){const div=document.createElement("div");div.style.zIndex="20",parent2.appendChild(div);const app=createApp(com,props);return app.mount(div),()=>{app.unmount(),div.remove()}}openWidthEditor(opt){let{defaultWidth:defaultWidth=0,maxWidth:maxWidth=1/0,minWidth:minWidth=0,title:title,showMin:showMin=!1,showMax:showMax=!1,showCancel:showCancel=!1,eventRecordNames:eventRecordNames=[]}=opt??{};minWidth=Number(minWidth.toFixed(0)),maxWidth=Number(maxWidth.toFixed(0)),"number"==typeof maxWidth&&(defaultWidth=Math.min(maxWidth,defaultWidth)),"number"==typeof minWidth&&(defaultWidth=Math.max(minWidth,defaultWidth)),defaultWidth=Number(defaultWidth.toFixed(0));const{resolve:resolve,promise:promise}=createPromise();function onConfirm(value){return value<minWidth?ElMessage({message:`宽度不能小于${minWidth}mm`,type:"warning"}):maxWidth&&value>maxWidth?ElMessage({message:`宽度不能大于${maxWidth} mm, 不然将会穿透依附的墙壁`,type:"warning"}):(destroy(),void resolve(value))}function close2(){ended||(ended=!0,destroy())}const width=ref(defaultWidth+""),destroy=this.createVueApp(function(){return createVNode("div",{class:{"z-20 absolute left-0 top-0 w-full h-full flex flex-col":!0," justify-center items-center bg-[rgba(0,0,0,0.5)]":!isMobileRef.value},onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation(),onPointerup:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation()},[isMobileRef.value&&createVNode("div",{class:"flex-1 pointer-events-none"},null),createVNode("div",{class:{"w-[400px] rounded-[8px] overflow-hidden":!isMobileRef.value}},[title&&createVNode("div",{class:"bg-white p-[10px] text-center text-[16px]"},[createVNode("h4",null,[title])]),createVNode(Transition,{name:"slide-fade"},{default:()=>[createVNode(NumberEditor,{showMax:showMax,showMin:showMin,showCancel:showCancel,onConfirm:onConfirm,onCancel:()=>onConfirm(defaultWidth),onMax:()=>width.value=String(maxWidth),onMin:()=>width.value=String(minWidth),modelValue:width.value,"onUpdate:modelValue":$event=>width.value=$event},null)]})])])});this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],close2);let ended=!1;return Object.assign(promise,{promise:promise,close:close2,get ended(){return ended}})}openLinePointEditor(point,line2){const uuid_=uuid(),context=this,{resolve:resolve,promise:promise}=createPromise();function onConfirm(){end(),resolve(point)}function updateData(){const helpLine1=new LineSegment(point,line2.start),len1=helpLine1.length;text1.setText(mToMm(len1)+"mm");let center=helpLine1.center;text1.position.set(center.x,center.y,0),num1Text.visible=len1>1e-9;const helpLine2=new LineSegment(point,line2.end),len2=helpLine2.length;text2.setText(mToMm(len2)+"mm"),center=helpLine2.center,text2.position.set(center.x,center.y,0),num2Text.visible=len2>1e-9,pointMesh.position.set(point.x,point.y,.05)}const group=new THREE.Group;context.container.add(group);const style={background:"var(--primary-color)",width:"20px",lineHeight:"20px",textAlign:"center",borderRadius:"100px"},num1Text=context.renderer.createText("1",line2.start,style,group),num2Text=context.renderer.createText("2",line2.end,style,group),pointMesh=context.renderer.createCircle(Point.zero(),{color:65280},group),text1=context.createEditButton({parent:group,onClick:async()=>{let width=mToMm(point.distance(line2.start));const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width,maxWidth:1e3*line2.length,minWidth:0,showMax:!0});this.addEventRecord(uuid_,close2),width=await promise2;const direct=line2.end.directionFrom(line2.start);point.copy(line2.start).add(direct.multiplyScalar(width/1e3)),updateData()}}),text2=context.createEditButton({parent:group,onClick:async()=>{let width=mToMm(point.distance(line2.end));const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width,maxWidth:1e3*line2.length,minWidth:0,showMax:!0});this.addEventRecord(uuid_,close2),width=await promise2;const direct=line2.start.directionFrom(line2.end);point.copy(line2.end).add(direct.multiplyScalar(width/1e3)),updateData()}});updateData();const destroy=context.createVueApp(function(){return createVNode("div",{class:" pointer-events-none z-18 absolute left-0 top-0 w-full h-full flex flex-col",onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode("div",{class:"flex-1"},null),createVNode("div",{class:"bg-white p-0 text-center text-[16px] pointer-events-auto"},[createVNode("h4",{class:"border-b border-b-[#ccc] leading-[40px]"},[createTextVNode("落点位置确认")]),createVNode("div",{class:"p-[40px]"},[createVNode("button",{onClick:onConfirm,class:"bg-(--primary-color) p-[5px_40px] outline-0 border-0 active:grayscale-75 rounded-[6px] text-white"},[createTextVNode("确认")]),createVNode("p",{class:"mt-[10px] text-[red] text-[12px]"},[createTextVNode("* 请点击距离数字后可修改两侧边距")])])])])});let ended=!1;const end=()=>{ended||(this.cancelEventRecord(uuid_),destroy(),group.clear(),group.removeFromParent(),ended=!0)};return Object.assign(promise,{promise:promise,close:end,get ended(){return ended}})}createButton(opt){const{text:text,onClick:onClick,visible:visible=!0,position:position,style:style,freedom:freedom,parent:parent2=this.container,eventRecordNames:eventRecordNames=[]}=opt??{},textMesh=this.renderer.createText("",Point.zero(),{},parent2);position instanceof Point?textMesh.position.set(position.x,position.y,0):position instanceof THREE.Vector3&&textMesh.position.copy(position);let element=textMesh.element;return freedom&&(element=document.createElement("div"),element.style.position="absolute",textMesh.element.appendChild(element)),Object.assign(element.style,{pointerEvents:"all",background:"var(--primary-color)",padding:"2px 5px",borderRadius:"6px",cursor:"pointer",...style}),element.classList.add("button"),textMesh.visible=visible,text&&(element.innerHTML=text),onClick&&(isMobileRef.value?element.addEventListener("click",onClick):element.addEventListener("mousedown",onClick)),this.addEventRecord([this.COMMAND_END_NAME,...eventRecordNames],()=>{textMesh.removeFromParent()}),Object.assign(textMesh,{domElement:element,setText(text2){element.innerHTML=text2},setPosition(position2){position2 instanceof Point?textMesh.position.set(position2.x,position2.y,0):position2 instanceof THREE.Vector3&&textMesh.position.copy(position2)},setPositionByTwoPointCenter(point1,point2){point1=Point.from(point1),point2=Point.from(point2),this.setPosition(point1.add(point2).multiplyScalar(.5))}})}createEditButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg fill="#fff" viewBox="0 0 1088 1024" width="18" height="18"><path d="M289.728 752a40.32 40.32 0 0 0 5.952-0.512l168.192-29.44a9.792 9.792 0 0 0 5.312-2.816l423.936-423.936c3.84-3.84 3.84-10.24 0-14.08l-166.208-166.336a9.92 9.92 0 0 0-7.104-2.88 9.92 9.92 0 0 0-7.104 2.88L288.832 538.88a10.176 10.176 0 0 0-2.816 5.312l-29.504 168.192a33.92 33.92 0 0 0 33.216 39.68zM357.12 577.6l362.688-362.624 73.28 73.344-362.688 362.56-88.96 15.744 15.68-89.024z m554.88 258.368H176a32 32 0 0 0-32 32v36.032c0 4.416 3.584 8 8 8h784a8 8 0 0 0 8-8v-36.032a32 32 0 0 0-32-32z"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}createCloseButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center",background:"red"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2578" width="18" height="18"><path d="M572.91974805 512l242.82096754-242.82096757c16.30246778-16.30246778 16.30246778-43.75925563 0-60.91974802-16.30246778-16.30246778-43.75925563-16.30246778-60.91974802 0L512 451.08025195 269.17903243 208.25928441c-16.30246778-16.30246778-43.75925563-16.30246778-60.91974802 0-16.30246778 16.30246778-16.30246778 43.75925563 0 60.91974802L451.08025195 512l-242.82096754 242.82096757c-16.30246778 16.30246778-16.30246778 43.75925563 0 60.91974802 16.30246778 16.30246778 43.75925563 16.30246778 60.91974802 0l242.82096757-242.82096754 242.82096757 242.82096754c16.30246778 16.30246778 43.75925563 16.30246778 60.91974802 0 16.30246778-16.30246778 16.30246778-43.75925563 0-60.91974802L572.91974805 512z" fill="#ffffff" p-id="2579"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}createConfirmButton(opt){let textMesh=Object.assign(this.createButton({...opt,style:{...opt?.style,display:"flex",alignItems:"center",background:"#4caf50"}}),{setText(text){textMesh.domElement.innerHTML=`\n <div class='flex items-center'>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M384 785.67L97.83 499.5l60.34-60.34L384 664.99l439.16-439.16 60.34 60.34z" p-id="7237" fill="#ffffff"></path></svg> ${text?`<span style="margin-left: 4px">${text}</span>`:""}\n </div>\n `}});return textMesh.setText(opt?.text),textMesh}}class MergeLine extends Command{static name="MergeLine";static shortcutKeys=["Control","G"];static commandName="merge-line";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(MergeLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLines.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(MergeLine.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(MergeLine.commandName)&&await this.commandManager.start(MergeLine.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?selectLines.length<2?(ElMessage({message:"未执行线段合并,请选择至少两条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}mergeLines(next,selectLines){selectLines=selectLines.filter(line2=>!line2.userData.isDoor);const removeLines=/* @__PURE__ */new Set,newLines=[];mergeChainsLine(selectLines,void 0,removeLines,newLines),newLines.length?(next({newLines:newLines,deleteLines:[...removeLines]}),ElMessage({message:"已合并",type:"success"})):(ElMessage({message:"合并失败,未找到共用点",type:"warning"}),this.commandManager.cancel())}completed({newLines:newLines,deleteLines:deleteLines}){this.renderManager.addLines(newLines),this.renderManager.removeLines(deleteLines),this.renderManager.draw()}rollback(data){const{newLines:newLines,deleteLines:deleteLines}=data;return this.renderManager.addLines(deleteLines),this.renderManager.removeLines(newLines),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}class DeleteSelectLine extends Command{static name="DeleteSelectLine";static shortcutKeys=["Delete"];static commandName="deleteSelectLine";onAddFromParent(parent2){super.onAddFromParent(parent2),this.initCommandFlow({shortcutKeys:DeleteSelectLine.shortcutKeys,getStartData:()=>this.default.getSelectData()}).add(this.start.bind(this))}start(next,lines){if(Array.isArray(lines)){if(0===lines.length)return ElMessage({message:"请选择线段",type:"warning"}),void this.cancel();for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.removeHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.removeLine(line2,!1)}this.renderManager.draw(),ElMessage({message:"删除成功",type:"success"}),next(lines)}else ElMessage({message:"进入命令失败",type:"warning"}),this.cancel()}onRollback(lines){for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.addHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.addLine(line2)}return this.renderManager.draw(),lines}onRevokeRollback(lines){for(let i=0;i<lines.length;i++){const line2=lines[i];line2.currentData.insertObject?WH.removeHole(line2.currentData.line,line2.currentData.insertObject):this.renderManager.removeLine(line2,!1)}return this.renderManager.draw(),lines}}class TwoPointConnection extends Command{static name="TwoPointConnection";static shortcutKeys=["Control","P"];static commandName="twoPointConnection";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(this.commandName)&&await this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2!==selectLines.length?(ElMessage({message:"请选择2条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}connection(next,selectLines){let start,end,diatance=1/0;for(let i=0;i<2;i++)for(let j=0;j<2;j++){const point1=selectLines[0].points[i],point2=selectLines[1].points[j],d=point1.distance(point2);d<diatance&&(start=point1,end=point2,diatance=d)}if(start&&end){next(new LineSegment(start.clone(),end.clone())),ElMessage({message:"连接成功",type:"success"})}else this.cancel()}completed(line2){this.renderManager.addLine(line2),this.renderManager.draw()}rollback(line2){return this.renderManager.removeLine(line2),line2}revokeRollback(line2){return this.completed(line2),line2}}class TwoLineConnectionLine extends Command{static name="TwoLineConnectionLine";static shortcutKeys=["Control","L"];static commandName="twoLineConnectionLine";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(this.commandName)&&await this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2!==selectLines.length?(ElMessage({message:"请选择2条线段",type:"warning"}),this.cancel()):selectLines[0].isParallelTo(selectLines[1],45)?(ElMessage({message:"两条线段角度需要小于135度",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}connection(next,selectLines){const line1=selectLines[0],line2=selectLines[1],point=selectLines[0].getIntersection(selectLines[1]);if(!point)return;const oldLine1=line1.points.map(p=>p.clone()),oldLine2=line2.points.map(p=>p.clone());line1.start.distance(point)<line1.end.distance(point)?line1.start.copy(point):line1.end.copy(point),line2.start.distance(point)<line2.end.distance(point)?line2.start.copy(point):line2.end.copy(point);const newLine1=line1.points.map(p=>p.clone()),newLine2=line2.points.map(p=>p.clone());next({line1:line1,line2:line2,oldLine1:oldLine1,oldLine2:oldLine2,newLine1:newLine1,newLine2:newLine2}),ElMessage({message:"连接成功",type:"success"})}completed({line1:line1,line2:line2,newLine1:newLine1,newLine2:newLine2}){this.renderManager.removeLine(line1),this.renderManager.removeLine(line2),line1.set(...newLine1),line2.set(...newLine2),this.renderManager.addLines([line1,line2]),this.renderManager.draw()}rollback(data){const{line1:line1,line2:line2,oldLine1:oldLine1,oldLine2:oldLine2}=data;return this.renderManager.removeLine(line1),this.renderManager.removeLine(line2),line1.set(...oldLine1),line2.set(...oldLine2),this.renderManager.addLines([line1,line2]),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}class SelectAll extends Command{static name="SelectAll";container=new THREE.Group;static shortcutKeys=["Control","A"];static commandName="selectAll";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(SelectAll.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addKeyCombination(SelectAll.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(SelectAll.commandName)&&await this.commandManager.start(SelectAll.commandName)}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}selectAll(next){next([...this.renderManager.lines])}completed(lines){lines.map(line2=>this.default.addSelectLine(line2))}rollback(lines){return lines.map(line2=>this.default.removeSelectLine(line2)),lines}revokeRollback(lines){return this.completed(lines),lines}}class ViewAngle extends Command{static name="ViewAngle";static shortcutKeys=["Control","R"];static commandName="viewAngle";onAddFromParent(parent2){super.onAddFromParent(parent2);const commandFlow=this.commandManager.addCommandFlow(ViewAngle.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.viewAngle.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),this.eventInput.addKeyCombination(ViewAngle.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isKeyCombination(ViewAngle.commandName)&&await this.commandManager.start(ViewAngle.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?2===selectLines.length&&selectLines[0].isSameEndpoint(selectLines[1])?next(selectLines):(ElMessage({message:"请选择两条具有端点相交的线段",type:"warning"}),this.cancel()):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}viewAngle(next,selectLines){const[start,end]=selectLines,radius=Math.min(.8*start.length,.8*end.length);let center,point1,point2,gapAngle=0,textAngle=0;function getAngle(center2,p){const dx=p.x-center2.x,dy=p.y-center2.y;let angle3=Math.atan2(dy,dx)*(180/Math.PI);return angle3<0&&(angle3+=360),angle3}start.isSameEndpointAsStart(end)?(center=start.start,point1=start.end):(center=start.end,point1=start.start),point2=end.isSameEndpointAsStart(start)?end.end:end.start;const angle1=getAngle(center,point1),angle2=getAngle(center,point2),min=Math.min(angle1,angle2),max=Math.max(angle1,angle2),pointArray=[];function addSegments(startAngle,endAngle){for(let i=startAngle;i<=endAngle;i++){const x1=Math.cos(i*Math.PI/180)*radius+center.x,y1=Math.sin(i*Math.PI/180)*radius+center.y,x2=Math.cos((i+1)*Math.PI/180)*radius+center.x,y2=Math.sin((i+1)*Math.PI/180)*radius+center.y;pointArray.push(x1,y1,0,x2,y2,0)}}max-min>180?(addSegments(0,min),addSegments(max,360),gapAngle=360-(max-min),textAngle=(max+gapAngle/2)%360):(addSegments(min,max),gapAngle=max-min,textAngle=min+gapAngle/2);const lineSegment=new THREE.LineSegments;lineSegment.geometry=this.renderManager.createGeometry({position:pointArray},pointArray.length/3),lineSegment.material=new THREE.LineBasicMaterial({color:16711935}),this.renderManager.container.add(lineSegment);const x=Math.cos(textAngle*Math.PI/180)*radius+center.x,y=Math.sin(textAngle*Math.PI/180)*radius+center.y,textObj2D=this.renderer.createText(Number(gapAngle.toFixed(2)),new THREE.Vector3(x,y,0),{textShadow:"0px 0px 2px #000"},this.renderManager.container);let mouse_0_count=0;this.addEventRecord("clear").add(()=>lineSegment.removeFromParent()).add(()=>textObj2D.removeFromParent()).add(this.eventInput.addEventListener("codeChange",()=>{this.eventInput.isOnlyKeyDown("enter")?next():this.eventInput.isOnlyKeyDown("mouse_0")&&(mouse_0_count++,1===mouse_0_count?setTimeout(()=>mouse_0_count=0,500):2===mouse_0_count&&(next(),mouse_0_count=0))}))}}class Shape2D extends THREE.Mesh{constructor(material){super(new THREE.BufferGeometry,material??new THREE.MeshBasicMaterial({color:13421772,side:THREE.DoubleSide,transparent:!0})),this.frustumCulled=!1}setPositions(vertices){let attr=this.geometry.getAttribute("position");if(attr&&attr.array.length===vertices.length){attr.array.set(vertices),attr.needsUpdate=!0}else attr=new THREE.Float32BufferAttribute(vertices,3),this.geometry.setAttribute("position",attr);this.geometry.computeBoundingBox(),this.geometry.computeBoundingSphere()}setUVs(uvs){let attr=this.geometry.getAttribute("uv");if(attr&&attr.array.length===uvs.length){attr.array.set(uvs),attr.needsUpdate=!0}else attr=new THREE.Float32BufferAttribute(uvs,2),this.geometry.setAttribute("uv",attr)}setIndices(indices){const current=this.geometry.getIndex();if(current&¤t.array.length===indices.length){current.array.set(indices),current.needsUpdate=!0}else this.geometry.setIndex([...indices])}fromRectangle(rect){const p0=rect.p0,p1=rect.p1,p2=rect.p2,p3=rect.p3;return this.setPositions([p0.x,p0.y,0,p1.x,p1.y,0,p2.x,p2.y,0,p3.x,p3.y,0]),this.setUVs([0,0,1,0,1,1,0,1]),this.setIndices([0,1,2,0,2,3]),this}async setTexture(map){let texture2;texture2=map instanceof THREE.Texture?map:"string"==typeof map?await(new THREE.TextureLoader).loadAsync(map):new THREE.CanvasTexture(map),texture2.needsUpdate=!0;const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)(material instanceof THREE.MeshBasicMaterial||material instanceof THREE.MeshStandardMaterial||material instanceof THREE.MeshPhongMaterial||material instanceof THREE.MeshLambertMaterial)&&(material.map=texture2,material.needsUpdate=!0);return texture2}setColor(color){const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)"color"in material&&material.color.set(color);return this}setOpacity(opacity){const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials)material.transparent=opacity<1,material.opacity=opacity,material.needsUpdate=!0;return this}getBounds(){return this.geometry.boundingBox||this.geometry.computeBoundingBox(),this.geometry.boundingBox}getSize(){const size=new THREE.Vector3;return this.getBounds().getSize(size),size}getCenter(){const center=new THREE.Vector3;return this.getBounds().getCenter(center),center}clearGeometry(){return this.geometry.setAttribute("position",new THREE.Float32BufferAttribute([],3)),this.geometry.deleteAttribute("uv"),this.geometry.setIndex([]),this}dispose(){this.geometry.dispose();const materials=Array.isArray(this.material)?this.material:[this.material];for(const material of materials){const map=material.map;map?.dispose&&map.dispose(),material.dispose()}}}class Wall2D extends Shape2D{line;rectangle=new Rectangle;width=0;constructor(line2,width=.5*DEFAULT_WALL_WIDTH){super(),this.line=line2,this.width=width,this.setLine(line2),this.setColor(16777215)}setLine(line2){this.fromRectangle(line2.toRectangle(this.width,"butt",this.rectangle)),this.clear();const edges=new THREE.LineSegments(new THREE.EdgesGeometry(this.geometry),new THREE.LineBasicMaterial({color:4235007}));this.add(edges)}dispose(){super.dispose(),this.clear()}}class LineAlignmentGuide extends Lines{start=new Vector3;end=new Vector3;constructor(){super(),this.continuous=!1,this.addEventListener("removed",()=>this.clear())}line;set(line2,points=[]){if(!(line2=line2??this.line))return;this.line=line2,this.clear();const step=line2.start.leftNormal(line2.end).multiplyScalar(.4);let start=line2.start.clone().add(step),end=line2.end.clone().add(step);this.start.copy(start.toJson()),this.end.copy(end.toJson()),points.forEach(p=>p.add(step)),step.normalize();for(let i=0;i<points.length+1;i++){const point=i===points.length?end:points[i],pre=0===i?start:points[i-1],dist=Number((1e3*point.distance(pre)).toFixed(0)),center=point.clone().add(pre).multiplyScalar(.5);dist>0&&this.createText(dist,center,{padding:"1px 0px",background:"#fff",width:"35px",color:"#000",textAlign:"center",borderRadius:"6px"})}this.setPoint(this.start,this.end,...points.concat([start,end]).flatMap(p=>{const line22=p.expandAsLine(step,.1).translate(-.05,step),line222=line22.clone().rotate(.25*Math.PI);return[...line22.points.map(p2=>p2.toVector3()),...line222.points.map(p2=>p2.toVector3())]}))}createText(text,pos,style){const div=document.createElement("div");div.innerHTML=text,div.style.pointerEvents="none",Object.assign(div.style,{fontSize:"10px",color:"#ffffff",...style});const css2DObject=new CSS2DObject(div);return pos instanceof Point?css2DObject.position.set(pos.x,pos.y,0):pos instanceof Vector3&&css2DObject.position.copy(pos),this.add(css2DObject),css2DObject}}class DragControlPoint{editor;eventCancels=[];onChange;onStart;onEnd;onEnter;onLeave;onClick;onDblClick;onLongTouch;point;opt;constructor(point,editor,opt={}){this.editor=editor,this.point=point.clone(),this.opt=opt,this.init()}object3D;init(){let point=this.point;const debouncing=new Debouncing(800),{object3D:object3D,defaultWidth:defaultWidth,background:background}=this.createView();this.object3D=object3D;const move=e=>{e instanceof TouchEvent&&this.editor.domEventRegister.updatePointer(e);const pos=Point.from(this.editor.pointerPosition);object3D.position.x=pos.x,object3D.position.y=pos.y,point.copy(pos),this.onChange?.(point),debouncing.cancle(),e?.stopPropagation(),e?.preventDefault()},mouseup=e=>{object3D.element.style.pointerEvents="all",object3D.element.style.background=background,object3D.element.style.width=defaultWidth,object3D.element.style.height=defaultWidth,isMobileRef.value?(object3D.element.removeEventListener("touchmove",move),object3D.element.removeEventListener("touchend",mouseup)):(document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",mouseup),e?.stopPropagation()),e&&this.onEnd&&setTimeout(()=>this.onEnd(point),100),debouncing.cancle()},start=()=>{object3D.element.style.background="#00ff00",object3D.element.style.width="2px",object3D.element.style.height="2px",isMobileRef.value?(object3D.element.addEventListener("touchmove",move),object3D.element.addEventListener("touchend",mouseup)):(document.addEventListener("mousemove",move),document.addEventListener("mouseup",mouseup)),this.onStart?.(point),debouncing.debounce(()=>(mouseup(null),this.onLongTouch?.()))};isMobileRef.value?object3D.element.addEventListener("pointerdown",start):(object3D.element.addEventListener("mousedown",e=>{start(),e.stopPropagation(),e.preventDefault()}),object3D.element.addEventListener("mouseenter",()=>this.onEnter?.()),object3D.element.addEventListener("mouseleave",()=>this.onLeave?.())),object3D.element.addEventListener("click",()=>this.onClick?.()),object3D.element.addEventListener("dblclick",()=>this.onDblClick?.()),this.eventCancels.push(()=>{object3D.removeFromParent()})}setPoint(point){point instanceof Point&&(point=Point.from(point)),this.point.copy(point),this.object3D?.position.set(point.x,point.y,this.object3D.position.z)}createView(){const{size:size,style:style=!1}=this.opt;let point=this.point;const defaultWidth=size?size+"px":isMobileRef.value?"20px":"10px",object3D=this.editor.renderer.createText("",point,{position:"absolute",background:"rgba(255,255,255, 0.4)",borderRadius:"100px",width:defaultWidth,height:defaultWidth,pointerEvents:"all",cursor:"move",transition:"0.25s background",border:"solid 1px #fff",...style},this.editor.container);return createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:`calc(${defaultWidth} * 1.3)`,height:"1px",background:"white",borderRadius:"100px",pointerEvents:"none"}}),createHtml("div",{parent:object3D.element,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"1px",height:`calc(${defaultWidth} * 1.3)`,background:"white",borderRadius:"100px",pointerEvents:"none"}}),{object3D:object3D,defaultWidth:defaultWidth,background:"rgba(255,255,255, 0.4)"}}destroy(){this.eventCancels.forEach(fun=>fun()),this.eventCancels.length=0}}class SnapController{editor;lineSnap=!0;pointSnap=!0;quadtree;radius=0;outQuadtree=!1;constructor(editor,lines,radius=(isMobileRef.value?.08:.06)){this.editor=editor,this.radius=radius;const outQuadtree=lines instanceof Quadtree;this.quadtree=outQuadtree?lines:Quadtree.from(lines),this.outQuadtree=outQuadtree}addLine(line2){this.quadtree.insert(line2)}removeLine(line2){this.quadtree.remove(line2)}snap(point,radius){radius=radius??this.radius;const editor=this.editor,quadtree=this.quadtree;let result={point:Point.from(editor.pointerPosition),find:!1,line:void 0,mode:void 0},queryResult=this.lineSnap?quadtree.queryCircle(point,radius):[];if(queryResult.length){let projectList=queryResult.map(res=>({point:res.line.projectPoint(point),line:res.line})).filter(item=>!!item.point);if(projectList.sort((a,b)=>a.point.distance(point)-b.point.distance(point)),projectList.length){const line2=projectList[0].line,projectPoint=projectList[0].point;result={point:Point.from(projectPoint),find:!0,mode:"line",line:line2},this.pointSnap&&(line2.start.distance(point)<1.5*radius?(result.point.set(line2.start.x,line2.start.y),result.mode="point"):line2.end.distance(point)<1.5*radius&&(result.point.set(line2.end.x,line2.end.y),result.mode="point"))}}return this.editor.renderManager.dispatchEvent({type:"adsorptionPointChange",...result}),result}destroy(){this.outQuadtree||this.quadtree.clear()}}class PointerFollowMove{snapController;editor;currentSelectLine=null;pos=null;snapType=["wall"];snapRadius=.08;emptySpace=!0;ended=!1;_paused=!1;mobileTrigger="dragControlPoint";eventCancels=[];get paused(){return this._paused}onPointerMove;onMobileStart;onMobileEnd;constructor(editor,point,mobileTrigger="dragControlPoint",quadtree){this.editor=editor,this.snapController=new SnapController(editor,quadtree??this.editor.renderManager.lines),this.mobileTrigger=mobileTrigger,this.init(point)}dragControlPoint;init(point){const editor=this.editor;if(isMobile())if("dragControlPoint"===this.mobileTrigger){point=point??Point.zero();const dragControlPoint=new DragControlPoint(point,this.editor);this.dragControlPoint=dragControlPoint,dragControlPoint.onChange=()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))},dragControlPoint.onStart=p=>this.onMobileStart?.(p),dragControlPoint.onEnd=p=>this.onMobileEnd?.(p),this.eventCancels.push(dragControlPoint.destroy.bind(dragControlPoint))}else"pointerdown"===this.mobileTrigger&&this.eventCancels.push(this.editor.domEventRegister.addEventListener("pointerdown",()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))}));else this.eventCancels.push(editor.addEventListener("pointerPositionChange",()=>{this.pointerPositionChange(Point.from(this.editor.pointerPosition))}))}getHole(line2,p){for(const insertObject of WH.getIterator(line2)){const hole=WH.holeDataToLine(line2,insertObject),p2=hole.projectPoint(p,!0);if((p2?.distance(p)??1/0)<.08&&(hole.currentData.insertObject=insertObject,hole.currentData.line=line2,this.hasSnapType([insertObject.type,"hole","passageEntrance"])))return hole}return null}getDoor(line2){return line2.userData.isDoor?line2:null}getBalconyRailing(line2){return line2.userData.isBalconyRailing?line2:null}hasSnapType(keys2){const snapType=this.snapType;return"none"!==snapType&&("all"===snapType||!!Array.isArray(snapType)&&keys2.some(key=>snapType.includes(key)))}pointerPositionChange(pos){if(this.currentSelectLine=null,this.pos=null,"none"!==this.snapType){const{point:point,line:line2}=this.snapController.snap(pos,this.snapRadius);if(line2){if(this.hasSnapType(["window","door","passageEntrance","hole"])){const holeLine=this.getHole(line2,point);holeLine&&(this.currentSelectLine=holeLine)}if(!this.currentSelectLine&&this.hasSnapType(["door"])){const doorLine=this.getDoor(line2);doorLine&&(this.currentSelectLine=doorLine)}if(!this.currentSelectLine&&this.hasSnapType(["balconyRailing"])){const brline=this.getBalconyRailing(line2);brline&&(this.currentSelectLine=brline)}!this.currentSelectLine&&this.hasSnapType(["wall"])&&(line2.userData.isDoor||line2.userData.isBalconyRailing||(this.currentSelectLine=line2)),this.currentSelectLine&&(pos=point)}}("none"===this.snapType||this.currentSelectLine||this.emptySpace)&&(this.pos=pos),this.onPointerMove?.(this.pos,this.currentSelectLine)}setEmptySpace(emptySpace){return this.emptySpace=emptySpace,this}setType(snapType){return this.snapType=snapType,this}setSnapRadius(adsorptRadius){return this.snapRadius=adsorptRadius,this}pause(){this._paused=!0}resume(){this._paused=!1}destroy(){this.eventCancels.forEach(fun=>fun()),this.eventCancels.length=0,this.snapController.destroy(),this.ended=!0}}class LineSelector extends PointerFollowMove{resolve_;onMiss;constructor(editor,point,mobileTrigger,quadtree){super(editor,point,mobileTrigger,quadtree),super.setEmptySpace(!1)}setEmptySpace(_){return this}async getLines(){if(this.ended)throw new Error("顶点选择器已经结束,无法继续使用");if(this.resolve_)throw new Error("已有线段获取任务,请勿重复触发");return this.currentSelectLine=null,new Promise(resolve=>{this.resolve_=resolve;const eventCancel=this.editor.domEventRegister.addEventListener("pointerup",()=>{if(!this.currentSelectLine)return this.onMiss?.();resolve(this.currentSelectLine),this.resolve_=null,eventCancel()})})}[Symbol.asyncIterator](){return this}async next(){if(!this.ended){const result=await this.getLines();if(result)return{value:result,done:!1}}return{value:void 0,done:!0}}}function createVueApp(com,props,parent2){const div=document.createElement("div");div.style.zIndex="20",parent2?.appendChild(div);const app=createApp(com,props);return app.mount(div),()=>{app.unmount(),div.remove()}}const matchIconName=/^[a-z0-9]+(-[a-z0-9]+)*$/,stringToIcon=(value,validate,allowSimpleName,provider="")=>{const colonSeparated=value.split(":");if("@"===value.slice(0,1)){if(colonSeparated.length<2||colonSeparated.length>3)return null;provider=colonSeparated.shift().slice(1)}if(colonSeparated.length>3||!colonSeparated.length)return null;if(colonSeparated.length>1){const name2=colonSeparated.pop(),prefix=colonSeparated.pop(),result={provider:colonSeparated.length>0?colonSeparated[0]:provider,prefix:prefix,name:name2};return validate&&!validateIconName(result)?null:result}const name=colonSeparated[0],dashSeparated=name.split("-");if(dashSeparated.length>1){const result={provider:provider,prefix:dashSeparated.shift(),name:dashSeparated.join("-")};return validate&&!validateIconName(result)?null:result}if(allowSimpleName&&""===provider){const result={provider:provider,prefix:"",name:name};return validate&&!validateIconName(result,allowSimpleName)?null:result}return null},validateIconName=(icon,allowSimpleName)=>!!icon&&!(!(allowSimpleName&&""===icon.prefix||icon.prefix)||!icon.name);const defaultIconDimensions=Object.freeze({left:0,top:0,width:16,height:16}),defaultIconTransformations=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),defaultIconProps=Object.freeze({...defaultIconDimensions,...defaultIconTransformations}),defaultExtendedIconProps=Object.freeze({...defaultIconProps,body:"",hidden:!1});function mergeIconData(parent2,child){const result=function(obj1,obj2){const result={};!obj1.hFlip!=!obj2.hFlip&&(result.hFlip=!0),!obj1.vFlip!=!obj2.vFlip&&(result.vFlip=!0);const rotate=((obj1.rotate||0)+(obj2.rotate||0))%4;return rotate&&(result.rotate=rotate),result}(parent2,child);for(const key in defaultExtendedIconProps)key in defaultIconTransformations?key in parent2&&!(key in result)&&(result[key]=defaultIconTransformations[key]):key in child?result[key]=child[key]:key in parent2&&(result[key]=parent2[key]);return result}function internalGetIconData(data,name,tree){const icons=data.icons,aliases=data.aliases||/* @__PURE__ */Object.create(null);let currentProps={};function parse(name2){currentProps=mergeIconData(icons[name2]||aliases[name2],currentProps)}return parse(name),tree.forEach(parse),mergeIconData(data,currentProps)}function parseIconSet(data,callback){const names2=[];if("object"!=typeof data||"object"!=typeof data.icons)return names2;data.not_found instanceof Array&&data.not_found.forEach(name=>{callback(name,null),names2.push(name)});const tree=function(data){const icons=data.icons,aliases=data.aliases||/* @__PURE__ */Object.create(null),resolved=/* @__PURE__ */Object.create(null);return Object.keys(icons).concat(Object.keys(aliases)).forEach(function resolve(name){if(icons[name])return resolved[name]=[];if(!(name in resolved)){resolved[name]=null;const parent2=aliases[name]&&aliases[name].parent,value=parent2&&resolve(parent2);value&&(resolved[name]=[parent2].concat(value))}return resolved[name]}),resolved}(data);for(const name in tree){const item=tree[name];item&&(callback(name,internalGetIconData(data,name,item)),names2.push(name))}return names2}const optionalPropertyDefaults={provider:"",aliases:{},not_found:{},...defaultIconDimensions};function checkOptionalProps(item,defaults){for(const prop in defaults)if(prop in item&&typeof item[prop]!=typeof defaults[prop])return!1;return!0}function quicklyValidateIconSet(obj){if("object"!=typeof obj||null===obj)return null;const data=obj;if("string"!=typeof data.prefix||!obj.icons||"object"!=typeof obj.icons)return null;if(!checkOptionalProps(obj,optionalPropertyDefaults))return null;const icons=data.icons;for(const name in icons){const icon=icons[name];if(!name||"string"!=typeof icon.body||!checkOptionalProps(icon,defaultExtendedIconProps))return null}const aliases=data.aliases||/* @__PURE__ */Object.create(null);for(const name in aliases){const icon=aliases[name],parent2=icon.parent;if(!name||"string"!=typeof parent2||!icons[parent2]&&!aliases[parent2]||!checkOptionalProps(icon,defaultExtendedIconProps))return null}return data}const dataStorage=/* @__PURE__ */Object.create(null);function getStorage(provider,prefix){const providerStorage=dataStorage[provider]||(dataStorage[provider]=/* @__PURE__ */Object.create(null));return providerStorage[prefix]||(providerStorage[prefix]=function(provider,prefix){return{provider:provider,prefix:prefix,icons:/* @__PURE__ */Object.create(null),missing:/* @__PURE__ */new Set}}(provider,prefix))}function addIconSet(storage2,data){return quicklyValidateIconSet(data)?parseIconSet(data,(name,icon)=>{icon?storage2.icons[name]=icon:storage2.missing.add(name)}):[]}let simpleNames=!1;function allowSimpleNames(allow){return"boolean"==typeof allow&&(simpleNames=allow),simpleNames}function addCollection(data,provider){if("object"!=typeof data)return!1;if("string"!=typeof provider&&(provider=data.provider||""),simpleNames&&!provider&&!data.prefix){let added=!1;return quicklyValidateIconSet(data)&&(data.prefix="",parseIconSet(data,(name,icon)=>{(function(name,data){const icon=stringToIcon(name,!0,simpleNames);if(!icon)return!1;const storage2=getStorage(icon.provider,icon.prefix);return data?function(storage2,name,icon){try{if("string"==typeof icon.body)return storage2.icons[name]={...icon},!0}catch(err){}return!1}(storage2,icon.name,data):(storage2.missing.add(icon.name),!0)})(name,icon)&&(added=!0)})),added}const prefix=data.prefix;return!!validateIconName({prefix:prefix,name:"a"})&&!!addIconSet(getStorage(provider,prefix),data)}const defaultIconSizeCustomisations=Object.freeze({width:null,height:null}),defaultIconCustomisations=Object.freeze({...defaultIconSizeCustomisations,...defaultIconTransformations}),unitsSplit=/(-?[0-9.]*[0-9]+[0-9.]*)/g,unitsTest=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function calculateSize(size,ratio,precision){if(1===ratio)return size;if(precision=precision||100,"number"==typeof size)return Math.ceil(size*ratio*precision)/precision;if("string"!=typeof size)return size;const oldParts=size.split(unitsSplit);if(null===oldParts||!oldParts.length)return size;const newParts=[];let code=oldParts.shift(),isNumber2=unitsTest.test(code);for(;;){if(isNumber2){const num=parseFloat(code);isNaN(num)?newParts.push(code):newParts.push(Math.ceil(num*ratio*precision)/precision)}else newParts.push(code);if(code=oldParts.shift(),void 0===code)return newParts.join("");isNumber2=!isNumber2}}const regex=/\sid="(\S+)"/g,counters=/* @__PURE__ */new Map;function replaceIDs(body){const ids=[];let match;for(;match=regex.exec(body);)ids.push(match[1]);if(!ids.length)return body;const suffix="suffix"+(16777216*Math.random()|Date.now()).toString(16);return ids.forEach(id=>{const newID=function(id){id=id.replace(/[0-9]+$/,"")||"a";const count=counters.get(id)||0;return counters.set(id,count+1),count?`${id}${count}`:id}(id),escapedID=id.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");body=body.replace(new RegExp('([#;"])('+escapedID+')([")]|\\.[a-z])',"g"),"$1"+newID+suffix+"$3")}),body=body.replace(new RegExp(suffix,"g"),"")}const storage=/* @__PURE__ */Object.create(null);function getAPIModule(provider){return storage[provider]||storage[""]}function createAPIConfig(source){let resources;if("string"==typeof source.resources)resources=[source.resources];else if(resources=source.resources,!(resources instanceof Array&&resources.length))return null;return{resources:resources,path:source.path||"/",maxURL:source.maxURL||500,rotate:source.rotate||750,timeout:source.timeout||5e3,random:!0===source.random,index:source.index||0,dataAfterTimeout:!1!==source.dataAfterTimeout}}const configStorage=/* @__PURE__ */Object.create(null),fallBackAPISources=["https://api.simplesvg.com","https://api.unisvg.com"],fallBackAPI=[];for(;fallBackAPISources.length>0;)1===fallBackAPISources.length||Math.random()>.5?fallBackAPI.push(fallBackAPISources.shift()):fallBackAPI.push(fallBackAPISources.pop());function addAPIProvider(provider,customConfig){const config=createAPIConfig(customConfig);return null!==config&&(configStorage[provider]=config,!0)}function getAPIConfig(provider){return configStorage[provider]}configStorage[""]=createAPIConfig({resources:["https://api.iconify.design"].concat(fallBackAPI)});let fetchModule=(()=>{let callback;try{if(callback=fetch,"function"==typeof callback)return callback}catch(err){}})();const fetchAPIModule={prepare:(provider,prefix,icons)=>{const results=[],maxLength=function(provider,prefix){const config=getAPIConfig(provider);if(!config)return 0;let result;if(config.maxURL){let maxHostLength=0;config.resources.forEach(item=>{maxHostLength=Math.max(maxHostLength,item.length)});const url=prefix+".json?icons=";result=config.maxURL-maxHostLength-config.path.length-url.length}else result=0;return result}(provider,prefix);let item={type:"icons",provider:provider,prefix:prefix,icons:[]},length=0;return icons.forEach((name,index)=>{length+=name.length+1,length>=maxLength&&index>0&&(results.push(item),item={type:"icons",provider:provider,prefix:prefix,icons:[]},length=name.length),item.icons.push(name)}),results.push(item),results},send:(host,params,callback)=>{if(!fetchModule)return void callback("abort",424);let path=function(provider){if("string"==typeof provider){const config=getAPIConfig(provider);if(config)return config.path}return"/"}(params.provider);switch(params.type){case"icons":{const prefix=params.prefix,iconsList=params.icons.join(",");path+=prefix+".json?"+new URLSearchParams({icons:iconsList}).toString();break}case"custom":{const uri=params.uri;path+="/"===uri.slice(0,1)?uri.slice(1):uri;break}default:return void callback("abort",400)}let defaultError=503;fetchModule(host+path).then(response=>{const status=response.status;if(200===status)return defaultError=501,response.json();setTimeout(()=>{callback(function(status){return 404===status}(status)?"abort":"next",status)})}).then(data=>{"object"==typeof data&&null!==data?setTimeout(()=>{callback("success",data)}):setTimeout(()=>{404===data?callback("abort",data):callback("next",defaultError)})}).catch(()=>{callback("next",defaultError)})}};function removeCallback(storages,id){storages.forEach(storage2=>{const items=storage2.loaderCallbacks;items&&(storage2.loaderCallbacks=items.filter(row=>row.id!==id))})}let idCounter=0;const defaultConfig={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sendQuery(config,payload,query,done){const resourcesCount=config.resources.length,startIndex=config.random?Math.floor(Math.random()*resourcesCount):config.index;let resources;if(config.random){let list=config.resources.slice(0);for(resources=[];list.length>1;){const nextIndex=Math.floor(Math.random()*list.length);resources.push(list[nextIndex]),list=list.slice(0,nextIndex).concat(list.slice(nextIndex+1))}resources=resources.concat(list)}else resources=config.resources.slice(startIndex).concat(config.resources.slice(0,startIndex));const startTime=Date.now();let lastError,status="pending",queriesSent=0,timer=null,queue=[],doneCallbacks=[];function resetTimer(){timer&&(clearTimeout(timer),timer=null)}function abort(){"pending"===status&&(status="aborted"),resetTimer(),queue.forEach(item=>{"pending"===item.status&&(item.status="aborted")}),queue=[]}function subscribe(callback,overwrite){overwrite&&(doneCallbacks=[]),"function"==typeof callback&&doneCallbacks.push(callback)}function failQuery(){status="failed",doneCallbacks.forEach(callback=>{callback(void 0,lastError)})}function clearQueue(){queue.forEach(item=>{"pending"===item.status&&(item.status="aborted")}),queue=[]}function execNext(){if("pending"!==status)return;resetTimer();const resource=resources.shift();if(void 0===resource)return queue.length?void(timer=setTimeout(()=>{resetTimer(),"pending"===status&&(clearQueue(),failQuery())},config.timeout)):void failQuery();const item={status:"pending",resource:resource,callback:(status2,data)=>{!function(item,response,data){const isError="success"!==response;switch(queue=queue.filter(queued=>queued!==item),status){case"pending":break;case"failed":if(isError||!config.dataAfterTimeout)return;break;default:return}if("abort"===response)return lastError=data,void failQuery();if(isError)return lastError=data,void(queue.length||(resources.length?execNext():failQuery()));if(resetTimer(),clearQueue(),!config.random){const index=config.resources.indexOf(item.resource);-1!==index&&index!==config.index&&(config.index=index)}status="completed",doneCallbacks.forEach(callback=>{callback(data)})}(item,status2,data)}};queue.push(item),queriesSent++,timer=setTimeout(execNext,config.rotate),query(resource,payload,item.callback)}return"function"==typeof done&&doneCallbacks.push(done),setTimeout(execNext),function(){return{startTime:startTime,payload:payload,status:status,queriesSent:queriesSent,queriesPending:queue.length,subscribe:subscribe,abort:abort}}}function initRedundancy(cfg){const config={...defaultConfig,...cfg};let queries=[];function cleanup(){queries=queries.filter(item=>"pending"===item().status)}return{query:function(payload,queryCallback,doneCallback){const query2=sendQuery(config,payload,queryCallback,(data,error)=>{cleanup(),doneCallback&&doneCallback(data,error)});return queries.push(query2),query2},find:function(callback){return queries.find(value=>callback(value))||null},setIndex:index=>{config.index=index},getIndex:()=>config.index,cleanup:cleanup}}function emptyCallback$1(){}const redundancyCache=/* @__PURE__ */Object.create(null);function sendAPIQuery(target,query,callback){let redundancy,send2;if("string"==typeof target){const api=getAPIModule(target);if(!api)return callback(void 0,424),emptyCallback$1;send2=api.send;const cached=function(provider){if(!redundancyCache[provider]){const config=getAPIConfig(provider);if(!config)return;redundancyCache[provider]={config:config,redundancy:initRedundancy(config)}}return redundancyCache[provider]}(target);cached&&(redundancy=cached.redundancy)}else{const config=createAPIConfig(target);if(config){redundancy=initRedundancy(config);const api=getAPIModule(target.resources?target.resources[0]:"");api&&(send2=api.send)}}return redundancy&&send2?redundancy.query(query,send2,callback)().abort:(callback(void 0,424),emptyCallback$1)}function emptyCallback(){}function loadedNewIcons(storage2){storage2.iconsLoaderFlag||(storage2.iconsLoaderFlag=!0,setTimeout(()=>{storage2.iconsLoaderFlag=!1,function(storage2){storage2.pendingCallbacksFlag||(storage2.pendingCallbacksFlag=!0,setTimeout(()=>{storage2.pendingCallbacksFlag=!1;const items=storage2.loaderCallbacks?storage2.loaderCallbacks.slice(0):[];if(!items.length)return;let hasPending=!1;const provider=storage2.provider,prefix=storage2.prefix;items.forEach(item=>{const icons=item.icons,oldLength=icons.pending.length;icons.pending=icons.pending.filter(icon=>{if(icon.prefix!==prefix)return!0;const name=icon.name;if(storage2.icons[name])icons.loaded.push({provider:provider,prefix:prefix,name:name});else{if(!storage2.missing.has(name))return hasPending=!0,!0;icons.missing.push({provider:provider,prefix:prefix,name:name})}return!1}),icons.pending.length!==oldLength&&(hasPending||removeCallback([storage2],item.id),item.callback(icons.loaded.slice(0),icons.missing.slice(0),icons.pending.slice(0),item.abort))})}))}(storage2)}))}function parseLoaderResponse(storage2,icons,data){function checkMissing(){const pending=storage2.pendingIcons;icons.forEach(name=>{pending&&pending.delete(name),storage2.icons[name]||storage2.missing.add(name)})}if(data&&"object"==typeof data)try{if(!addIconSet(storage2,data).length)return void checkMissing()}catch(err){console.error(err)}checkMissing(),loadedNewIcons(storage2)}function parsePossiblyAsyncResponse(response,callback){response instanceof Promise?response.then(data=>{callback(data)}).catch(()=>{callback(null)}):callback(response)}function loadNewIcons(storage2,icons){storage2.iconsToLoad?storage2.iconsToLoad=storage2.iconsToLoad.concat(icons).sort():storage2.iconsToLoad=icons,storage2.iconsQueueFlag||(storage2.iconsQueueFlag=!0,setTimeout(()=>{storage2.iconsQueueFlag=!1;const{provider:provider,prefix:prefix}=storage2,icons2=storage2.iconsToLoad;if(delete storage2.iconsToLoad,!icons2||!icons2.length)return;const customIconLoader=storage2.loadIcon;if(storage2.loadIcons&&(icons2.length>1||!customIconLoader))return void parsePossiblyAsyncResponse(storage2.loadIcons(icons2,prefix,provider),data=>{parseLoaderResponse(storage2,icons2,data)});if(customIconLoader)return void icons2.forEach(name=>{parsePossiblyAsyncResponse(customIconLoader(name,prefix,provider),data=>{parseLoaderResponse(storage2,[name],data?{prefix:prefix,icons:{[name]:data}}:null)})});const{valid:valid,invalid:invalid}=function(icons){const valid=[],invalid=[];return icons.forEach(name=>{(name.match(matchIconName)?valid:invalid).push(name)}),{valid:valid,invalid:invalid}}(icons2);if(invalid.length&&parseLoaderResponse(storage2,invalid,null),!valid.length)return;const api=prefix.match(matchIconName)?getAPIModule(provider):null;api?api.prepare(provider,prefix,valid).forEach(item=>{sendAPIQuery(provider,item,data=>{parseLoaderResponse(storage2,item.icons,data)})}):parseLoaderResponse(storage2,valid,null)}))}const loadIcons=(icons,callback)=>{const sortedIcons=function(icons){const result={loaded:[],missing:[],pending:[]},storage2=/* @__PURE__ */Object.create(null);icons.sort((a,b)=>a.provider!==b.provider?a.provider.localeCompare(b.provider):a.prefix!==b.prefix?a.prefix.localeCompare(b.prefix):a.name.localeCompare(b.name));let lastIcon={provider:"",prefix:"",name:""};return icons.forEach(icon=>{if(lastIcon.name===icon.name&&lastIcon.prefix===icon.prefix&&lastIcon.provider===icon.provider)return;lastIcon=icon;const provider=icon.provider,prefix=icon.prefix,name=icon.name,providerStorage=storage2[provider]||(storage2[provider]=/* @__PURE__ */Object.create(null)),localStorage2=providerStorage[prefix]||(providerStorage[prefix]=getStorage(provider,prefix));let list;list=name in localStorage2.icons?result.loaded:""===prefix||localStorage2.missing.has(name)?result.missing:result.pending;const item={provider:provider,prefix:prefix,name:name};list.push(item)}),result}(function(list,validate=!0,simpleNames2=!1){const result=[];return list.forEach(item=>{const icon="string"==typeof item?stringToIcon(item,validate,simpleNames2):item;icon&&result.push(icon)}),result}(icons,!0,allowSimpleNames()));if(!sortedIcons.pending.length){let callCallback=!0;return callback&&setTimeout(()=>{callCallback&&callback(sortedIcons.loaded,sortedIcons.missing,sortedIcons.pending,emptyCallback)}),()=>{callCallback=!1}}const newIcons=/* @__PURE__ */Object.create(null),sources=[];let lastProvider,lastPrefix;return sortedIcons.pending.forEach(icon=>{const{provider:provider,prefix:prefix}=icon;if(prefix===lastPrefix&&provider===lastProvider)return;lastProvider=provider,lastPrefix=prefix,sources.push(getStorage(provider,prefix));const providerNewIcons=newIcons[provider]||(newIcons[provider]=/* @__PURE__ */Object.create(null));providerNewIcons[prefix]||(providerNewIcons[prefix]=[])}),sortedIcons.pending.forEach(icon=>{const{provider:provider,prefix:prefix,name:name}=icon,storage2=getStorage(provider,prefix),pendingQueue=storage2.pendingIcons||(storage2.pendingIcons=/* @__PURE__ */new Set);pendingQueue.has(name)||(pendingQueue.add(name),newIcons[provider][prefix].push(name))}),sources.forEach(storage2=>{const list=newIcons[storage2.provider][storage2.prefix];list.length&&loadNewIcons(storage2,list)}),callback?function(callback,icons,pendingSources){const id=idCounter++,abort=removeCallback.bind(null,pendingSources,id);if(!icons.pending.length)return abort;const item={id:id,icons:icons,callback:callback,abort:abort};return pendingSources.forEach(storage2=>{(storage2.loaderCallbacks||(storage2.loaderCallbacks=[])).push(item)}),abort}(callback,sortedIcons,sources):emptyCallback};const separator=/[\s,]+/;function flipFromString(custom,flip){flip.split(separator).forEach(str=>{switch(str.trim()){case"horizontal":custom.hFlip=!0;break;case"vertical":custom.vFlip=!0}})}function rotateFromString(value,defaultValue=0){const units=value.replace(/^-?[0-9.]*/,"");function cleanup(value2){for(;value2<0;)value2+=4;return value2%4}if(""===units){const num=parseInt(value);return isNaN(num)?0:cleanup(num)}if(units!==value){let split=0;switch(units){case"%":split=25;break;case"deg":split=90}if(split){let num=parseFloat(value.slice(0,value.length-units.length));return isNaN(num)?0:(num/=split,num%1==0?cleanup(num):0)}}return defaultValue}const defaultExtendedIconCustomisations={...defaultIconCustomisations,inline:!1},svgDefaults={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},commonProps={display:"inline-block"},monotoneProps={backgroundColor:"currentColor"},coloredProps={backgroundColor:"transparent"},propsToAdd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},propsToAddTo={webkitMask:monotoneProps,mask:monotoneProps,background:coloredProps};for(const prefix in propsToAddTo){const list=propsToAddTo[prefix];for(const prop in propsToAdd)list[prefix+prop]=propsToAdd[prop]}const customisationAliases={};function fixSize(value){return value+(value.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(prefix=>{const attr=prefix.slice(0,1)+"Flip";customisationAliases[prefix+"-flip"]=attr,customisationAliases[prefix.slice(0,1)+"-flip"]=attr,customisationAliases[prefix+"Flip"]=attr});const render=(icon,props)=>{const customisations=function(defaults,item){const result={...defaults};for(const key in item){const value=item[key],valueType=typeof value;key in defaultIconSizeCustomisations?(null===value||value&&("string"===valueType||"number"===valueType))&&(result[key]=value):valueType===typeof result[key]&&(result[key]="rotate"===key?value%4:value)}return result}(defaultExtendedIconCustomisations,props),componentProps={...svgDefaults},mode=props.mode||"svg",style={},propsStyle=props.style,customStyle="object"!=typeof propsStyle||propsStyle instanceof Array?{}:propsStyle;for(let key in props){const value=props[key];if(void 0!==value)switch(key){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":customisations[key]=!0===value||"true"===value||1===value;break;case"flip":"string"==typeof value&&flipFromString(customisations,value);break;case"color":style.color=value;break;case"rotate":"string"==typeof value?customisations[key]=rotateFromString(value):"number"==typeof value&&(customisations[key]=value);break;case"ariaHidden":case"aria-hidden":!0!==value&&"true"!==value&&delete componentProps["aria-hidden"];break;default:{const alias=customisationAliases[key];alias?!0!==value&&"true"!==value&&1!==value||(customisations[alias]=!0):void 0===defaultExtendedIconCustomisations[key]&&(componentProps[key]=value)}}}const item=function(icon,customisations){const fullIcon={...defaultIconProps,...icon},fullCustomisations={...defaultIconCustomisations,...customisations},box={left:fullIcon.left,top:fullIcon.top,width:fullIcon.width,height:fullIcon.height};let body=fullIcon.body;[fullIcon,fullCustomisations].forEach(props=>{const transformations=[],hFlip=props.hFlip,vFlip=props.vFlip;let tempValue,rotation=props.rotate;switch(hFlip?vFlip?rotation+=2:(transformations.push("translate("+(box.width+box.left).toString()+" "+(0-box.top).toString()+")"),transformations.push("scale(-1 1)"),box.top=box.left=0):vFlip&&(transformations.push("translate("+(0-box.left).toString()+" "+(box.height+box.top).toString()+")"),transformations.push("scale(1 -1)"),box.top=box.left=0),rotation<0&&(rotation-=4*Math.floor(rotation/4)),rotation%=4,rotation){case 1:tempValue=box.height/2+box.top,transformations.unshift("rotate(90 "+tempValue.toString()+" "+tempValue.toString()+")");break;case 2:transformations.unshift("rotate(180 "+(box.width/2+box.left).toString()+" "+(box.height/2+box.top).toString()+")");break;case 3:tempValue=box.width/2+box.left,transformations.unshift("rotate(-90 "+tempValue.toString()+" "+tempValue.toString()+")")}rotation%2==1&&(box.left!==box.top&&(tempValue=box.left,box.left=box.top,box.top=tempValue),box.width!==box.height&&(tempValue=box.width,box.width=box.height,box.height=tempValue)),transformations.length&&(body=function(body,start,end){const split=function(content,tag="defs"){let defs="";const index=content.indexOf("<"+tag);for(;index>=0;){const start=content.indexOf(">",index),end=content.indexOf("</"+tag);if(-1===start||-1===end)break;const endEnd=content.indexOf(">",end);if(-1===endEnd)break;defs+=content.slice(start+1,end).trim(),content=content.slice(0,index).trim()+content.slice(endEnd+1)}return{defs:defs,content:content}}(body);return defs=split.defs,content=start+split.content+end,defs?"<defs>"+defs+"</defs>"+content:content;var defs,content}(body,'<g transform="'+transformations.join(" ")+'">',"</g>"))});const customisationsWidth=fullCustomisations.width,customisationsHeight=fullCustomisations.height,boxWidth=box.width,boxHeight=box.height;let width,height;null===customisationsWidth?(height=null===customisationsHeight?"1em":"auto"===customisationsHeight?boxHeight:customisationsHeight,width=calculateSize(height,boxWidth/boxHeight)):(width="auto"===customisationsWidth?boxWidth:customisationsWidth,height=null===customisationsHeight?calculateSize(width,boxHeight/boxWidth):"auto"===customisationsHeight?boxHeight:customisationsHeight);const attributes={},setAttr=(prop,value)=>{(value=>"unset"===value||"undefined"===value||"none"===value)(value)||(attributes[prop]=value.toString())};setAttr("width",width),setAttr("height",height);const viewBox=[box.left,box.top,boxWidth,boxHeight];return attributes.viewBox=viewBox.join(" "),{attributes:attributes,viewBox:viewBox,body:body}}(icon,customisations),renderAttribs=item.attributes;if(customisations.inline&&(style.verticalAlign="-0.125em"),"svg"===mode)return componentProps.style={...style,...customStyle},Object.assign(componentProps,renderAttribs),componentProps.innerHTML=replaceIDs(item.body),h("svg",componentProps);const{body:body,width:width,height:height}=icon,useMask="mask"===mode||"bg"!==mode&&-1!==body.indexOf("currentColor"),html=function(body,attributes){let renderAttribsHTML=-1===body.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const attr in attributes)renderAttribsHTML+=" "+attr+'="'+attributes[attr]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+renderAttribsHTML+">"+body+"</svg>"}(body,{...renderAttribs,width:width+"",height:height+""});var svg;return componentProps.style={...style,"--svg":(svg=html,'url("'+function(svg){return"data:image/svg+xml,"+function(svg){return svg.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(svg)}(svg)+'")'),width:fixSize(renderAttribs.width),height:fixSize(renderAttribs.height),...commonProps,...useMask?monotoneProps:coloredProps,...customStyle},h("span",componentProps)};var item;if(allowSimpleNames(!0),item=fetchAPIModule,storage[""]=item,"undefined"!=typeof document&&"undefined"!=typeof window){const _window=window;if(void 0!==_window.IconifyPreload){const preload=_window.IconifyPreload,err="Invalid IconifyPreload syntax.";"object"==typeof preload&&null!==preload&&(preload instanceof Array?preload:[preload]).forEach(item=>{try{("object"!=typeof item||null===item||item instanceof Array||"object"!=typeof item.icons||"string"!=typeof item.prefix||!addCollection(item))&&console.error(err)}catch(e){console.error(err)}})}if(void 0!==_window.IconifyProviders){const providers=_window.IconifyProviders;if("object"==typeof providers&&null!==providers)for(let key in providers){const err="IconifyProviders["+key+"] is invalid.";try{const value=providers[key];if("object"!=typeof value||!value||void 0===value.resources)continue;addAPIProvider(key,value)||console.error(err)}catch(e){console.error(err)}}}}const emptyIcon={...defaultIconProps,body:""},Icon=defineComponent((props,{emit:emit})=>{const loader2=ref(null);function abortLoading(){loader2.value&&(loader2.value.abort?.(),loader2.value=null)}const rendering=ref(!!props.ssr),lastRenderedIconName=ref(""),iconData=shallowRef(null);function getIcon(){const icon=props.icon;if("object"==typeof icon&&null!==icon&&"string"==typeof icon.body)return lastRenderedIconName.value="",{data:icon};let iconName;if("string"!=typeof icon||null===(iconName=stringToIcon(icon,!1,!0)))return null;let data=function(name){const icon="string"==typeof name?stringToIcon(name,!0,simpleNames):name;if(icon){const storage2=getStorage(icon.provider,icon.prefix),iconName=icon.name;return storage2.icons[iconName]||(storage2.missing.has(iconName)?null:void 0)}}(iconName);if(!data){const oldState=loader2.value;return oldState&&oldState.name===icon||(loader2.value=null===data?{name:icon}:{name:icon,abort:loadIcons([iconName],updateIconData)}),null}abortLoading(),lastRenderedIconName.value!==icon&&(lastRenderedIconName.value=icon,nextTick(()=>{emit("load",icon)}));const customise=props.customise;if(customise){data=Object.assign({},data);const customised=customise(data.body,iconName.name,iconName.prefix,iconName.provider);"string"==typeof customised&&(data.body=customised)}const classes=["iconify"];return""!==iconName.prefix&&classes.push("iconify--"+iconName.prefix),""!==iconName.provider&&classes.push("iconify--"+iconName.provider),{data:data,classes:classes}}function updateIconData(){const icon=getIcon();icon?icon.data!==iconData.value?.data&&(iconData.value=icon):iconData.value=null}return rendering.value?updateIconData():onMounted(()=>{rendering.value=!0,updateIconData()}),watch(()=>props.icon,updateIconData),onUnmounted(abortLoading),()=>{const icon=iconData.value;if(!icon)return render(emptyIcon,props);let newProps=props;return icon.classes&&(newProps={...props,class:icon.classes.join(" ")}),render({...defaultIconProps,...icon.data},newProps)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),_hoisted_1$3={class:/* @__PURE__ */normalizeClass({"rounded-[8px] size-[40px] bg-(--primary-color) border-0 outline-0 flex justify-center items-center transition-colors":!0})},_sfc_main$5=/* @__PURE__ */defineComponent({__name:"Button",props:{titleColor:{default:"#fff"},titleSize:{default:"10px"},icon:{},iconSize:{default:"24px"},title:{}},emits:["click"],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>(openBlock(),createElementBlock("button",{class:"bg-transparent border-0 btn flex flex-col items-center",style:{cursor:"pointer"},onMousemove:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"])),onMousedown:_cache[1]||(_cache[1]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[2]||(_cache[2]=withModifiers(()=>{},["stop"])),onClick:_cache[3]||(_cache[3]=$event=>emit("click"))},[createElementVNode("div",_hoisted_1$3,[__props.icon?(openBlock(),createBlock(unref(Icon),{key:0,width:__props.iconSize,height:__props.iconSize,color:"#fff",icon:__props.icon},null,8,["width","height","icon"])):createCommentVNode("",!0)]),__props.title?(openBlock(),createElementBlock("span",{key:0,style:normalizeStyle({color:__props.titleColor,fontSize:__props.titleSize}),class:"mt-[5px]"},toDisplayString(__props.title),5)):createCommentVNode("",!0)],32))}});class DrawHole extends Command{static name="DrawHole";container=new THREE.Group;static shortcutKeys=["h"];static commandName="draw-hole";defaultWidth=1;defaultHeight=1;defaultGroundClearance=0;holeKey="passageEntrance";lineSelectorType=["wall"];showEditWidth=!0;showEditHeight=!0;showEditGroundClearance=!0;onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys,commandName:this.commandName,loop:!0});commandFlow.add(this.createCursor("no-drop")),isMobile()&&commandFlow.add(this.selectFirstPoint.bind(this)),commandFlow.add(this.selectLine.bind(this),{prompt:`请选择一条线段作为空洞依附墙体, ${this.formatText("TAB")} 修改孔洞默认宽度, ${this.formatText("W")} 快速增加长度, ${this.formatText("S")} 快速减少长度, ${this.formatText("ESC")} 取消命令`}),commandFlow.add(this.end.bind(this))}async editWidth(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultWidth,title:"请输入长度",showCancel:!0});this.defaultWidth=w/1e3}async editHeight(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultHeight,title:"请输入高度",showCancel:!0});this.defaultHeight=w/1e3}async editGroundClearance(){const w=await this.openWidthEditor({defaultWidth:1e3*this.defaultGroundClearance,title:"请输入离地高",showCancel:!0});this.defaultGroundClearance=w/1e3}async selectFirstPoint(next){const onClick=()=>{next(Point.from(this.editor.pointerPosition))};this.editor.domEventRegister.addEventListener("click",onClick,{once:!0}),this.addCommandEndHandle(()=>this.editor.domEventRegister.removeEventListener("click",onClick))}async selectLine(next,point){const holeLine=LineSegment.axisY(this.defaultWidth),wall=new Wall2D(holeLine),lineAlignmentGuide=new LineAlignmentGuide;wall.visible=!1,lineAlignmentGuide.visible=!1,this.container.add(wall),this.container.add(lineAlignmentGuide),wall.position.z=.01;const{pageDestroy:pageDestroy}=(el=this.domElement,editWidth=this.showEditWidth&&(async()=>{await this.editWidth(),holeLine.setLength(this.defaultWidth),wall.setLine(holeLine)}),editHeight=this.showEditHeight&&this.editHeight.bind(this),editGroundClearance=this.showEditGroundClearance&&this.editGroundClearance.bind(this),{directionLock:ref(!1),pageDestroy:createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation(),onPointerup:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[editWidth&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editWidth,icon:"carbon:fit-to-width",title:"长度"},null),editHeight&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editHeight,icon:"carbon:fit-to-height",title:"高度"},null),editGroundClearance&&createVNode(_sfc_main$5,{iconSize:"28px",onClick:editGroundClearance,icon:"material-symbols-light:data-thresholding-outline",title:"离地高"},null)])},{},el)});var el,editWidth,editHeight,editGroundClearance;const lineSelector=new LineSelector(this.editor,point).setType(this.lineSelectorType);lineSelector.onPointerMove=(p,line3)=>{const point2=p??Point.from(this.editor.pointerPosition);this.domElement.style.cursor=line3?"move":"no-drop",wall.position.set(point2.x,point2.y,wall.position.z),LineSegment.axisY(this.defaultWidth,holeLine);let angle2=0;if(line3){if(angle2=LineSegment.angleToYAxis(line3),line3.length<holeLine.length)holeLine.setLength(line3.length),wall.position.set(line3.center.x,line3.center.y,wall.position.z);else{const ratioHalf=holeLine.length/line3.length*.5,v=Math.min(1-ratioHalf,Math.max(ratioHalf,line3.projectPointValue(point2))),p2=line3.pointAt(v);wall.position.set(p2.x,p2.y,wall.position.z)}let direction=line3.direction();const hole=Point.from(wall.position).expandAsLine(direction,holeLine.length).translate(.5*-holeLine.length,direction);lineAlignmentGuide.set(line3,hole.points),lineAlignmentGuide.visible=!0}else lineAlignmentGuide.visible=!1;wall.rotation.z=-angle2,wall.visible=!0,wall.setLine(holeLine),this.dispatchEvent({type:"pointerMove",point:point2.toVector3(0),line:line3}),this.editor.dispatchEvent({type:"drawHoleMove",point:point2.toVector3(0),line:line3})},this.addCommandEndHandle().add(()=>{lineAlignmentGuide.clear(),this.container.remove(wall),this.container.remove(lineAlignmentGuide),lineSelector.destroy(),pageDestroy()}),this.awaitOnlyKeys(["tab"],{once:!1}).awaitEach(async()=>{lineSelector.paused||(lineSelector.pause(),await this.editWidth(),holeLine.setLength(this.defaultWidth),wall.setLine(holeLine),lineSelector.resume())});let lock=!1,timer=null;const execute=step=>{lock||(lock=!0,timer=setInterval(()=>{this.defaultWidth+=step,holeLine.setLength(this.defaultWidth),wall.setLine(holeLine)},50))};this.awaitOnlyKeys(["W"],{once:!1}).awaitEach(async()=>execute(.04)),this.awaitOnlyKeys(["S"],{once:!1}).awaitEach(async()=>execute(-.04)),this.addCommandEndHandle(()=>{timer&&clearInterval(timer)}),this.eventInput.addEventListener("codeChange",e=>{"up"===e.mode&&("w"!==e.code&&"s"!==e.code||(timer&&clearInterval(timer),timer=null,lock=!1))});next({line:await lineSelector.getLines(),holeData:{width:holeLine.length,p:{x:wall.position.x,y:wall.position.y,z:0},full:!1,type:this.holeType,groundClearance:this.defaultGroundClearance,height:this.defaultHeight}})}end(next,data){next(data)}onCompleted(data){WallHole.addHole(data.line,data.holeData,this.holeKey),this.renderManager.draw()}onRollback(data){return WallHole.removeHole(data.line,data.holeData),this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class ClippingLine extends DrawHole{static name="ClippingLine";container=new THREE.Group;static shortcutKeys=["C"];static commandName="clippingLine";showEditHeight=!1;showEditGroundClearance=!1;lineSelectorType=["balconyRailing","door","wall"];end(next,data){const clippingLine=WallHole.holeDataToLine(data.line,data.holeData);next({target:data.line,newLines:LineSegmentUtils.clippingByLines(data.line,[clippingLine],clippingLineUserData)??[]})}onCompleted(data){this.renderManager.removeLine(data.target),this.renderManager.addLines(data.newLines),this.renderManager.draw()}onRollback(data){return this.renderManager.addLine(data.target),this.renderManager.removeLines(data.newLines),data}onRevokeRollback(data){return this.onCompleted(data),data}}const _box$1=new Box3,_vector=new Vector3;class LineSegmentsGeometry extends InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(matrix){const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;return void 0!==start&&(start.applyMatrix4(matrix),end.applyMatrix4(matrix),start.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(array){let lineSegments;array instanceof Float32Array?lineSegments=array:Array.isArray(array)&&(lineSegments=new Float32Array(array));const instanceBuffer=new InstancedInterleavedBuffer(lineSegments,6,1);return this.setAttribute("instanceStart",new InterleavedBufferAttribute(instanceBuffer,3,0)),this.setAttribute("instanceEnd",new InterleavedBufferAttribute(instanceBuffer,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(array){let colors;array instanceof Float32Array?colors=array:Array.isArray(array)&&(colors=new Float32Array(array));const instanceColorBuffer=new InstancedInterleavedBuffer(colors,6,1);return this.setAttribute("instanceColorStart",new InterleavedBufferAttribute(instanceColorBuffer,3,0)),this.setAttribute("instanceColorEnd",new InterleavedBufferAttribute(instanceColorBuffer,3,3)),this}fromWireframeGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromEdgesGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromMesh(mesh){return this.fromWireframeGeometry(new WireframeGeometry(mesh.geometry)),this}fromLineSegments(lineSegments){const geometry=lineSegments.geometry;return this.setPositions(geometry.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;void 0!==start&&void 0!==end&&(this.boundingBox.setFromBufferAttribute(start),_box$1.setFromBufferAttribute(end),this.boundingBox.union(_box$1))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sphere),null===this.boundingBox&&this.computeBoundingBox();const start=this.attributes.instanceStart,end=this.attributes.instanceEnd;if(void 0!==start&&void 0!==end){const center=this.boundingSphere.center;this.boundingBox.getCenter(center);let maxRadiusSq=0;for(let i=0,il=start.count;i<il;i++)_vector.fromBufferAttribute(start,i),maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector)),_vector.fromBufferAttribute(end,i),maxRadiusSq=Math.max(maxRadiusSq,center.distanceToSquared(_vector));this.boundingSphere.radius=Math.sqrt(maxRadiusSq),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},ShaderLib.line={uniforms:UniformsUtils.merge([UniformsLib.common,UniformsLib.fog,UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat alpha = opacity;\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class LineMaterial extends ShaderMaterial{constructor(parameters){super({type:"LineMaterial",uniforms:UniformsUtils.clone(ShaderLib.line.uniforms),vertexShader:ShaderLib.line.vertexShader,fragmentShader:ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(parameters)}get color(){return this.uniforms.diffuse.value}set color(value){this.uniforms.diffuse.value=value}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(value){!0===value?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(value){this.uniforms.linewidth&&(this.uniforms.linewidth.value=value)}get dashed(){return"USE_DASH"in this.defines}set dashed(value){!0===value!==this.dashed&&(this.needsUpdate=!0),!0===value?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(value){this.uniforms.dashScale.value=value}get dashSize(){return this.uniforms.dashSize.value}set dashSize(value){this.uniforms.dashSize.value=value}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(value){this.uniforms.dashOffset.value=value}get gapSize(){return this.uniforms.gapSize.value}set gapSize(value){this.uniforms.gapSize.value=value}get opacity(){return this.uniforms.opacity.value}set opacity(value){this.uniforms&&(this.uniforms.opacity.value=value)}get resolution(){return this.uniforms.resolution.value}set resolution(value){this.uniforms.resolution.value.copy(value)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(value){this.defines&&(!0===value!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===value?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const _viewport=new Vector4,_start=new Vector3,_end=new Vector3,_start4=new Vector4,_end4=new Vector4,_ssOrigin=new Vector4,_ssOrigin3=new Vector3,_mvMatrix=new Matrix4,_line=new Line3,_closestPoint=new Vector3,_box=new Box3,_sphere=new Sphere,_clipToWorldVector=new Vector4;let _ray,_lineWidth;function getWorldSpaceHalfWidth(camera,distance,resolution){return _clipToWorldVector.set(0,0,-distance,1).applyMatrix4(camera.projectionMatrix),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),_clipToWorldVector.x=_lineWidth/resolution.width,_clipToWorldVector.y=_lineWidth/resolution.height,_clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),Math.abs(Math.max(_clipToWorldVector.x,_clipToWorldVector.y))}class LineSegments2 extends Mesh{constructor(geometry=new LineSegmentsGeometry,material=new LineMaterial({color:16777215*Math.random()})){super(geometry,material),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const geometry=this.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd,lineDistances=new Float32Array(2*instanceStart.count);for(let i=0,j=0,l=instanceStart.count;i<l;i++,j+=2)_start.fromBufferAttribute(instanceStart,i),_end.fromBufferAttribute(instanceEnd,i),lineDistances[j]=0===j?0:lineDistances[j-1],lineDistances[j+1]=lineDistances[j]+_start.distanceTo(_end);const instanceDistanceBuffer=new InstancedInterleavedBuffer(lineDistances,2,1);return geometry.setAttribute("instanceDistanceStart",new InterleavedBufferAttribute(instanceDistanceBuffer,1,0)),geometry.setAttribute("instanceDistanceEnd",new InterleavedBufferAttribute(instanceDistanceBuffer,1,1)),this}raycast(raycaster,intersects2){const worldUnits=this.material.worldUnits,camera=raycaster.camera;null!==camera||worldUnits||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const threshold=void 0!==raycaster.params.Line2&&raycaster.params.Line2.threshold||0;_ray=raycaster.ray;const matrixWorld=this.matrixWorld,geometry=this.geometry,material=this.material;let sphereMargin,boxMargin;if(_lineWidth=material.linewidth+threshold,null===geometry.boundingSphere&&geometry.computeBoundingSphere(),_sphere.copy(geometry.boundingSphere).applyMatrix4(matrixWorld),worldUnits)sphereMargin=.5*_lineWidth;else{sphereMargin=getWorldSpaceHalfWidth(camera,Math.max(camera.near,_sphere.distanceToPoint(_ray.origin)),material.resolution)}if(_sphere.radius+=sphereMargin,!1!==_ray.intersectsSphere(_sphere)){if(null===geometry.boundingBox&&geometry.computeBoundingBox(),_box.copy(geometry.boundingBox).applyMatrix4(matrixWorld),worldUnits)boxMargin=.5*_lineWidth;else{boxMargin=getWorldSpaceHalfWidth(camera,Math.max(camera.near,_box.distanceToPoint(_ray.origin)),material.resolution)}_box.expandByScalar(boxMargin),!1!==_ray.intersectsBox(_box)&&(worldUnits?function(lineSegments,intersects2){const matrixWorld=lineSegments.matrixWorld,geometry=lineSegments.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd;for(let i=0,l=Math.min(geometry.instanceCount,instanceStart.count);i<l;i++){_line.start.fromBufferAttribute(instanceStart,i),_line.end.fromBufferAttribute(instanceEnd,i),_line.applyMatrix4(matrixWorld);const pointOnLine=new Vector3,point=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,point,pointOnLine),point.distanceTo(pointOnLine)<.5*_lineWidth&&intersects2.push({point:point,pointOnLine:pointOnLine,distance:_ray.origin.distanceTo(point),object:lineSegments,face:null,faceIndex:i,uv:null,uv1:null})}}(this,intersects2):function(lineSegments,camera,intersects2){const projectionMatrix=camera.projectionMatrix,resolution=lineSegments.material.resolution,matrixWorld=lineSegments.matrixWorld,geometry=lineSegments.geometry,instanceStart=geometry.attributes.instanceStart,instanceEnd=geometry.attributes.instanceEnd,segmentCount=Math.min(geometry.instanceCount,instanceStart.count),near=-camera.near;_ray.at(1,_ssOrigin),_ssOrigin.w=1,_ssOrigin.applyMatrix4(camera.matrixWorldInverse),_ssOrigin.applyMatrix4(projectionMatrix),_ssOrigin.multiplyScalar(1/_ssOrigin.w),_ssOrigin.x*=resolution.x/2,_ssOrigin.y*=resolution.y/2,_ssOrigin.z=0,_ssOrigin3.copy(_ssOrigin),_mvMatrix.multiplyMatrices(camera.matrixWorldInverse,matrixWorld);for(let i=0,l=segmentCount;i<l;i++){if(_start4.fromBufferAttribute(instanceStart,i),_end4.fromBufferAttribute(instanceEnd,i),_start4.w=1,_end4.w=1,_start4.applyMatrix4(_mvMatrix),_end4.applyMatrix4(_mvMatrix),_start4.z>near&&_end4.z>near)continue;if(_start4.z>near){const deltaDist=_start4.z-_end4.z,t=(_start4.z-near)/deltaDist;_start4.lerp(_end4,t)}else if(_end4.z>near){const deltaDist=_end4.z-_start4.z,t=(_end4.z-near)/deltaDist;_end4.lerp(_start4,t)}_start4.applyMatrix4(projectionMatrix),_end4.applyMatrix4(projectionMatrix),_start4.multiplyScalar(1/_start4.w),_end4.multiplyScalar(1/_end4.w),_start4.x*=resolution.x/2,_start4.y*=resolution.y/2,_end4.x*=resolution.x/2,_end4.y*=resolution.y/2,_line.start.copy(_start4),_line.start.z=0,_line.end.copy(_end4),_line.end.z=0;const param=_line.closestPointToPointParameter(_ssOrigin3,!0);_line.at(param,_closestPoint);const zPos=MathUtils.lerp(_start4.z,_end4.z,param),isInClipSpace=zPos>=-1&&zPos<=1,isInside=_ssOrigin3.distanceTo(_closestPoint)<.5*_lineWidth;if(isInClipSpace&&isInside){_line.start.fromBufferAttribute(instanceStart,i),_line.end.fromBufferAttribute(instanceEnd,i),_line.start.applyMatrix4(matrixWorld),_line.end.applyMatrix4(matrixWorld);const pointOnLine=new Vector3,point=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,point,pointOnLine),intersects2.push({point:point,pointOnLine:pointOnLine,distance:_ray.origin.distanceTo(point),object:lineSegments,face:null,faceIndex:i,uv:null,uv1:null})}}}(this,camera,intersects2))}}onBeforeRender(renderer){const uniforms=this.material.uniforms;uniforms&&uniforms.resolution&&(renderer.getViewport(_viewport),this.material.uniforms.resolution.value.set(_viewport.z,_viewport.w))}}class LineGeometry extends LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(array){const length=array.length-3,points=new Float32Array(2*length);for(let i=0;i<length;i+=3)points[2*i]=array[i],points[2*i+1]=array[i+1],points[2*i+2]=array[i+2],points[2*i+3]=array[i+3],points[2*i+4]=array[i+4],points[2*i+5]=array[i+5];return super.setPositions(points),this}setColors(array){const length=array.length-3,colors=new Float32Array(2*length);for(let i=0;i<length;i+=3)colors[2*i]=array[i],colors[2*i+1]=array[i+1],colors[2*i+2]=array[i+2],colors[2*i+3]=array[i+3],colors[2*i+4]=array[i+4],colors[2*i+5]=array[i+5];return super.setColors(colors),this}setFromPoints(points){const length=points.length-1,positions=new Float32Array(6*length);for(let i=0;i<length;i++)positions[6*i]=points[i].x,positions[6*i+1]=points[i].y,positions[6*i+2]=points[i].z||0,positions[6*i+3]=points[i+1].x,positions[6*i+4]=points[i+1].y,positions[6*i+5]=points[i+1].z||0;return super.setPositions(positions),this}fromLine(line2){const geometry=line2.geometry;return this.setPositions(geometry.attributes.position.array),this}}class Line2 extends LineSegments2{constructor(geometry=new LineGeometry,material=new LineMaterial({color:16777215*Math.random()})){super(geometry,material),this.isLine2=!0,this.type="Line2"}}class Lines2 extends Line2{points=[];continuous=!0;constructor(points=[],color=16777215,opt){super(),this.addPoint(...points),this.frustumCulled=!1,this.material=new LineMaterial({...opt,color:color})}addPoint(...points){this.points.push(...points),this.updateGeometry()}setPoint(...points){this.points.length=0,this.addPoint(...points)}setColor(color){this.material.color instanceof THREE.Color?this.material.color.setHex(color):this.material.color=new THREE.Color(color)}setOpacity(opacity){this.material.transparent=!0,this.material.opacity=opacity}setDashSize(dashSize){this.material.dashSize=dashSize,this.computeLineDistances()}setLinewidth(linewidth){this.material.linewidth=linewidth}setGapSize(gapSize){this.material.gapSize=gapSize,this.computeLineDistances()}getCenter(startIndex,endIndex){if(endIndex=endIndex??startIndex,startIndex<=this.points.length-1&&endIndex<=this.points.length-1){const start=this.points[startIndex],end=this.points[endIndex];return start.clone().add(end).multiplyScalar(.5)}throw new Error("索引不在可取范围")}getDistance(startIndex,endIndex){if(endIndex=endIndex??startIndex,startIndex<=this.points.length-1&&endIndex<=this.points.length-1){const start=this.points[startIndex],end=this.points[endIndex];return start.distanceTo(end)}throw new Error("索引不在可取范围")}_timer=null;updateGeometry(){this._timer&&clearTimeout(this._timer),this.clear(),this._timer=setTimeout(()=>{if(this.continuous)this.points.forEach((p,i)=>{if(0===i)return;const p0=this.points[i-1],geometry=new LineGeometry;geometry.setPositions([p0.x,p0.y,p0.z,p.x,p.y,p.z]);const line2=new Line2(geometry,this.material);line2.computeLineDistances(),this.add(line2)});else for(let i=0;i<this.points.length;i+=2){const p0=this.points[i],p=this.points[i+1],geometry=new LineGeometry;geometry.setPositions([p0.x,p0.y,p0.z,p.x,p.y,p.z]);const line2=new Line2(geometry,this.material);line2.computeLineDistances(),this.add(line2)}this._timer=null,this.dispatchEvent({type:"updateGeometry"})})}}function modifyWindow(context,winLine,line2){let data=winLine.currentData.insertObject,oldWinLine=winLine;winLine=winLine.clone(),WallHole.removeHole(line2,data),context.renderManager.draw();const{promise:promise,resolve:resolve}=createPromise(),lineMesh=new(isMobileRef.value?Lines:Lines2)([winLine.start.toVector3(),winLine.end.toVector3()],16711935,{linewidth:4}),dragPoint=new THREE.Vector3(0,0,0);lineMesh.position.z=.005,context.container.add(lineMesh);const text1=context.renderer.createText("",line2.start,{color:"#00ff00"},context.container);text1.visible=!1;const text2=context.renderer.createText("",line2.end,{color:"#00ff00"},context.container);text2.visible=!1;const{destroy:destroy,dragPointMesh:dragPointMesh,setPoint:setDragPoint}=context.createDragPoint(winLine.center,{size:20,onChange:p=>{context.pointLineConstraint(p,line2);const center=winLine.center,distance=center.distance(p);winLine.translate(distance,p.directionFrom(center)),LineSegmentUtils.constrainLine(winLine,line2),dragPoint.copy(p.toJson()),lineMesh.setPoint(winLine.start.toVector3(),winLine.end.toVector3()),editBtn.setPosition(winLine.center);const[l1,l2]=LineSegmentUtils.clippingByLine(line2,winLine)??[];l1?(text1.visible=!0,text1.position.copy(l1.center.toJson(0)),text1.element.innerText=`${mToMm(l1.length)}mm`):text1.visible=!1,l2?(text2.visible=!0,text2.position.copy(l2.center.toJson(0)),text2.element.innerText=`${mToMm(l2.length)}mm`):text2.visible=!1},onStart(){editBtn.visible=!1},onEnd(){setDragPoint(winLine.center),editBtn.setPosition(winLine.center),editBtn.visible=!0,text1.visible=!1,text2.visible=!1}}),editBtn=context.createEditButton({position:winLine.center,style:{marginLeft:"40px"},onClick:async()=>{editBtn.visible=!1,dragPointMesh.visible=!1,await function(context,winLine,line2,lineMesh){function end(){if(!ended){if(width.value<200)return ElMessage({message:"窗户长度不能小于200mm",type:"warning"});ended=!0,close2(),marginText1.removeFromParent(),marginText2.removeFromParent(),widthText.removeFromParent(),resolve(!0)}}function update(){LineSegmentUtils.constrainLine(winLine,line2),width.value=mToMm(winLine.length);let w=mmTom(width.value);center.copy(winLine.center),startWidth.value=mToMm(line2.start.distance(center)-.5*w),endWidth.value=mToMm(line2.end.distance(center)-.5*w),widthText.setPosition(winLine.center),lineMesh.setPoint(winLine.start.toVector3(),winLine.end.toVector3())}let ended=!1;const list=[{title:"长度",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:width.value,"onUpdate:modelValue":$event=>width.value=$event,showCancel:!1,showConfirm:!1},null)])},{title:"边距1",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:startWidth.value,"onUpdate:modelValue":$event=>startWidth.value=$event,showCancel:!1,showConfirm:!1},null)])},{title:"边距2",content:()=>createVNode(Fragment,null,[createVNode(NumberEditor,{modelValue:endWidth.value,"onUpdate:modelValue":$event=>endWidth.value=$event,showCancel:!1,showConfirm:!1},null)])}],len=winLine.length,value=ref(0),center=winLine.center,width=ref(mToMm(winLine.length)),winLineDir=winLine.direction(),startWidth=ref(mToMm(line2.start.distance(center)-.5*len)),endWidth=ref(mToMm(line2.end.distance(center)-.5*len)),{promise:promise,resolve:resolve}=createPromise(),marginText1=context.createButton({text:"边距1",position:line2.start,onClick:()=>value.value=1}),marginText2=context.createButton({text:"边距2",position:line2.end,onClick:()=>value.value=2}),widthText=context.createButton({text:"长度",position:winLine.center,onClick:()=>value.value=0});watch(width,()=>{const center2=winLine.center;let w=mmTom(width.value);winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()}),watch(startWidth,value2=>{const center2=winLine.center,dir=line2.end.directionFrom(line2.start);let w=mmTom(width.value);center2.copy(line2.start).add(dir.multiplyScalar(.5*w+mmTom(value2))),winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()}),watch(endWidth,value2=>{const center2=winLine.center,dir=line2.start.directionFrom(line2.end);let w=mmTom(width.value);center2.copy(line2.end).add(dir.multiplyScalar(.5*w+mmTom(value2))),winLine.start.copy(center2).add(winLineDir.clone().multiplyScalar(.5*w)),winLine.end.copy(center2).add(winLineDir.clone().multiplyScalar(.5*-w)),update()});const close2=context.createVueApp(()=>createVNode("div",{class:"absolute left-0 top-0 w-full h-full overlay z-100",onMousedown:e=>e.stopPropagation()},[createVNode("div",{class:{"absolute bg-white shadow flex flex-col box-border":!0,"bottom-0 left-0 w-full":isMobileRef.value,"top-0 right-0 h-full min-w-[200px] cursor-pointer":!isMobileRef.value}},[createVNode("ul",{class:"flex items-center gap-[20px] p-[10px]"},[list.map((item,i)=>createVNode("li",{class:{" border-b-transparent border-b-2 text-[14px]":!0,"border-b-(--primary-color)!":value.value===i},onMousedown:()=>value.value=i,onTouchstart:()=>value.value=i},[item.title])),createVNode("li",{class:"flex-1"},null),isMobileRef.value&&createVNode("li",null,[createVNode("button",{onClick:end,class:"button-click"},[createTextVNode("确认")])])]),createVNode("div",{class:"p-[0px_10px]"},[h(list[value.value].content)]),isMobileRef.value||createVNode("div",{class:"p-[10px] flex justify-end mt-[10px]"},[createVNode("button",{onClick:end,class:"button-click"},[createTextVNode("确认")])])])]),{});return context.addCommandEndHandle(end),promise}(context,winLine,line2,lineMesh),editBtn.visible=!0,dragPointMesh.visible=!0,setDragPoint(winLine.center),editBtn.setPosition(winLine.center)}});return context.addCommandEndHandle(()=>{destroy(),editBtn.removeFromParent(),context.container.clear(),data&&(WallHole.addHole(line2,data),context.renderManager.draw())}),context.showConfirm.value=!0,context.awaitOnlyKeys(["enter"]).then(()=>{WallHole.addHole(line2,data),context.renderManager.draw();const opt={type:"window",line:line2,holeData:data,old:{p:oldWinLine.center.toJson(data.p.z),width:oldWinLine.length},new:{p:winLine.center.toJson(data.p.z),width:winLine.length}};data=null,resolve(opt)}),promise}const _sfc_main$4=/* @__PURE__ */defineComponent({__name:"ToolToggle",props:/* @__PURE__ */mergeModels({titleColor:{default:"#fff"},titleSize:{default:"10px"},icon:{},iconSize:{default:"24px"},title:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(__props){const directionLock=useModel(__props,"modelValue");function toggleDirectionLock(){directionLock.value=!directionLock.value}return(_ctx,_cache)=>(openBlock(),createElementBlock("div",{class:"flex flex-col items-center",style:{cursor:"pointer"},onMousemove:_cache[0]||(_cache[0]=withModifiers(()=>{},["stop"])),onMousedown:_cache[1]||(_cache[1]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[2]||(_cache[2]=withModifiers(()=>{},["stop"])),onClick:withModifiers(toggleDirectionLock,["stop"])},[createElementVNode("div",{class:normalizeClass(["rounded-[100px] size-[40px] flex justify-center items-center transition-colors",directionLock.value?"bg-(--primary-color)":"bg-[#717171]"])},[__props.icon?(openBlock(),createBlock(unref(Icon),{key:0,width:__props.iconSize,height:__props.iconSize,color:"#fff",icon:__props.icon},null,8,["width","height","icon"])):createCommentVNode("",!0)],2),__props.title?(openBlock(),createElementBlock("span",{key:0,style:normalizeStyle({color:__props.titleColor,fontSize:__props.titleSize}),class:"mt-[5px]"},toDisplayString(__props.title),5)):createCommentVNode("",!0)],32))}});async function modifyLine(context,line2){function updateLinesMesh(){const points=[line2.start.toVector3(),line2.end.toVector3()];linesMesh.setPoint(...points);const points2=[];list.forEach(items=>{items.list.forEach(item=>{points2.push(item.line.start.toVector3(),item.line.end.toVector3())})}),linesMesh2.setPoint(...points2)}function setPoint(point,newPoint){const newValue=newPoint.toJson(),records=[{target:point,oldValue:point.toJson(),value:newValue}];point.copy(newPoint),width.value=mToMm(line2.length),follow.value&&list.forEach(item=>{item.point===point&&item.list.forEach(item2=>{records.push({target:item2.point,oldValue:item2.point.toJson(),value:newValue}),item2.point.copy(newPoint)})}),writeIndex>-1&&(recordsList[writeIndex]=records),recordCount.value=recordsList.length,updateLinesMesh()}function end(){ended.value||(ended.value=!0,destroy(),group.clear(),group.removeFromParent(),context.renderManager.addLine(oldLine),list.forEach(items=>items.list.forEach((item,i)=>{item.line.start.copy(items.olds[i].start),item.line.end.copy(items.olds[i].end),context.renderManager.addLine(item.line)})),context.renderManager.draw())}const{directionLock:directionLock,follow:follow,recordCount:recordCount,destroy:destroy}=function(context,opt){const directionLock=ref(!1),follow=ref(!0),recordCount=ref(0),destroy=context.createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode(_sfc_main$4,{icon:"tdesign:rotate-locked-filled",modelValue:directionLock.value,"onUpdate:modelValue":$event=>directionLock.value=$event,title:"方向锁定"},null),createVNode(_sfc_main$4,{icon:"gis:snap",modelValue:follow.value,"onUpdate:modelValue":$event=>follow.value=$event,title:"跟随移动"},null),createVNode(_sfc_main$5,{title:"重置位置",onClick:opt.onResetClick,icon:"system-uicons:reset"},null)])});return{directionLock:directionLock,follow:follow,destroy:destroy,recordCount:recordCount}}(context,{onResetClick(){0!==recordsList.length&&(writeIndex=recordsList.length,setPoint(line2.start,oldLine.start.clone()),setPoint(line2.end,oldLine.end.clone()),list[0].setDragPos(line2.start),list[1].setDragPos(line2.end))}}),{promise:promise,resolve:resolve}=createPromise(),oldLine=line2,group=new Group,linesMesh=new Lines([],65280),linesMesh2=new LineDashed([],5745151),width=ref(mToMm(line2.length)),dragging=ref(!1),ended=ref(!1),ControlZ=context.awaitOnlyKeys(["Control","Z"],{once:!1}),recordsList=[];context.renderManager.removeLine(line2),group.add(linesMesh),group.add(linesMesh2),context.container.add(group),linesMesh2.setOpacity(.5),linesMesh2.continuous=!1,line2=line2.clone();let writeIndex=0,baseLine=line2.clone();ControlZ.awaitEach(function(){const data=recordsList.pop();data&&(data.forEach(item=>{item.target.copy(item.oldValue)}),updateLinesMesh(),recordCount.value=recordsList.length)});const list=line2.points.map((point,index)=>{const list2=context.renderManager.pointVirtualGrid.queryPoint(point).map(item=>({line:item.userData,point:item.point})),olds=list2.map(item=>({line:item.line,start:item.line.start.toJson(),end:item.line.end.toJson()}));list2.forEach(item=>context.renderManager.removeLine(item.line));const{setPoint:setDragPos,destroy:destroy2,dragPointMesh:dragPointMesh}=context.createDragPoint(point,{size:20,auxiliaryLine:!0,onStart(){baseLine=line2.clone(),dragging.value=!0,writeIndex=recordsList.length,textMesh.visible=!0,textMesh.setText(width.value+"mm"),textMesh.setPosition(line2.center)},onEnd(){setDragPos(point),dragging.value=!1,textMesh.visible=!1},onChange(p){directionLock.value&&baseLine&&context.pointLineConstraint(p,baseLine,0===index?baseLine.points[1]:baseLine.points[0]),setPoint(point,p),textMesh.setText(width.value+"mm"),textMesh.setPosition(line2.center)}}),textMesh=context.createButton({text:""}),btn=context.createEditButton({text:width.value+"mm",parent:dragPointMesh,style:{marginLeft:"20px",transform:"translateY(-50%)"},position:Point.zero(),freedom:!0,async onClick(){const{promise:promise2,close:close2}=context.openWidthEditor({defaultWidth:width.value,showCancel:!0,minWidth:200});context.addCommandEndHandle(close2);const w=mmTom(await promise2),otherPoint=line2.getAnotherPoint(point),dir=point.directionFrom(otherPoint);setPoint(point,otherPoint.clone().add(dir.multiplyScalar(w))),setDragPos(point)}});return textMesh.visible=!1,watch(width,()=>btn.setText(width.value+"mm")),watch(dragging,()=>btn.visible=!dragging.value),watch(ended,()=>destroy2()),{point:point,olds:olds,list:list2,setDragPos:setDragPos}});return watch(follow,b=>{list.forEach(items=>{items.list.forEach((item,i)=>{b?items.list.forEach(item2=>item2.point.copy(items.point)):(item.line.start.copy(items.olds[i].start),item.line.end.copy(items.olds[i].end))}),updateLinesMesh()})}),updateLinesMesh(),context.addCommandEndHandle(end),context.showConfirm.value=!0,context.awaitOnlyKeys(["enter"]).then(()=>{const data=list.flatMap(items=>items.list.map((item,i)=>({line:item.line,old:{start:items.olds[i].start,end:items.olds[i].end},new:{start:item.line.start.toJson(),end:item.line.end.toJson()}})));data.push({line:oldLine,old:{start:oldLine.start.toJson(),end:oldLine.end.toJson()},new:{start:line2.start.toJson(),end:line2.end.toJson()}}),end(),resolve({type:"line",list:data})}),promise}class PointDrag extends Command{static name="PointDrag";static shortcutKeys=["F"];static commandName="point";container=new THREE.Group;showConfirm=ref(!1);onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys,loop:!0});commandFlow.add(this.createCursor("no-drop")).add(this.selectLine.bind(this),{prompt:`请选择需要修改的线段, ${this.formatText("ESC")} 取消命令`,showConfirm:this.showConfirm}),commandFlow.add(this.verify.bind(this))}async selectLine(next){this.showConfirm.value=!1,this.commandFlow.writeOperationRecord=!0;const wallLine=new LineSegment,wallObj=new Wall2D(wallLine,.02).setColor(new THREE.Color(65280));this.container.add(wallObj);const lineSelector=new LineSelector(this.editor).setType("all");lineSelector.onPointerMove=(_,line22)=>{line22?(wallLine.copy(line22),wallObj.visible=!0,this.domElement.style.cursor="pointer"):(wallObj.visible=!1,this.domElement.style.cursor="no-drop")},this.addCommandEndHandle(lineSelector.destroy.bind(lineSelector),()=>wallObj.removeFromParent());const line2=await lineSelector.getLines();lineSelector.destroy(),wallObj.removeFromParent(),line2&&(line2.currentData.insertObject?next(await modifyWindow(this,line2,line2.currentData.line)):(line2.userData.isDoor,next(await modifyLine(this,line2))))}async verify(next,data){"window"===data.type?JSON.stringify(data.new)===JSON.stringify(data.old)&&(this.commandFlow.writeOperationRecord=!1):"door"!==data.type&&"line"!==data.type||JSON.stringify(data.list[0].new)===JSON.stringify(data.list[0].old)&&(this.commandFlow.writeOperationRecord=!1),next(data),queueMicrotask(()=>this.commandFlow.writeOperationRecord=!0)}onCompleted(data){if("window"===data.type){const item=data.holeData;item.p=data.new.p,item.width=data.new.width}else"door"!==data.type&&"line"!==data.type||data.list.forEach(({line:line2,new:newData})=>{line2.start.copy(newData.start),line2.end.copy(newData.end),WallHole.filterIllegal([line2]),this.renderManager.removeLine(line2),this.renderManager.addLine(line2)});this.renderManager.draw()}onRollback(data){if("window"===data.type){const item=data.holeData;item.p=data.old.p,item.width=data.old.width}else"door"!==data.type&&"line"!==data.type||data.list.forEach(({line:line2,old:newData})=>{line2.start.copy(newData.start),line2.end.copy(newData.end),WallHole.filterIllegal([line2]),this.renderManager.removeLine(line2),this.renderManager.addLine(line2)});return this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class VerticalCorrContinue extends Command{static name="VerticalCorrContinue";container=new THREE.Group;static shortcutKeys=["Control","Shift","V"];static commandName="VerticalCorrContinue";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;this.initCommandFlow({getStartData:()=>[...this.default.selectLines]}).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this))}constraint(next,selectLines){Array.isArray(selectLines)?1!==selectLines.length?(ElMessage({message:"请选择一条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}verticalCorrection(next,selectLines){const targettLine=selectLines[0],oldLines=[...this.renderManager.lines];next({newLines:LinePipeline.builtin.AxisAlignCorr(LineSegmentUtils.clone(oldLines),this.editor.dxf.options,targettLine),oldLines:oldLines})}onCompleted(data){this.renderManager.removeLineAll(!1),this.renderManager.addLines(data.newLines),this.renderManager.draw()}onRollback(data){return this.renderManager.removeLineAll(!1),this.renderManager.addLines(data.oldLines),this.renderManager.draw(),data}onRevokeRollback(data){return this.onCompleted(data),data}}class RayDistance extends Command{static name="RayDistance";container=new THREE.Group;static shortcutKeys=["R"];static commandName="RayDistance";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);this.initCommandFlow({shortcutKeys:this.shortcutKeys,writeOperationRecord:!1,loop:!0}).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this),{prompt:`请选择线段上的一个点作为发射点, ${this.formatText("ESC")} 取消命令`}).add(this.ray.bind(this),{prompt:`按 ${this.formatText("Enter")} 重新选择发射点, ${this.formatText("ESC")} 取消命令`})}async selectPoint(next){const pointSelector=this.createPointSelector();this.addEventRecord("clear",()=>this.container.clear());const result=await pointSelector.next("line_point");result&&next(result)}async ray(next,{line:line2,point:point}){const normal=line2.normal(),nNormal=normal.clone().multiplyScalar(-1),rayLine1=new LineSegment(point,point.clone().add(normal.multiplyScalar(100))),rayLine2=new LineSegment(point,point.clone().add(nNormal.multiplyScalar(100))),lineObj=this.renderer.createLineSegments([rayLine1,rayLine2],0,{color:196352},this.container);[rayLine1,rayLine2].forEach(rayLine=>{const points=this.renderManager.quadtree.queryLineSegment(rayLine).filter(item=>item.line!==rayLine).map(item=>rayLine.getIntersection(item.line)).filter(p=>!!p);points.sort((a,b)=>point.distance(a)-point.distance(b)).forEach((p,i)=>{const distance=1e3*point.distance(p);if(distance<.001)return;const points2=function(start,end,offset=.5){const offsetDistance=end.leftNormal(start).multiplyScalar(offset),startOffPoint=start.clone().add(offsetDistance);return[start,startOffPoint,end.clone().add(offsetDistance),end]}(point,p,.3*i),auxiliaryLine=new Lines;auxiliaryLine.position.z=.006,auxiliaryLine.material=new THREE.LineDashedMaterial({color:16777215,dashSize:.02,gapSize:.02}),auxiliaryLine.setPoint(...points2.map(p2=>new THREE.Vector3(p2.x,p2.y,0))),this.container.add(auxiliaryLine),setTimeout(()=>auxiliaryLine.computeLineDistances());const text=this.renderer.createText(Number(distance.toFixed(0))+"mm",points2[1].clone().add(points2[2]).multiplyScalar(.5),{background:"#333333",padding:"0px",borderRadius:"0px",color:"#fff"},this.container),circle=this.renderer.createCircle(p,{},this.container);this.addEventRecord("clear",()=>{auxiliaryLine.removeFromParent(),text.removeFromParent(),circle.removeFromParent()})})}),this.addEventRecord("clear",()=>{lineObj.removeFromParent()}),await this.awaitOnlyKeys(["enter"]),next()}}class ManualDistance extends Command{static name="ManualDistance";container=new THREE.Group;static shortcutKeys=["M"];static commandName="ManualDistance";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);this.initCommandFlow({shortcutKeys:this.shortcutKeys,writeOperationRecord:!1,loop:!0}).add(this.createCursor("crosshair")).add(this.selectPointStart.bind(this),{prompt:`请选择两个点, ${this.formatText("ESC")} 取消命令`}).add(this.ray.bind(this),{prompt:`按 ${this.formatText("Enter")} 重新选择, ${this.formatText("ESC")} 取消命令`})}async selectPointStart(next){const pointSelector=this.createPointSelector();this.addCommandEndHandle(()=>this.container.clear());let points=[];await pointSelector.awaitEach(result=>{if(!result)return;const{point:point}=result;this.renderer.createCircle(point,{},this.container),points.push(point),2===points.length&&pointSelector.end()},"all"),2===points.length&&next({point1:points[0],point2:points[1]})}async ray(next,{point1:point1,point2:point2}){const lineAlignmentGuide=new LineAlignmentGuide;this.container.add(lineAlignmentGuide),lineAlignmentGuide.set(new LineSegment(point1,point2)),this.renderer.createLineSegments([new LineSegment(point1,point2)],0,{color:65280},this.container),this.addCommandEndHandle(()=>{lineAlignmentGuide.removeFromParent()}),await this.awaitOnlyKeys(["enter"]),next()}}function earcut(data,holeIndices,dim=2){const outerLen=data.length;let outerNode=function(data,start,end,dim,clockwise){let last2;if(clockwise===function(data,start,end,dim){let sum=0;for(let i=start,j=end-dim;i<end;i+=dim)sum+=(data[j]-data[i])*(data[i+1]+data[j+1]),j=i;return sum}(data,start,end,dim)>0)for(let i=start;i<end;i+=dim)last2=insertNode(i/dim|0,data[i],data[i+1],last2);else for(let i=end-dim;i>=start;i-=dim)last2=insertNode(i/dim|0,data[i],data[i+1],last2);last2&&equals(last2,last2.next)&&(removeNode(last2),last2=last2.next);return last2}(data,0,outerLen,dim,!0);const triangles=[];if(!outerNode||outerNode.next===outerNode.prev)return triangles;let minX,minY,invSize;if(data.length>80*dim){minX=data[0],minY=data[1];let maxX=minX,maxY=minY;for(let i=dim;i<outerLen;i+=dim){const x=data[i],y=data[i+1];x<minX&&(minX=x),y<minY&&(minY=y),x>maxX&&(maxX=x),y>maxY&&(maxY=y)}invSize=Math.max(maxX-minX,maxY-minY),invSize=0!==invSize?32767/invSize:0}return earcutLinked(outerNode,triangles,dim,minX,minY,invSize,0),triangles}function filterPoints(start,end){if(!start)return start;end||(end=start);let again,p=start;do{if(again=!1,p.steiner||!equals(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(removeNode(p),p=end=p.prev,p===p.next)break;again=!0}}while(again||p!==end);return end}function earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(!ear)return;!pass&&invSize&&function(start,minX,minY,invSize){let p=start;do{0===p.z&&(p.z=zOrder(p.x,p.y,minX,minY,invSize)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==start);p.prevZ.nextZ=null,p.prevZ=null,function(list){let numMerges,inSize=1;do{let e,p=list;list=null;let tail=null;for(numMerges=0;p;){numMerges++;let q=p,pSize=0;for(let i=0;i<inSize&&(pSize++,q=q.nextZ,q);i++);let qSize=inSize;for(;pSize>0||qSize>0&&q;)0!==pSize&&(0===qSize||!q||p.z<=q.z)?(e=p,p=p.nextZ,pSize--):(e=q,q=q.nextZ,qSize--),tail?tail.nextZ=e:list=e,e.prevZ=tail,tail=e;p=q}tail.nextZ=null,inSize*=2}while(numMerges>1)}(p)}(ear,minX,minY,invSize);let stop=ear;for(;ear.prev!==ear.next;){const prev=ear.prev,next=ear.next;if(invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear))triangles.push(prev.i,ear.i,next.i),removeNode(ear),ear=next.next,stop=next.next;else if((ear=next)===stop){pass?1===pass?earcutLinked(ear=cureLocalIntersections(filterPoints(ear),triangles),triangles,dim,minX,minY,invSize,2):2===pass&&splitEarcut(ear,triangles,dim,minX,minY,invSize):earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);break}}}function isEar(ear){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=Math.min(ax,bx,cx),y0=Math.min(ay,by,cy),x1=Math.max(ax,bx,cx),y1=Math.max(ay,by,cy);let p=c.next;for(;p!==a;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function isEarHashed(ear,minX,minY,invSize){const a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;const ax=a.x,bx=b.x,cx=c.x,ay=a.y,by=b.y,cy=c.y,x0=Math.min(ax,bx,cx),y0=Math.min(ay,by,cy),x1=Math.max(ax,bx,cx),y1=Math.max(ay,by,cy),minZ=zOrder(x0,y0,minX,minY,invSize),maxZ=zOrder(x1,y1,minX,minY,invSize);let p=ear.prevZ,n=ear.nextZ;for(;p&&p.z>=minZ&&n&&n.z<=maxZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}for(;p&&p.z>=minZ;){if(p.x>=x0&&p.x<=x1&&p.y>=y0&&p.y<=y1&&p!==a&&p!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;n&&n.z<=maxZ;){if(n.x>=x0&&n.x<=x1&&n.y>=y0&&n.y<=y1&&n!==a&&n!==c&&pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}return!0}function cureLocalIntersections(start,triangles){let p=start;do{const a=p.prev,b=p.next.next;!equals(a,b)&&intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)&&(triangles.push(a.i,p.i,b.i),removeNode(p),removeNode(p.next),p=start=b),p=p.next}while(p!==start);return filterPoints(p)}function splitEarcut(start,triangles,dim,minX,minY,invSize){let a=start;do{let b=a.next.next;for(;b!==a.prev;){if(a.i!==b.i&&isValidDiagonal(a,b)){let c=splitPolygon(a,b);return a=filterPoints(a,a.next),c=filterPoints(c,c.next),earcutLinked(a,triangles,dim,minX,minY,invSize,0),void earcutLinked(c,triangles,dim,minX,minY,invSize,0)}b=b.next}a=a.next}while(a!==start)}function zOrder(x,y,minX,minY,invSize){return(x=1431655765&((x=858993459&((x=252645135&((x=16711935&((x=(x-minX)*invSize|0)|x<<8))|x<<4))|x<<2))|x<<1))|(y=1431655765&((y=858993459&((y=252645135&((y=16711935&((y=(y-minY)*invSize|0)|y<<8))|y<<4))|y<<2))|y<<1))<<1}function pointInTriangleExceptFirst(ax,ay,bx,by,cx,cy,px,py){return!(ax===px&&ay===py)&&function(ax,ay,bx,by,cx,cy,px,py){return(cx-px)*(ay-py)>=(ax-px)*(cy-py)&&(ax-px)*(by-py)>=(bx-px)*(ay-py)&&(bx-px)*(cy-py)>=(cx-px)*(by-py)}(ax,ay,bx,by,cx,cy,px,py)}function isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(a,b){let p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&(locallyInside(a,b)&&locallyInside(b,a)&&function(a,b){let p=a,inside=!1;const px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{p.y>py!=p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x&&(inside=!inside),p=p.next}while(p!==a);return inside}(a,b)&&(area(a.prev,a,b.prev)||area(a,b.prev,b))||equals(a,b)&&area(a.prev,a,a.next)>0&&area(b.prev,b,b.next)>0)}function area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y)}function equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y}function intersects(p1,q1,p2,q2){const o1=sign(area(p1,q1,p2)),o2=sign(area(p1,q1,q2)),o3=sign(area(p2,q2,p1)),o4=sign(area(p2,q2,q1));return o1!==o2&&o3!==o4||(!(0!==o1||!onSegment(p1,p2,q1))||(!(0!==o2||!onSegment(p1,q2,q1))||(!(0!==o3||!onSegment(p2,p1,q2))||!(0!==o4||!onSegment(p2,q1,q2)))))}function onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y)}function sign(num){return num>0?1:num<0?-1:0}function locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function splitPolygon(a,b){const a2=createNode(a.i,a.x,a.y),b2=createNode(b.i,b.x,b.y),an2=a.next,bp=b.prev;return a.next=b,b.prev=a,a2.next=an2,an2.prev=a2,b2.next=a2,a2.prev=b2,bp.next=b2,b2.prev=bp,b2}function insertNode(i,x,y,last2){const p=createNode(i,x,y);return last2?(p.next=last2.next,p.prev=last2,last2.next.prev=p,last2.next=p):(p.prev=p,p.next=p),p}function removeNode(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function createNode(i,x,y){return{i:i,x:x,y:y,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const texture=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKdUlEQVR4AeydbZrUKBRGq2YjOjvpWYntStSVjK5EdzLOSsr7arBLOkkBAcLHmacwlQQInMsZUvdP/3Xhv+oEbrfbk5XYz1P1gfLAC4KwCCCwQwBBduBwCwIIwhqAwA4BBNmBwy0IFBQEuBDonwCC9B9DZlCQAIIUhEvX/RNAkP5jyAwKEkCQgnDpun8CfQrSP3dm0AkBBOkkUAzzHAIIcg53ntoJAQTpJFAM8xwCCHIOd57aCQEE8QLFKQTuCSDIPQ2+Q8AjgCAeEE4hcE8AQe5p8B0CHgEE8YBwCoF7AghyT6Psd3rvkACCdBg0hlyPAILUY82TOiSAIB0GjSHXI4Ag9VjzpA4JIEiHQXs9ZK6UIoAgpcjS7xAEEGSIMDKJUgQQpBRZ+h2CAIIMEUYmUYoAgpQiO0q/k88DQSZfAEx/nwCC7PPh7uQEEGTyBcD09wkgyD4f7k5OAEEmXwBnTr+HZyNID1FijKcRQBAP/e12e2vl2cqHUsUe+c5K7OddqfG4fmMHNEN9BPGifL1ev9ulN1Y+FizP1nfsR21Kjun/2AHNUB9BVqJsknyyy1qMdpji89nm/HmKmUZOEkE2gNmCkSTaTTZqDHP5m831/TCz+TWRbP8iyA5KWzh/2+2RJfluc/zH5shngwCCbIC5u6wFNKIkmhM7x12g174iyBqVu2v2f1gtpBFft97b3L7dTZWvKwQQZAWKf8kWkn7Aqvi3ej1HjsDIIUggKJNEu8gImS0yVoExV7XXgugqZZXAIoleuVbvd3CRjFVkkBAkEphJ0mtmi4xVZKxVHUFEIb70ltnSrkfGKj7OFwRJgGa7iBacfpPomNBD9Sb8KE9EjiCJ4EwSZbVUEnuo1gw5DqCuKsiBcTbZ1CTRLtJyZouM1cGVgyAHAS6StPiqRcbqYGzVHEFE4WAxSVrLbJGxOhhT1xxBHInjx1YyW9rNyFgdj+fPHhDkJ4bj/9guooWp3yQ6Hu8wvQd+lKeze9VyFEFeTeyMCyaJsloqZzxez0QOUchYECQjTHVlkmgXOSOzRcZKAchcECQzUHW3SFLzVYuMlcAXKAhSAKq6NElqZbbIWAl4oYIghcAu3ZbObGmXImO1wC5xQJCHVNMr2C6iBazfJDqmd7Tdkh/l22yy3EGQLBi3OzFJlNVS2a6Udgc50rhFtUKQKFxplU0S7SI5M1tkrNJCEd0KQaKRpTVYJMnxqkXGKi0ESa0QJAlbWiOT5Ghmi4xVGvrkVgiSjC654UtmK64L7T5krOKYHa6NIIcRxnVgu4gWun6T6BjTmB/lMbQy1UWQTCBjujFJlNVSCW2GHKGkMtdDkMxAQ7szSbSLhGS2yFiFQi1QD0EKQA3tcpFk71WLjFUozEL1EKQQ2NBuTZKtzNahjFXo86m3TwBB9vnUuutntrSrkLGqRX/nOQiyA6fWLdtFJIR+k+iox/KjXBQaKAjSQBA0BJNEWS0V5BCQRgqCNBIIDcMk+WRFkuiU0gABBGkgCJ0NYarhIshU4WaysQQQJJYY9acigCBThZvJxhJAkFhi1J+KAIJMFe7WJ9ve+BCkvZgwooYIIEhDwWAo7RFAkPZiwogaIoAgDQWDobRHAEHaiwkjKkEgsU8ESQRHszkIIMgccWaWiQQQJBEczeYggCBzxJlZJhJAkERwNJuDQIggc5BglhBYIZBNkNvt9kSBQStrYGWtJ13KJsjy9K92pFwuMDiXgS3DPJ/cguQZFb1AoBECCNJIIBhGmwROFqRNKIwKAo4AgjgSHCGwQgBBVqBwCQKOAII4EhwhsEIAQVagcAkCjsC4grgZcoTAAQIIcgAeTccngCDjx5gZHiCAIAfg0XR8ArkF0V9KolwuMDiXQTZzswlyvV71ByenKMy1/VjnMiSbILkGRD8QaIkAgrQUDcbSHAEEaS4kDKglAgjSUjQYS3MEEKStkDCaxgggSGMBYThtEUCQtuLBaBojgCCNBYThtEUAQdqKB6NpjACCNBaQcsOh5xQCCJJCjTbTEECQaULNRFMIIEgKNdpMQwBBpgk1E00hgCAp1GjzJ4GBzxBk4OAyteMEEOQ4Q3oYmACCNBTc2+32bOVDQ0OafigI0sgSMDGebCj/Wvlo39/akU8DBBCkgSAsQuiP7rjR/Ldcc+fTHs+eOIKcHIFFBO0c/ki+Lvf865xXJIAgFWFvPEpy6PXKv63XrA9I4mOpe44gdXn/8TRb/FtyuHrP9uWdFT4nEUCQk8CbHFr8Ko9GoB/tZLYeUSp0H0EKgd3r1uTQK5V2j71q9/ckiV657q/x/RiBoNYIEoQpXyWTQwv9PmMV2jmZrVBSGeshSEaYj7pa5IjZOfwuyWz5RAqfI0hhwF73kkOvV97l4FPtPmS2gnEdr4ggxxkG9WC7x1E53HP0w57MlqNR+IgghQGre5NDi1pFpzmKfrST2cpB8kEfaYI86JTbLwRMDr1Safd4uZjnmyTRK1ee3uhllQCCrGLJc9Hk0AJOyViFDoDMViipxHoIkgjuUbNFjhI7h/9oMls+kYznCJIRpteV5NDrlXc5+6l2KTJb2bH+6hBBfnHI+q/tHrXkcONWAoDMlqOR8dicIBnndkpXJocWq0rt5+tHO5mtzNQRJCNQk0OvVNo9MvYa1ZUk0StXVCMqbxNAkG02UXdMDi3Mkhmr0PGQ2QolFVAPQQIgPaqyyHHmzuEPkcyWTyTxHEESwXnNJIder7zLp51qNyOzlQH/TIJkwPW6C9s9WpPDDVKJAjJbjkbiEUESwamZyaFFqKLTFot+tJPZOhAZBEmEZ3LolUq7R2IP1ZpJEr1yVXvgSA9CkIRomhxacC1krEJHT2YrlJRXD0E8II9OFzl62Dn8qZDZ8okEnCNIACSviuTQ69Xd5S6+atcjsxUZKgSJAGa7R69yuFkqoUBmy9EIOCJIACRVMTm0uFR02nPRj3YyW4ERRJAAUCaHXqm0ewTU7qKKJNErVxeDPXOQCPKAvsmhhdRTxurBjH7fJrP1G8X2FwTZZnNZ5Dh359gZX4ZbZLYeQESQfUCSQ69X+7X6vavdkczWTvwQZAOO7R6jy+FmrsQDmS1HwzsiiAdEpyaHFo2KTmco+tFOZmsl0giyAsUuvbHysWD5bH3HftSm5JhixzNFfQRZCfP1ev10LVjskV+sxH6+5B6T31/sgGaojyAzRJk5JhNAkGR0NJyBAILMEGXmmEwAQZLR0XAGAggyQ5Trz3GYJyLIMKFkIiUIIEgJqvQ5DAEEGSaUTKQEAQQpQZU+hyGAIMOEcpaJ1J0ngtTlzdM6I4AgnQWM4dYlgCB1efO0zgggSGcBY7h1CSBIXd48rWUCK2NDkBUoXIKAI4AgjgRHCKwQQJAVKFyCgCOAII4ERwisEECQFShcgoAjkEsQ1x9HCAxFAEGGCieTyU0AQXITpb+hCCDIUOFkMrkJIEhuovQ3FIEOBBmKN5PpjACCdBYwhluXAILU5c3TOiOAIJ0FjOHWJYAgdXnztM4IzC1IZ8FiuPUJIEh95jyxIwII0lGwGGp9AghSnzlP7IgAgnQULIZanwCCFGJOt2MQ+AEAAP//U3PGlQAAAAZJREFUAwA3ILMm/jaVEAAAAABJRU5ErkJggg==");class RenderManager extends Component{static name="RenderManager";container=new THREE.Group;lines=[];pointVirtualGrid=new PointSpatialHash;quadtree=new Quadtree(new Box2);verticalReferenceLineFlag=new THREE.Mesh(new THREE.PlaneGeometry(.3,.3),new THREE.MeshBasicMaterial({map:texture,color:58111,transparent:!0}));onAddFromParent(){const dxfLineModel=this.dxfLineModel;this.editor.container.add(this.container),this.editor.container.add(dxfLineModel.dxfModelGroup),dxfLineModel.dxfLineModel.material=new THREE.LineBasicMaterial({transparent:!0,opacity:.5,color:16777215}),dxfLineModel.addEventListener("modelUpdate",e=>{e.model.position.z=0,dxfLineModel.dxfDoorsLineModel.visible=!1}),this.variable.addEventListener("dxfVisible",e=>dxfLineModel.dxfModelGroup.visible=e.value),this.dxf.addEventListener("dataChange",()=>this.reset()),this.reset()}updatedMode=null;reset(){if("self"===this.updatedMode){const doors=this.lines.filter(line2=>line2.userData.isDoor);this.updatedMode=null;const diffList=this.dxf.doorLineSegment.filter(line2=>{for(let i=0;i<doors.length;i++){const door2=doors[i];if(door2.start.equal(line2.start)&&door2.end.equal(line2.end))return!1;if(door2.end.equal(line2.start)&&door2.start.equal(line2.end))return!1}return!0});return this.addLines(diffList.map(line2=>(line2.userData.isDoor=!0,line2.userData.doorDirectConnection,line2))),void this.draw(!1)}this.updatedMode="dxf",this.pointVirtualGrid=new PointSpatialHash;const box=this.dxf.box.clone().expansion(2*Math.max(this.dxf.box.width,this.dxf.box.height));0!==box.width&&0!==box.height||box.set(-200,-200,200,200),this.quadtree.clear(),this.quadtree.bounds=box,this.lines.length=0;const newLines=this.dxf.getLineSegments();this.addLines(newLines),this.draw()}addLine(line2,needdraw=!1){this.lines.push(line2),this.pointVirtualGrid.insert(line2.start,line2),this.pointVirtualGrid.insert(line2.end,line2),this.quadtree.insert(line2),needdraw&&this.draw()}addLines(lines,needdraw=!1){for(let i=0;i<lines.length;i++){const line2=lines[i];this.addLine(line2)}needdraw&&this.draw()}removeLine(line2,needdraw=!0){this.quadtree.remove(line2),this.pointVirtualGrid.remove(line2.start),this.pointVirtualGrid.remove(line2.end);const index=this.lines.indexOf(line2);this.lines.splice(index,1),needdraw&&this.draw()}removeLines(lines,needdraw=!0){for(let i=0;i<lines.length;i++)this.removeLine(lines[i],!1);needdraw&&this.draw()}removeLineAll(needdraw=!0){this.quadtree.clear(),this.pointVirtualGrid.clear(),this.lines.length=0,needdraw&&this.draw()}createGeometry(map,count){const geometry=new THREE.BufferGeometry;return Object.keys(map).forEach(k=>{geometry.setAttribute(k,new THREE.BufferAttribute(new Float32Array(map[k]),map[k].length/count))}),geometry}lineAdsorption=ref(!0);pointAdsorption=ref(!0);adsorption(radius,quadtree){radius=radius??isMobileRef.value?.08:.06,quadtree=quadtree??this.quadtree;const editor=this.parent?.findComponentByName("Editor"),point=Point.from(editor.pointerPosition);let result={point:new THREE.Vector3(editor.pointerPosition.x,editor.pointerPosition.y,0),find:!1,line:void 0,mode:void 0},queryResult=this.lineAdsorption.value?quadtree.queryCircle(point,radius):[];if(queryResult.length){let projectList=queryResult.map(res=>({point:res.line.projectPoint(point),line:res.line})).filter(item=>!!item.point);if(projectList.sort((a,b)=>a.point.distance(point)-b.point.distance(point)),projectList.length){const line2=projectList[0].line,projectPoint=projectList[0].point;result={point:new THREE.Vector3(projectPoint.x,projectPoint.y,0),find:!0,mode:"line",line:line2},this.pointAdsorption.value&&(line2.start.distance(point)<1.5*radius?(result.point.set(line2.start.x,line2.start.y,0),result.mode="point"):line2.end.distance(point)<1.5*radius&&(result.point.set(line2.end.x,line2.end.y,0),result.mode="point"))}}return this.dispatchEvent({type:"adsorptionPointChange",...result}),result}auxiliaryLineAdsorption(radius=null,quadtree){radius=radius??isMobileRef.value?.08:.06;const opt=this.adsorption(radius,quadtree);if("line"===opt.mode){this.setAuxiliaryLineVisible(!0);const start=new THREE.Vector3(opt.line.start.x,opt.line.start.y,.001),end=new THREE.Vector3(opt.line.end.x,opt.line.end.y,.001),center=new THREE.Vector3(opt.point.x,opt.point.y,.001);this.lineDashed1.setPoint(start,center),this.lineDashed2.setPoint(end,center),this.lineDashedText1.position.copy(start.clone().add(center).multiplyScalar(.5)),this.lineDashedText2.position.copy(end.clone().add(center).multiplyScalar(.5)),this.lineDashedText1.element.innerHTML=(1e3*start.distanceTo(center)).toFixed(0),this.lineDashedText2.element.innerHTML=(1e3*end.distanceTo(center)).toFixed(0)}else this.setAuxiliaryLineVisible(!1);return opt}lineDashed1=new LineDashed([]);lineDashed2=new LineDashed([]);lineDashedText1=null;lineDashedText2=null;setAuxiliaryLineVisible(b){this.lineDashedText1||(this.lineDashedText1=this.renderer.createText("",Point.zero(),{background:"#333333",padding:"0px",color:"#00ff00"},this.container)),this.lineDashedText2||(this.lineDashedText2=this.renderer.createText("",Point.zero(),{background:"#333333",padding:"0px",color:"#00ff00"},this.container)),this.lineDashed1.parent&&(this.container.add(this.lineDashed1),this.container.add(this.lineDashed2),this.container.add(this.lineDashedText1),this.container.add(this.lineDashedText2)),this.lineDashed1.visible=this.lineDashed2.visible=this.lineDashedText1.visible=this.lineDashedText2.visible=b}toJson(){return this.lines.map(line2=>line2.clone()).map(line2=>{const userData=line2.userData,drawWindow=userData.drawWindow,insetionArr=this.quadtree.queryLineSegment(line2).filter(r=>r.line!==line2&&!r.userData?.isDoor).map(r=>({index:this.lines.indexOf(r.line)}));return{...cloneUserData(userData),start:line2.start.toJson(this.dxf.originalZAverage),end:line2.end.toJson(this.dxf.originalZAverage),insetionArr:insetionArr,isDoor:userData.isDoor,doorDirectConnection:userData.isDoor,length:line2.length,isWindow:userData.isWindow,isVerticalReferenceLine:userData.isVerticalReferenceLine,wallWidth:line2.userData.wallWidth,drawWindow:drawWindow&&drawWindow.map(w=>({...cloneUserData(w),p:{x:w.p.x,y:w.p.y,z:w.p.z},width:w.width,full:w.full,rooftopPz:w.rooftopPz}))}})}debouncing=new Debouncing(20);synchronizeDxf(){"dxf"!==this.updatedMode?this.debouncing.debounce(()=>{this.updatedMode="self";const dxf2=this.dxf,json=this.toJson();dxf2.set(json,dxf2.options)}):this.updatedMode=null}draw(synchronize=!0){this.container.clear(),new Drawer(this.lines).draw(this.container),synchronize&&this.synchronizeDxf()}get renderer(){return this.parent?.findComponentByName("Renderer")}get dxf(){return this.parent?.findComponentByName("Dxf")}get variable(){return this.parent?.findComponentByName("Variable")}get eventInput(){return this.parent?.findComponentByName("EventInput")}get editor(){return this.parent?.findComponentByName("Editor")}get dxfLineModel(){return this.parent?.findComponentByName("DxfLineModel")}}class Drawer extends Pipeline{wallGroupManager;constructor(lines){super(),this.wallGroupManager=WallGroupManager.fromByLines(lines),this.use({type:"wall",handle:this.wall.bind(this)}),this.use({type:"doubleWall",handle:this.doubleWall.bind(this)}),this.use({type:"door",handle:this.door.bind(this)}),this.use({type:"balconyRailing",handle:this.balconyRailing.bind(this)}),this.use({type:"window",handle:this.wall.bind(this)}),this.use({type:"hole",handle:this.hole.bind(this)}),this.use({type:"bayWindow",handle:this.bayWindow.bind(this)})}wall(ctx){const color=new THREE.Color(5745151),holeLines=ctx.data.flatMap(line2=>{const holeLines2=[];WallHole.forEachStorageType(line2,(data,key)=>{data.forEach(item=>{let type="drawWindow"==key?"window":item.type;const holeLine=WallHole.holeDataToLine(line2,item);holeLine.userData.type=type,holeLines2.push(holeLine)})});let lines=[line2];return holeLines2.length&&(lines=LineSegmentUtils.clippingByLines(line2,holeLines2)??[]),lines.forEach(line22=>{line22.points.forEach(p=>{ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b)})}),holeLines2});this.wallGroupManager.add({type:"hole",lines:holeLines})}doubleWall(ctx){this.wallGroupManager.add({type:"wall",lines:ctx.data})}door(ctx){this.wallGroupManager.add({type:"hole",lines:ctx.data})}balconyRailing(ctx){const color=new THREE.Color(65280);ctx.data.forEach(line2=>{line2.points.forEach(p=>{ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b)})})}bayWindow(ctx){const color=new THREE.Color(5745151);ctx.data.forEach(line2=>{line2.userData.isBayWindow&&line2.points.forEach(p=>{ctx.cache.lineDasheds.push(p.x,p.y,0),ctx.cache.lineDashedColor.push(color.r,color.g,color.b)})}),this.wallGroupManager.add({type:"wall",lines:ctx.data.filter(line2=>!line2.userData.isBayWindow)})}hole(ctx){const colors={default:new THREE.Color(16776960),passageEntrance:new THREE.Color(16776960),window:new THREE.Color(16711935),door:new THREE.Color(16776960),beam:new THREE.Color(16711680)};ctx.data.forEach(line2=>{const type=line2.userData.type??"default",color=colors[type]??colors.default;line2.points.forEach(p=>{"default"===type||"passageEntrance"===type?(ctx.cache.lineDasheds.push(p.x,p.y,0),ctx.cache.lineDashedColor.push(color.r,color.g,color.b)):(ctx.cache.lines.push(p.x,p.y,0),ctx.cache.lineColor.push(color.r,color.g,color.b))})})}createLineSegments(map,count,parameters){if(Array.isArray(map)){const position=map.flatMap(line2=>line2?.points?.flatMap(p=>[p.x,p.y,0]));return this.createLineSegments({position:position},2*map.length,parameters)}const geometry=new THREE.BufferGeometry;Object.keys(map).forEach(key=>{const value=map[key];if("color"===key){let attr=new THREE.BufferAttribute(new Float32Array(value),value.length/count);geometry.setAttribute(key,attr)}else{let attr=new THREE.BufferAttribute(new Float32Array(value),value.length/count);geometry.setAttribute(key,attr)}});return new THREE.LineSegments(geometry,new THREE.LineBasicMaterial({...parameters}))}draw(parent2){const option={lines:[],lineColor:[],walls:[],wallColor:[],lineDasheds:[],lineDashedColor:[]};if(this.wallGroupManager.forEach(group=>{this.run(group.type,group.lines,option)}),option.lines.length){const wall=this.createLineSegments({position:option.lines,color:option.lineColor},option.lines.length/3,{vertexColors:!0,toneMapped:!1,color:16777215});parent2.add(wall)}if(option.lineDasheds.length){const wall=this.createLineSegments({position:option.lineDasheds,color:option.lineDashedColor},option.lineDasheds.length/3);wall.material=new THREE.LineDashedMaterial({color:16777215,vertexColors:!0,dashSize:.05,gapSize:.05,toneMapped:!1,transparent:!0,opacity:.7}),wall.computeLineDistances(),parent2.add(wall)}if(option.walls.length){const array=[];option.walls.forEach((poly,i)=>{option.wallColor[3*i],option.wallColor[3*i+1],option.wallColor[3*i+2],earcut(poly.flatMap(p=>[p.x,p.y])).forEach(j=>{array.push(poly[j].x,poly[j].y,0)})});const geometry=new THREE.BufferGeometry;geometry.setAttribute("position",new THREE.BufferAttribute(new Float32Array(array),3));const material=new THREE.MeshBasicMaterial({color:16777215}),mesh=new THREE.Mesh(geometry,material);parent2.add(mesh)}}}class DefaultCommand extends Command{static name="DefaultCommand";container=new THREE.Group;onAddFromParent(){const editor=this.editor,commandManager=editor.commandManager;editor.container.add(this.container),commandManager.addCommandFlow("default").add(isMobileRef.value?this.startMobile.bind(this):this.start.bind(this)).addEventListener("finally",this.finally.bind(this)),commandManager.addEventListener("startedBefore",e=>{"default"===e.currentName&&"default"!==e.name&&commandManager.cancel()}),commandManager.addEventListener("finally",e=>"default"!==e.name&&commandManager.start("default")),editor.eventInput.addCancelDefaultBehavior(()=>editor.eventInput.isOnlyKeyDowns(["control","g"]))}selectLines=[];selectLineObject3D=new THREE.Mesh;selectHoleLine=null;setSelectHoleLine(line2){this.removeSelectLineAll(),this.selectHoleLine=line2,this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectWinLineChange"}),this.dispatchEvent({type:"selectHoleLineChange"})}addSelectLine(...lineSegments){this.selectHoleLine=null,lineSegments=lineSegments.filter(line2=>-1===this.selectLines.indexOf(line2)),this.selectLines.push(...lineSegments),this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"})}removeSelectLine(lineSegment){const i=this.selectLines.indexOf(lineSegment);i>-1&&(this.selectHoleLine=null,this.selectLines.splice(i,1),this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"}))}removeSelectLineAll(){(this.selectHoleLine||0!==this.selectLines.length)&&(this.selectHoleLine=null,this.selectLines.length=0,this.updateSelectLinesGeometry(),this.dispatchEvent({type:"selectLineChange"}))}getSelectData(){return this.selectHoleLine?[this.selectHoleLine]:[...this.selectLines]}_timer=null;material1=new THREE.LineBasicMaterial({color:16777215});material2=new THREE.LineBasicMaterial({color:15277667});updateSelectLinesGeometry(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{if(this.destroyed)return;const lines=[...this.selectLines];this.selectHoleLine&&lines.push(this.selectHoleLine),lines.length?this.container.add(this.selectLineObject3D):this.selectLineObject3D.removeFromParent();const editor=this.editor,position=lines.flatMap(line2=>line2.toRectangle(isMobileRef.value?.12:.04,"butt").createGeometry());this.selectLineObject3D.geometry=editor.renderManager.createGeometry({position:position},position.length/3),this.selectHoleLine?this.selectLineObject3D.material=this.material2:this.selectLineObject3D.material=this.material1},10)}showSelectBox(){const editor=this.editor,startPoint=editor.pointerPosition.clone(),endPoint=editor.pointerPosition.clone(),mesh=new THREE.Mesh;this.container.add(mesh),mesh.position.z=.05,mesh.material=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:.5});const move=()=>{endPoint.copy(editor.pointerPosition),(()=>{const minX=Math.min(startPoint.x,endPoint.x),maxX=Math.max(startPoint.x,endPoint.x),minY=Math.min(startPoint.y,endPoint.y),maxY=Math.max(startPoint.y,endPoint.y),position=[minX,maxY,0,maxX,minY,0,maxX,maxY,0,minX,maxY,0,minX,minY,0,maxX,minY,0];mesh.geometry=editor.renderManager.createGeometry({position:position},position.length/3)})()},end=()=>{document.removeEventListener("mousemove",move),document.removeEventListener("mouseup",end),mesh.removeFromParent();const minX=Math.min(startPoint.x,endPoint.x),maxX=Math.max(startPoint.x,endPoint.x),minY=Math.min(startPoint.y,endPoint.y),maxY=Math.max(startPoint.y,endPoint.y),box=new Box2(minX,maxX,minY,maxY),resultList=editor.renderManager.quadtree.queryBox(box);this.removeSelectLineAll(),resultList.forEach(result=>this.addSelectLine(result.line)),this.updateSelectLinesGeometry()};document.addEventListener("mousemove",move),document.addEventListener("mouseup",end)}start(){const editor=this.editor,eventInput=editor.eventInput,object3D=new THREE.Mesh,dom=editor.domContainer.domElement;let time=-1,selectLine=null,selectType=null;object3D.position.z=.002,this.selectLineObject3D.position.z=object3D.position.z+.001,object3D.material=new THREE.MeshBasicMaterial({color:55561});const textObj3D=this.renderer.createText("",new THREE.Vector3(0,0,0),{background:"rgba(0,0,0,0.5)",padding:"2px",borderRadius:"2px"},this.container);textObj3D.visible=!1,this.addEventRecord("clear",editor.addEventListener("pointerPositionChange",()=>{const{line:line2,point:point}=editor.renderManager.adsorption();if(line2){selectLine=line2,selectType="wall";const p=Point.from(point);for(const insertObject of WH.getIterator(line2)){const hole=WH.holeDataToLine(line2,insertObject),p2=hole.projectPoint(p,!0);if((p2?.distance(p)??1/0)<.08){hole.currentData.insertObject=insertObject,hole.currentData.line=line2,selectLine=hole,selectType="hole";break}}dom.style.cursor="pointer";const rectangle=selectLine.toRectangle(.025,"butt");object3D.geometry=editor.renderManager.createGeometry({position:rectangle.createGeometry()},6);const center=selectLine.center;let info="";textObj3D.element.innerText=info+parseInt(1e3*selectLine.length+"")+" mm",textObj3D.position.set(center.x,center.y,0),textObj3D.visible=!0,this.container.add(object3D)}else object3D.removeFromParent(),dom.style.cursor="default",selectLine=null,selectType=null,textObj3D.visible=!1}),eventInput.addEventListener("codeChange",()=>{if(eventInput.isKeyDown("mouse_0")){if(!selectLine)return this.showSelectBox();if(eventInput.isKeyDown("alt"))return this.removeSelectLine(selectLine);if(eventInput.isKeyDown("control")||this.removeSelectLineAll(),"hole"===selectType){const t=performance.now();return-1===time?(time=t,setTimeout(()=>time=-1,400),this.setSelectHoleLine(selectLine)):this.addSelectLine(selectLine.currentData.line)}this.addSelectLine(selectLine)}else if(eventInput.isKeyDown("mouse_1")){if(!selectLine)return;this.removeSelectLine(selectLine)}else if(eventInput.isKeyDown("mouse_2")){if(!selectLine)return;this.addSelectLine(selectLine)}else eventInput.isKeyDowns(["control","z"])?editor.commandManager.rollback():eventInput.isKeyDowns(["control","y"])&&editor.commandManager.revokeRollback()}),function(){object3D.removeFromParent(),textObj3D.removeFromParent()})}async startMobile(){let isSelectLine=!1;const editor=this.editor,eventInput=editor.eventInput,lineSelector=new LineSelector(this.editor,Point.zero(),"pointerdown",editor.renderManager.quadtree);lineSelector.onPointerMove=(_,line2)=>{isSelectLine=!!line2},this.awaitOnlyKeys(["mouse_0"],{once:!1}).awaitEach(()=>{isSelectLine||this.showSelectBox()}),this.addCommandEndHandle(()=>{this.removeSelectLineAll(),lineSelector.destroy()});for await(const line2 of lineSelector){if(!line2)return;if(line2.currentData.insertObject)this.setSelectHoleLine(line2);else{if(eventInput.isKeyDown("alt"))return this.removeSelectLine(line2);eventInput.isKeyDown("control")||this.removeSelectLineAll(),this.addSelectLine(line2)}}}finally(){this.cancelEventRecord("clear"),this.removeSelectLineAll(),this.updateSelectLinesGeometry()}}class DrawLine extends Command{static name="DrawLine";container=new THREE.Group;static withdrawalKeys=["Control","Z"];static shortcutKeys=["L"];static commandName="draw-line";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container);const commandFlow=this.initCommandFlow({shortcutKeys:this.shortcutKeys});commandFlow.add(this.createCursor("crosshair")),isMobile()&&commandFlow.add(this.selectFirstPoint.bind(this)),commandFlow.add(this.selectPoint.bind(this),{prompt:`两个点绘制一条线段,可连续绘制多条线段, ${this.formatText("ALT")} 键锁定方向, ${this.formatText("ESC")} 取消命令`,showConfirm:!0}),commandFlow.add(this.end.bind(this))}async selectFirstPoint(next){const onClick=()=>{next(Point.from(this.editor.pointerPosition))};this.editor.domEventRegister.addEventListener("click",onClick,{once:!0}),this.addCommandEndHandle(()=>this.editor.domEventRegister.removeEventListener("click",onClick))}async selectPoint(next,point){const circle=this.renderer.createCircle(Point.zero(),{color:16777215},this.container),auxiliaryLine=new LineDashed([new THREE.Vector3(-1e4,0,0),new THREE.Vector3(1e4,0,0),new THREE.Vector3(0,-1e4,0),new THREE.Vector3(0,1e4,0)],16777215,.1,.1),points=[],lineDashed=new LineDashed([],16777215,.1,.1),lineObj3D=new Lines([],16711935),lineAlignmentGuide=new LineAlignmentGuide,baseLine=new LineSegment,normalLine=new LineSegment,unitText=this.renderer.createText("0mm",Point.zero(),{},this.container);point=point??Point.zero(),circle.position.set(point.x,point.y,0),auxiliaryLine.material.transparent=!0,auxiliaryLine.material.opacity=.2,unitText.visible=!1,this.addCommandEndHandle(()=>unitText.removeFromParent()),this.container.add(auxiliaryLine).add(lineDashed).add(lineObj3D).add(lineAlignmentGuide),this.addCommandEndHandle(()=>this.container.clear());const pointerFollowMove=new PointerFollowMove(this.editor,point).setType("all").setEmptySpace(!0);this.addCommandEndHandle(()=>pointerFollowMove.destroy());let currentLine=null;pointerFollowMove.onPointerMove=(point2,line2)=>{if(directionLock.value&&point2&&(PointUtils.constrainPointToAxis(point2,baseLine,normalLine.start,normalLine),pointerFollowMove.dragControlPoint?.setPoint(point2)),circle.position.x=point2.x,circle.position.y=point2.y,auxiliaryLine.position.copy(point2.toVector3()),points.length){lineDashed.setPoint(points.at(-1).toVector3(),circle.position);const c=lineDashed.getCenter(0,1);unitText.position.set(c.x,c.y,c.z),unitText.element.innerText=mToMm(lineDashed.getDistance(0,1))+"mm",unitText.visible=!0}line2&&!directionLock.value?(lineAlignmentGuide.visible=!0,lineAlignmentGuide.set(line2,[point2])):lineAlignmentGuide.visible=!1,currentLine=line2};const addPoint=()=>{const point2=new Point(circle.position.x,circle.position.y);points.push(point2),lineObj3D.setPoint(...points.map(p=>p.toVector3(0))),1===points.length?currentLine&&baseLine.copy(currentLine):points.length>1&&(baseLine.set(points.at(-1),points.at(-2)),pointerFollowMove.snapController.addLine(baseLine.clone()));const normal=baseLine.normal();normalLine.start.copy(point2),normalLine.end.copy(point2).add(normal.multiplyScalar(1)),unitText.visible=!1};isMobile()?pointerFollowMove.onMobileEnd=addPoint:this.awaitOnlyKeys(["mouse_0"],{once:!1}).awaitEach(addPoint),this.awaitOnlyKeys(["enter"],{once:!1,condition:()=>points.length>=2||(ElMessage({type:"warning",message:"需要选择大于或等于两个点"}),!1)}).awaitEach(()=>{next(points.flatMap((p,i)=>0===i||i===points.length-1?[p]:[p,p]))});const{destroy:destroy1,directionLock:directionLock,endPointSnap:endPointSnap}=function(el){const directionLock=ref(!1),endPointSnap=ref(!0),destroy=createVueApp(function(){return createVNode("div",{class:" z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",onClick:e=>e.stopPropagation(),onMousedown:e=>e.stopPropagation(),onPointerdown:e=>e.stopPropagation()},[createVNode(_sfc_main$4,{icon:"tdesign:rotate-locked-filled",modelValue:directionLock.value,"onUpdate:modelValue":$event=>directionLock.value=$event,title:"方向锁定( tab )"},null),createVNode(_sfc_main$4,{icon:"gis:snap",modelValue:endPointSnap.value,"onUpdate:modelValue":$event=>endPointSnap.value=$event,title:"端点吸附( alt )"},null)])},{},el);return{directionLock:directionLock,endPointSnap:endPointSnap,destroy:destroy}}(this.editor.domElement);this.awaitOnlyKeys(["tab"],{once:!1}).awaitEach(()=>{directionLock.value=!directionLock.value}),this.awaitOnlyKeys(["alt"],{once:!1}).awaitEach(()=>{endPointSnap.value=!endPointSnap.value});const watchHandle=watch(endPointSnap,()=>pointerFollowMove.snapController.pointSnap=endPointSnap.value);this.addCommandEndHandle(destroy1,watchHandle)}end(next,points){const lines=[];for(let i=0;i<points.length;i+=2)lines.push(new LineSegment(Point.from(points[i]),Point.from(points[i+1])));lines.forEach(line2=>{if(this.renderManager.dxf.options.publicInfo?.rootTopContourInfo){const rooftopPz=HeightQuery.query(line2,this.renderManager.dxf.options.publicInfo?.rootTopContourInfo);line2.userData.rooftopPz=rooftopPz}}),ElMessage({message:"绘制完成",type:"success"}),next(lines)}onCompleted(lines){this.renderManager.addLines(lines),this.renderManager.draw()}onRollback(lines){return lines.forEach(line2=>this.renderManager.removeLine(line2)),this.renderManager.draw(),lines}onRevokeRollback(lines){return this.onCompleted(lines),lines}}class DrawDoorLine extends DrawHole{static name="DrawDoorLine";static shortcutKeys=["D"];static commandName="draw-door-line";holeType="door"}class DrawWindow extends DrawHole{static name="DrawWindow";container=new THREE.Group;static shortcutKeys=["W"];static commandName="draw-window-line";holeType="window";holeKey="drawWindow"}class VerticalCorr extends Command{static name="VerticalCorr";container=new THREE.Group;static shortcutKeys=["Shift","V"];static commandName="VerticalCorr";onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",e=>this.completed(e.data)),this.eventInput.addEventListener("codeChange",async()=>{this.eventInput.isOnlyKeyDowns(this.shortcutKeys)&&this.commandManager.start(this.commandName,[...this.default.selectLines])}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}constraint(next,selectLines){Array.isArray(selectLines)?1!==selectLines.length?(ElMessage({message:"请选择一条线段",type:"warning"}),this.cancel()):next(selectLines):(ElMessage({message:"进入命令失败",type:"warning"}),this.cancel())}isTowLineSegmentConnect(line0,line1){return!!(line0.start.equal(line1.start)||line0.start.equal(line1.end)||line0.end.equal(line1.start)||line0.end.equal(line1.end))}setLinePoint(line2,newStartPoint,newEndPoint,mode="all",resultList=[],id=uuid()){if(line2.userData.setLinePointUUid===id)return[];line2.userData.setLinePointUUid=id;let startIntersectionLine=[],endIntersectionLine=[];"start"!==mode&&"all"!==mode||(startIntersectionLine=this.renderManager.pointVirtualGrid.queryPoint(line2.start).filter(res=>res.userData!==line2)),"end"!==mode&&"all"!==mode||(endIntersectionLine=this.renderManager.pointVirtualGrid.queryPoint(line2.end).filter(res=>res.userData!==line2));const copyLine=line2.clone();let changePoint="";newStartPoint&&(line2.start.equal(newStartPoint)||(changePoint="start"),resultList.push({point:line2.start,oldPoint:line2.start.clone(),newPoint:newStartPoint,line:line2}),line2.start.copy(newStartPoint)),newEndPoint&&(line2.end.equal(newEndPoint)||(changePoint="start"===changePoint?"all":"end"),resultList.push({point:line2.end,oldPoint:line2.end.clone(),newPoint:newEndPoint,line:line2}),line2.end.copy(newEndPoint));const setLinePoint=(intersectionLine,newValue,pointType)=>{intersectionLine.forEach(result=>{const{point:queryPoint,userData:queryLine}=result,pointName=queryLine.start===queryPoint?"start":"end";if(queryLine.directionEqual(copyLine))if("start"===pointName){const newEnd=line2.projectPoint(queryLine.end,!1);if(newEnd)return this.setLinePoint(queryLine,newValue,newEnd,"end",resultList,id)}else{const newStart=line2.projectPoint(queryLine.start,!1);if(newStart)return this.setLinePoint(queryLine,newStart,newValue,"start",resultList,id)}"all"!==changePoint&&pointType!==changePoint||this.setLinePoint(queryLine,queryLine.start===queryPoint?newValue:queryLine.start,queryLine.end===queryPoint?newValue:queryLine.end,queryLine.start===queryPoint?"end":"start",resultList,id)})};return setLinePoint(startIntersectionLine,line2.start,"start"),setLinePoint(endIntersectionLine,line2.end,"end"),[...startIntersectionLine,...endIntersectionLine]}correction(targettLine,resultList=[],vistedList=/* @__PURE__ */new Set){vistedList.add(targettLine);const lines=this.renderManager.quadtree.queryLineSegment(targettLine).filter(({line:line2})=>line2!==targettLine&&!line2.userData.isDoor&&!vistedList.has(line2)).map(result=>result.line),targettLineDirection=targettLine.direction(),[pointLines,intersectingLines]=lines.reduce((list,line2)=>{const[pointLines2,intersectingLines2]=list;return line2.isSameEndpoint(targettLine)?pointLines2.push(line2):intersectingLines2.push(line2),list},[[],[]]);pointLines.forEach(line2=>{const direction=line2.direction(),angle2=targettLineDirection.angleBetween(direction,"angle");if(Math.abs(90-angle2)>45)return!1;const point0=targettLine.isSameEndpointAsStart(line2)?targettLine.start:targettLine.end,point1=line2.isSameEndpointAsStart(targettLine)?line2.end:line2.start,projectPoint=new LineSegment(point1.clone().add(targettLineDirection.clone().multiplyScalar(1)),point1.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point0,!1);if(projectPoint){const list=[];this.setLinePoint(line2,line2.start===point1?projectPoint:line2.start,line2.end===point1?projectPoint:line2.end,line2.start===point1?"start":"end",list),resultList.push(list)}return vistedList.add(line2),!1}),targettLineDirection.copy(targettLine.direction());const projectPointComputed=(sameEndpoint,otherPoint,line2)=>{const point=targettLine.projectPoint(otherPoint);if(point)sameEndpoint.copy(point);else{const projectPoint=new LineSegment(otherPoint.clone().add(targettLineDirection.clone().multiplyScalar(1)),otherPoint.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(sameEndpoint,!1);if(projectPoint){const list=[];this.setLinePoint(line2,line2.start===otherPoint?projectPoint:line2.start,line2.end===otherPoint?projectPoint:line2.end,line2.start===otherPoint?"start":"end",list),resultList.push(list)}}};return intersectingLines.forEach(line2=>{if(targettLine.containsPoint(line2.start))projectPointComputed(line2.start,line2.end,line2);else if(targettLine.containsPoint(line2.end))projectPointComputed(line2.end,line2.start,line2);else{const point=targettLine.getIntersection(line2);if(point){const projectPoint1=new LineSegment(line2.start.clone().add(targettLineDirection.clone().multiplyScalar(1)),line2.start.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point,!1);if(projectPoint1){const list=[];this.setLinePoint(line2,projectPoint1,line2.end,"start",list),resultList.push(list)}const projectPoint2=new LineSegment(line2.end.clone().add(targettLineDirection.clone().multiplyScalar(1)),line2.end.clone().add(targettLineDirection.clone().multiplyScalar(-1))).projectPoint(point,!1);if(projectPoint2){const list=[];this.setLinePoint(line2,line2.start,projectPoint2,"end",list),resultList.push(list)}}}}),resultList}verticalCorrection(next,selectLines){next(this.correction(selectLines[0]))}completed(data){const insertObjectLines=[];data.forEach(items=>{items.forEach(item=>{const{line:line2,newPoint:newPoint,point:point}=item;point.copy(newPoint),this.renderManager.removeLine(line2),this.renderManager.addLine(line2),WallHole.isHole(line2)&&insertObjectLines.push(line2)})}),WallHole.filterIllegal(insertObjectLines),this.renderManager.draw()}rollback(data){const insertObjectLines=[];for(let i=data.length-1;i>=0;i--){const items=data[i];for(let j=items.length-1;j>=0;j--){const item=items[j],{line:line2,oldPoint:oldPoint,point:point}=item;point.copy(oldPoint),this.renderManager.removeLine(line2),this.renderManager.addLine(line2),WallHole.isHole(line2)&&insertObjectLines.push(line2)}}return WallHole.filterIllegal(insertObjectLines),this.renderManager.draw(),data}revokeRollback(data){return this.completed(data),data}}const _sfc_main$3=/* @__PURE__ */defineComponent({__name:"Input",props:{modelValue:{},modelModifiers:{}},emits:/* @__PURE__ */mergeModels(["change","blur"],["update:modelValue"]),setup(__props,{emit:__emit}){function onBlur(){emits("blur")}const handleKeypress=event=>{const char=event.key;/[\d\-.]/.test(char)||["Backspace","Delete","ArrowLeft","ArrowRight","Tab"].includes(char)||event.preventDefault()},handlePaste=event=>{const pastedText=event.clipboardData?.getData("text");pastedText&&!/^-?\d+\.?\d*$/.test(pastedText)&&event.preventDefault()},value=useModel(__props,"modelValue",{set:v=>Number(v)}),emits=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock("input",{"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>value.value=$event),type:"text",class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1",onKeypress:handleKeypress,onPaste:handlePaste,onChange:_cache[1]||(_cache[1]=$event=>emits("change")),onBlur:onBlur},null,544)),[[vModelText,value.value,void 0,{number:!0}]])}}),_hoisted_1$2={key:0},_hoisted_2$1={class:"flex w-full"},_hoisted_3$1={key:0,class:"mr-[10px] h-[20px] flex justify-center items-center"},_hoisted_4$1={class:"size-[16px] rounded-[100px] text-[12px] flex justify-center items-center text-[#409eff]"},_hoisted_5$1={class:"flex-1 mb-[5px]"},_hoisted_6$1={class:"leading-[20px]"},_hoisted_7$1={class:"bg-[whitesmoke] rounded-[10px] mt-[5px]"},_hoisted_8$1={class:"p-[5px] text-[12px]"},_hoisted_9$1={class:"mr-[5px]"},_hoisted_10$1={class:"p-[2px] number"},_hoisted_11$1={class:"p-[2px] number"},_hoisted_12$1={class:"p-[5px] text-[12px]"},_hoisted_13$1={class:"p-[2px] number"},_hoisted_14$1={class:"mt-[5px] bg-[whitesmoke] rounded-[10px]"},_hoisted_15$1={key:0,class:"p-[5px] text-[12px] flex"},_hoisted_16$1={class:"p-[5px] text-[12px] flex"},_hoisted_17$1={class:"mr-[5px] w-[50px]"},_hoisted_18$1={key:1,class:"p-[5px] text-[12px] flex"},_hoisted_19$1={key:2,class:"p-[5px] text-[12px] flex"},_hoisted_20$1={key:1,class:"text-[12px] text-center text-[#aaa]"},PropertiesPanelView=/* @__PURE__ */_export_sfc(/* @__PURE__ */defineComponent({__name:"PropertiesPanel",props:{selectLines:{}},emits:["update","clickIcon"],setup(__props,{emit:__emit}){const props=__props,emits=__emit,selectLines=props.selectLines,map=/* @__PURE__ */new Map,userDataList=computed(()=>selectLines.value.map(line2=>(line2.userData.isDoor&&!line2.userData.drawDoorData&&(line2.userData.drawDoorData={}),map.has(line2.uuid)||map.set(line2.uuid,reactive(line2.userData)),map.get(line2.uuid)))),holeName={door:"门",window:"窗",beam:"梁",hole:"垭口"};return(_ctx,_cache)=>(openBlock(),createBlock(_sfc_main$7,{title:"属性",name:"PropertiesPanel",style:{"z-index":"201"},onClickIcon:_cache[6]||(_cache[6]=$event=>emits("clickIcon"))},{default:withCtx(()=>[createElementVNode("div",{class:"p-[5px] max-h-[300px] min-w-[200px] overflow-y-auto",onWheel:_cache[4]||(_cache[4]=e=>e.stopPropagation()),onPointerdown:_cache[5]||(_cache[5]=e=>e.stopPropagation())},[unref(selectLines).length?(openBlock(),createElementBlock("ul",_hoisted_1$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.selectLines.value,(line2,i)=>(openBlock(),createElementBlock("li",_hoisted_2$1,[unref(selectLines).length>1?(openBlock(),createElementBlock("div",_hoisted_3$1,[createElementVNode("div",_hoisted_4$1,toDisplayString(i+1)+". ",1)])):createCommentVNode("",!0),createElementVNode("div",_hoisted_5$1,[createElementVNode("div",null,[createElementVNode("h5",_hoisted_6$1,toDisplayString(line2.userData.isDoor?"门线":line2.userData.isSelectWindow?`孔洞线( ${holeName[line2.userData.type??"hole"]} )`:line2.userData.isBayWindow?"飘窗线":"墙体线"),1)]),createElementVNode("div",_hoisted_7$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(line2.points,(point,index)=>(openBlock(),createElementBlock("p",_hoisted_8$1,[createElementVNode("span",_hoisted_9$1,toDisplayString(0===index?"开始":"结束"),1),createElementVNode("span",_hoisted_10$1,"x:"+toDisplayString(point.x.toFixed(2)),1),_cache[7]||(_cache[7]=createElementVNode("span",{class:"mr-[20px]"},null,-1)),createElementVNode("span",_hoisted_11$1,"y:"+toDisplayString(point.y.toFixed(2)),1)]))),256)),createElementVNode("p",_hoisted_12$1,[_cache[8]||(_cache[8]=createElementVNode("span",{class:"mr-[5px]"},"长度",-1)),createElementVNode("span",_hoisted_13$1,toDisplayString(Number(line2.length.toFixed(4)))+"m",1)])]),createElementVNode("div",_hoisted_14$1,[userDataList.value[i].isSelectWindow?(openBlock(),createElementBlock("p",_hoisted_15$1,[_cache[9]||(_cache[9]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"孔洞宽度",-1)),createVNode(_sfc_main$3,{onBlur:_cache[0]||(_cache[0]=$event=>emits("update")),modelValue:userDataList.value[i].width,"onUpdate:modelValue":$event=>userDataList.value[i].width=$event,modelModifiers:{number:!0},class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0),createElementVNode("p",_hoisted_16$1,[createElementVNode("span",_hoisted_17$1,toDisplayString(line2.userData.isSelectWindow?"孔洞":line2.userData.isBalconyRailing?"栏杆":"墙体")+"高度",1),createVNode(_sfc_main$3,{onBlur:_cache[1]||(_cache[1]=$event=>emits("update")),modelValue:userDataList.value[i].height,"onUpdate:modelValue":$event=>userDataList.value[i].height=$event,class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])]),line2.userData.isDoor?(openBlock(),createElementBlock("p",_hoisted_18$1,[_cache[10]||(_cache[10]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"门高度",-1)),createVNode(_sfc_main$3,{onBlur:_cache[2]||(_cache[2]=$event=>emits("update")),modelValue:userDataList.value[i].drawDoorData.height,"onUpdate:modelValue":$event=>userDataList.value[i].drawDoorData.height=$event,class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0),userDataList.value[i].isSelectWindow?(openBlock(),createElementBlock("p",_hoisted_19$1,[_cache[11]||(_cache[11]=createElementVNode("span",{class:"mr-[5px] w-[50px]"},"离地高",-1)),createVNode(_sfc_main$3,{onBlur:_cache[3]||(_cache[3]=$event=>emits("update")),modelValue:userDataList.value[i].groundClearance,"onUpdate:modelValue":$event=>userDataList.value[i].groundClearance=$event,modelModifiers:{number:!0},class:"bg-[#e9e9e9] border-0 focus:outline-0 p-[2px_5px] rounded-[6px] text-[12px] flex-1"},null,8,["modelValue","onUpdate:modelValue"])])):createCommentVNode("",!0)])])]))),256))])):(openBlock(),createElementBlock("div",_hoisted_20$1,"请选择线段"))],32)]),_:1}))}}),[["__scopeId","data-v-9af99455"]]);class PropertiesPanel extends Command{static name="PropertiesPanel";container=new THREE.Group;static shortcutKeys=["i"];static commandName="PropertiesPanel";isOpen=!1;onAddFromParent(parent2){super.onAddFromParent(parent2),this.editor.container.add(this.container),this.container.position.z=.001;const commandFlow=this.commandManager.addCommandFlow(this.commandName).add(this.constraint.bind(this)).add(this.open.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));commandFlow.writeOperationRecord=!1,commandFlow.addEventListener("finally",this.createFinally()),commandFlow.addEventListener("completed",()=>this.completed()),this.eventInput.addKeyCombination(this.commandName,this.shortcutKeys),this.eventInput.addEventListener("codeChange",async()=>{this.isOpen||this.eventInput.isKeyCombination(PropertiesPanel.commandName)&&await this.commandManager.start(PropertiesPanel.commandName,this.getSelectLines())}),this.eventInput.addCancelDefaultBehavior(()=>this.eventInput.isOnlyKeyDowns(this.shortcutKeys))}getSelectLines(){const list=[...this.default.selectLines],winList=[];if(this.default.selectHoleLine){const wiLine=this.default.selectHoleLine;wiLine.userData=wiLine.currentData.insertObject,wiLine.currentData.selectWin=wiLine.currentData.line,wiLine.userData.isSelectWindow=!0,winList.push(wiLine)}return{list:list,winList:winList}}constraint(next,{list:list,winList:winList}){winList.length?(this.default.setSelectHoleLine(winList[0]),next(winList)):(this.default.addSelectLine(...list),next(list))}open(next){this.isOpen=!0;const container=document.createElement("div");container.tabIndex=1,["mousedown","keydown","keyup"].forEach(key=>container.addEventListener(key,e=>e.stopPropagation())),this.domElement.appendChild(container);const selectLines=ref([]),update=()=>{const data=this.getSelectLines();this.container.clear();const list=[...data.list,...data.winList];selectLines.value=list,list.length>1&&list.forEach((line2,i)=>{this.container.add(drawText(i+1,line2.center,{color:"#fff",width:"16px",height:"16px",lineHeight:"16px",textAlign:"center",background:"#409eff",borderRadius:"200px"},0))})},eventCloses=[this.default.addEventListener("selectLineChange",update),this.default.addEventListener("selectWinLineChange",update)];update();createApp(PropertiesPanelView,{selectLines:selectLines,position:this.editor.domEventRegister.pointer.clone(),onClickIcon:()=>{eventCloses.forEach(eventClose=>eventClose()),container.remove(),this.container.clear(),this.isOpen=!1},onUpdate:()=>{this.renderManager.draw()}}).mount(container),next()}completed(){}rollback(data){return data}revokeRollback(data){return this.completed(),data}}class DrawBalconyRailing extends DrawLine{static name="DrawBalconyRailing";static withdrawalKeys=["Control","Z"];static shortcutKeys=["B"];static commandName="DrawBalconyRailing";end(next,points){const lines=[];for(let i=0;i<points.length;i+=2)lines.push(new LineSegment(Point.from(points[i]),Point.from(points[i+1])));lines.forEach(line2=>{if(this.renderManager.dxf.options.publicInfo?.rootTopContourInfo){const rooftopPz=HeightQuery.query(line2,this.renderManager.dxf.options.publicInfo?.rootTopContourInfo);line2.userData.rooftopPz=rooftopPz,line2.userData.isBalconyRailing=!0,line2.userData.height=1}}),ElMessage({message:"绘制完成",type:"success"}),next(lines)}}const _hoisted_1$1={key:0,class:"max-w-[150px] min-w-[150px p-[5px] editorToolContent"},_hoisted_2={class:"text-[14px] flex flex-col"},_hoisted_3=["onClick"],_hoisted_4={class:"flex flex-row items-center"},_hoisted_5={class:"flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]"},_hoisted_6=["src"],_hoisted_7={class:"text-wrap"},_hoisted_8={key:0,class:"flex items-center gap-[5px]"},_hoisted_9={key:1,class:"text-[#999]"},_hoisted_10={style:{"--el-color-primary":"var(--primary-color)"},class:"flex flex-row items-center justify-between gap-0 mt-[10px] text-[10px]"},_hoisted_11={class:"flex-wrap border-t border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]"},_hoisted_12=["onClick","title"],_hoisted_13=["src"],_hoisted_14={style:{"--el-color-primary":"var(--primary-color)"},class:"absolute left-0 bottom-[calc(100%+5px)] p-[0_5px] flex flex-row items-center justify-between gap-0 mt-[10px] text-[10px]"},_hoisted_15={class:"text-[14px] flex flex-row flex-wrap gap-[10px]"},_hoisted_16=["onClick"],_hoisted_17={class:"flex justify-center items-center size-[30px] bg-[#f0f0f0] rounded-[2px]"},_hoisted_18=["src"],_hoisted_19={class:"flex-wrap border-t border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]"},_hoisted_20=["onClick","title"],_hoisted_21=["src"],_hoisted_22={key:1,class:"items-end box-border pointer-events-none p-[0_5px] w-full absolute left-0 top-0 flex gap-[5px]"},_hoisted_23={class:"text-white rounded-[6px] p-[5px] text-nowrap"},_sfc_main$1=/* @__PURE__ */defineComponent({__name:"EditorToolContent",props:{dxfSystem:{},permission:{}},setup(__props){function startCurrentCommandItem(item){currentCommand.value!==item.command&&("default"!==currentCommand.value&&editor.commandManager.cancel(),setTimeout(()=>editor.commandManager.start(item.command)))}async function selectLocalFile(){const data=await SelectLocalFile.json();Array.isArray(data)&&(localStorage.removeItem("orbitControls"),function(lines){if(lines){localStorage.setItem("lines",JSON.stringify(lines));try{dxfSystem.Dxf.set(lines)}catch(error){console.log(error)}}}(data))}function ringTest(){if(1!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择一条线段"});const manager=dxfSystem.findComponentByType(RenderManager),line2=defaultComponent.selectLines[0];let lines=manager.lines;const miniCircles=new MiniCircles;miniCircles.debug.angle=!0,miniCircles.miniCircle(lines,{circleEdges:[line2]}).circles.forEach(lines2=>{drawLines(lines2,{color:randomColor()})})}function angleTest(){if(2!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择两条线段"});const line1=defaultComponent.selectLines[0],line2=defaultComponent.selectLines[1];console.log(line1.angle(line2,{unit:"degree",range:"180"}))}function intersectionTest(){if(2!==defaultComponent.selectLines.length)return void ElMessage.warning({message:"请选择两条线段"});const line1=defaultComponent.selectLines[0],line2=defaultComponent.selectLines[1],point=line1.getIntersection(line2);point?drawPoint(point):ElMessage.warning({message:"没有交点"})}function commandConfirm(){variable.set("currentKeyDown","enter"),queueMicrotask(()=>variable.set("currentKeyUp","enter"))}const props=__props,dxfVisible=ref(!0),currentCommand=ref(""),dxfSystem=toRaw(props.dxfSystem),isPc=computed(()=>!isMobileRef.value),domEventRegister=dxfSystem.findComponentByType(DomEventRegister),domContainer=dxfSystem.findComponentByType(DomContainer),editor=dxfSystem.findComponentByType(Editor),defaultComponent=dxfSystem.findComponentByType(DefaultCommand),whiteModel=dxfSystem.findComponentByType(WhiteModel),threeVJia=dxfSystem.findComponentByType(ThreeVJia),variable=dxfSystem.findComponentByType(Variable),drawLine=dxfSystem.findComponentByType(DrawLine),rollbackCount=ref(0),revokeRollbackCount=ref(0),drawLineCount=ref(0),images=/* @__PURE__ */Object.assign({"../assets/images/VerticalCorr.svg":__vite_glob_0_0,"../assets/images/VerticalCorrContinue.svg":__vite_glob_0_1,"../assets/images/angle.svg":__vite_glob_0_2,"../assets/images/close.svg":__vite_glob_0_3,"../assets/images/connection.svg":__vite_glob_0_4,"../assets/images/cutLine.svg":__vite_glob_0_5,"../assets/images/deleteSelectLine.svg":__vite_glob_0_6,"../assets/images/deleteSelectWindow.svg":__vite_glob_0_7,"../assets/images/door.svg":__vite_glob_0_8,"../assets/images/dxf.svg":__vite_glob_0_9,"../assets/images/intersectionConnection.svg":__vite_glob_0_10,"../assets/images/line.svg":__vite_glob_0_11,"../assets/images/mergeLine.svg":__vite_glob_0_12,"../assets/images/revokeRollback.svg":__vite_glob_0_13,"../assets/images/rollback.svg":__vite_glob_0_14,"../assets/images/selectAll.svg":__vite_glob_0_15,"../assets/images/selectPoint.svg":__vite_glob_0_16,"../assets/images/verticalLine.svg":__vite_glob_0_17,"../assets/images/window.svg":__vite_glob_0_18,"../assets/images/垭口.svg":__vite_glob_0_19,"../assets/images/属性面板.svg":__vite_glob_0_20,"../assets/images/栏杆.svg":__vite_glob_0_21,"../assets/images/激光测距.svg":__vite_glob_0_22}),selectLineCount=ref(0),selectWinLineCount=ref(0),hasWindowLine=ref(!1),commandList=[{command:"default",name:"默认",show:!1,shortcut:""},{command:"draw-line",name:"绘制线段",src:images["../assets/images/line.svg"].default,show:!0,shortcut:DrawLine.shortcutKeys.join(" + "),confirm:computed(()=>drawLineCount.value>0)},{command:"draw-door-line",name:"绘制门线",show:!0,src:images["../assets/images/door.svg"].default,shortcut:DrawDoorLine.shortcutKeys.join(" + ")},{command:"draw-window-line",name:"绘制窗户线",show:!0,src:images["../assets/images/window.svg"].default,shortcut:DrawWindow.shortcutKeys.join(" + ")},{command:DrawHole.commandName,name:"绘制垭口",show:!0,src:images["../assets/images/垭口.svg"].default,shortcut:DrawHole.shortcutKeys.join(" + ")},{command:DrawBalconyRailing.commandName,name:"绘制栏杆",src:images["../assets/images/栏杆.svg"].default,show:!0,shortcut:DrawBalconyRailing.shortcutKeys.join(" + "),confirm:computed(()=>drawLineCount.value>0)},{command:"point",name:"修改模式",show:!0,src:images["../assets/images/selectPoint.svg"].default,shortcut:PointDrag.shortcutKeys.join(" + ")},{command:ClippingLine.commandName,name:"裁剪线段",show:!0,src:images["../assets/images/cutLine.svg"].default,shortcut:ClippingLine.shortcutKeys.join(" + ")},{command:ManualDistance.commandName,name:"手动测距",show:!0,src:images["../assets/images/激光测距.svg"].default,shortcut:ManualDistance.shortcutKeys.join(" + ")},{command:RayDistance.commandName,name:"射线测距",show:!0,src:images["../assets/images/激光测距.svg"].default,shortcut:RayDistance.shortcutKeys.join(" + ")}],otherCommandList=[{command:"",name:"操作回滚",src:images["../assets/images/rollback.svg"].default,disabled:computed(()=>0!==rollbackCount.value),shortcut:"Ctrl + Z",action(){editor.commandManager.rollback()}},{command:"",name:"撤销操作回滚",src:images["../assets/images/revokeRollback.svg"].default,disabled:computed(()=>0!==revokeRollbackCount.value),shortcut:"Ctrl + Y",class:"rotateY-[180deg]",action(){editor.commandManager.revokeRollback()}},{command:MergeLine.commandName,name:"合并",src:images["../assets/images/mergeLine.svg"].default,show:computed(()=>!isMobileRef.value),disabled:computed(()=>selectLineCount.value>=2),shortcut:MergeLine.shortcutKeys.join(" + ")},{command:TwoPointConnection.commandName,name:"两点连接",disabled:computed(()=>2===selectLineCount.value),show:computed(()=>!isMobileRef.value),src:images["../assets/images/connection.svg"].default,shortcut:TwoPointConnection.shortcutKeys.join(" + ")},{command:TwoLineConnectionLine.commandName,name:"两线连接",disabled:computed(()=>2===selectLineCount.value),show:computed(()=>!isMobileRef.value),src:images["../assets/images/intersectionConnection.svg"].default,shortcut:TwoLineConnectionLine.shortcutKeys.join(" + ")},{command:VerticalCorr.commandName,name:"垂直纠正",disabled:computed(()=>1===selectLineCount.value),src:images["../assets/images/VerticalCorr.svg"].default,shortcut:VerticalCorr.shortcutKeys.join(" + ")},{command:VerticalCorrContinue.commandName,name:"连续垂直纠正",disabled:computed(()=>1===selectLineCount.value),src:images["../assets/images/VerticalCorrContinue.svg"].default,shortcut:VerticalCorrContinue.shortcutKeys.join(" + ")},{command:ViewAngle.commandName,name:"角度显示",disabled:computed(()=>2===selectLineCount.value&&defaultComponent.selectLines[0].isSameEndpoint(defaultComponent.selectLines[1])),show:computed(()=>!isMobileRef.value),src:images["../assets/images/angle.svg"].default,shortcut:ViewAngle.shortcutKeys.join(" + ")},{command:SelectAll.commandName,name:"全选",disabled:computed(()=>selectLineCount.value!==editor.renderManager.lines.length),src:images["../assets/images/selectAll.svg"].default,shortcut:SelectAll.shortcutKeys.join(" + ")},{command:DeleteSelectLine.commandName,name:"删除",disabled:computed(()=>selectLineCount.value>0||selectWinLineCount.value>0),src:images["../assets/images/deleteSelectLine.svg"].default,shortcut:DeleteSelectLine.shortcutKeys.join(" + "),action(){editor.commandManager.start(DeleteSelectLine.commandName,defaultComponent.getSelectData())}},{command:PropertiesPanel.commandName,name:"属性面板",disabled:computed(()=>!0),src:images["../assets/images/属性面板.svg"].default,shortcut:PropertiesPanel.shortcutKeys.join(" + "),action(){variable.set("currentKeyDown","i"),queueMicrotask(()=>variable.set("currentKeyUp","i"))}}],currentMainCommand=computed(()=>commandList.find(item=>currentCommand.value===item.command)),isMainCommand=computed(()=>commandList.findIndex(item=>item.command===currentCommand.value&&"default"!==item.command)>-1),z=ref(0),showConfirm=ref(!1);watch(dxfVisible,()=>{localStorage.setItem("dxfVisible",dxfVisible.value+""),dxfSystem.Variable.set("dxfVisible",dxfVisible.value)}),watch(z,v=>{dxfSystem.Dxf.originalZAverage=Number(v)});let cancelWatch=null;return dxfSystem.addEventRecord("EditorToolContent",dxfSystem.Variable.addEventListener("dxfVisible",e=>dxfVisible.value=e.value),drawLine.addEventListener("appendLine",e=>drawLineCount.value=e.points.length),dxfSystem.Dxf.addEventListener("dataChange",()=>{z.value=dxfSystem.Dxf.originalZAverage}),defaultComponent.addEventListener("selectLineChange",()=>{selectLineCount.value=defaultComponent.selectLines.length,hasWindowLine.value=defaultComponent.selectLines.some(l=>l.userData.isWindow)}),defaultComponent.addEventListener("selectWinLineChange",()=>{selectWinLineCount.value=defaultComponent.selectHoleLine?1:0}),...["rollback","completed","revokeRollback"].map(key=>editor.commandManager.addEventListener(key,()=>{setTimeout(()=>{rollbackCount.value=editor.commandManager.operationList.length,revokeRollbackCount.value=editor.commandManager.rollbackList.length})})),editor.commandManager.addEventListener("started",e=>{currentCommand.value=e.name,drawLineCount.value=0}),editor.commandManager.addEventListener("executing",e=>{const commandFlow=editor.commandManager.getCommandFlow(e.name),data=commandFlow.getData(commandFlow.currentIndex);cancelWatch&&(cancelWatch(),cancelWatch=null),isRef(data.showConfirm)?(cancelWatch=watch(data.showConfirm,b=>showConfirm.value=b),showConfirm.value=data.showConfirm.value):showConfirm.value=!!data.showConfirm})),onMounted(()=>{localStorage.getItem("dxfVisible")&&(dxfVisible.value="true"==localStorage.getItem("dxfVisible"))}),onUnmounted(()=>{cancelWatch&&cancelWatch(),domEventRegister.mouseMoveEventProxylock=!1,dxfSystem.cancelEventRecord("EditorToolContent")}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[isPc.value?(openBlock(),createElementBlock("div",_hoisted_1$1,[createElementVNode("ul",_hoisted_2,[(openBlock(),createElementBlock(Fragment,null,renderList(commandList,item=>(openBlock(),createElementBlock(Fragment,{key:item.command},[item.show?(openBlock(),createElementBlock("li",{key:0,onClick:$event=>startCurrentCommandItem(item),class:normalizeClass([{"bg-(--primary-color)! text-white":currentCommand.value===item.command},"gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])},[createElementVNode("div",_hoisted_4,[createElementVNode("div",_hoisted_5,[createElementVNode("img",{class:"size-[14px]",src:item.src,alt:"",srcset:""},null,8,_hoisted_6)]),createElementVNode("span",_hoisted_7,toDisplayString(item.name),1)]),currentCommand.value===item.command?(openBlock(),createElementBlock("div",_hoisted_8,[createElementVNode("div",{title:"取消命令(Esc)",class:"active:scale-[0.7] transition-all flex items-center justify-center",onClick:_cache[0]||(_cache[0]=e=>(unref(editor).cancelCommand(),e.stopPropagation()))},[..._cache[26]||(_cache[26]=[createElementVNode("svg",{fill:"#fff",width:"16",height:"16",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[createElementVNode("path",{d:"M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z"}),createElementVNode("path",{d:"M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z"})],-1)])]),item.confirm?.value?(openBlock(),createElementBlock("div",{key:0,onClick:commandConfirm,title:"确认命令(Enter)",class:"active:scale-[0.7] transition-all flex items-center justify-center"},[..._cache[27]||(_cache[27]=[createElementVNode("svg",{fill:"#fff",width:"16",height:"16",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[createElementVNode("path",{d:"M512 1024c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384-172.8-384-384-384z m-12.8 556.8c-12.8 12.8-32 19.2-51.2 19.2-19.2 0-38.4-6.4-51.2-19.2L275.2 569.6c-25.6-25.6-25.6-70.4 0-96 25.6-25.6 70.4-25.6 96 0L448 544l198.4-204.8c25.6-25.6 70.4-25.6 96 0 25.6 25.6 25.6 70.4 0 96l-243.2 249.6z"})],-1)])])):createCommentVNode("",!0)])):item.shortcut?(openBlock(),createElementBlock("div",_hoisted_9,toDisplayString(item.shortcut),1)):createCommentVNode("",!0)],10,_hoisted_3)):createCommentVNode("",!0)],64))),64))]),createElementVNode("div",_hoisted_10,[createVNode(unref(ElCheckbox),{size:"small",modelValue:dxfVisible.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>dxfVisible.value=$event)},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode("Dxf",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{size:"small",modelValue:unref(editor).renderManager.lineAdsorption.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>unref(editor).renderManager.lineAdsorption.value=$event)},{default:withCtx(()=>[..._cache[29]||(_cache[29]=[createTextVNode("线吸附",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{disabled:!unref(editor).renderManager.lineAdsorption.value,size:"small",modelValue:unref(editor).renderManager.pointAdsorption.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>unref(editor).renderManager.pointAdsorption.value=$event)},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode("点吸附",-1)])]),_:1},8,["disabled","modelValue"])]),createVNode(Transition,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_11,[createVNode(TransitionGroup,null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(otherCommandList,item=>withDirectives(createElementVNode("div",{onClick:$event=>item.disabled.value&&"default"===currentCommand.value&&(item.action?item.action():unref(editor).commandManager.start(item.command,[...unref(defaultComponent).selectLines])),title:`${item.name}(${item.shortcut})`,class:normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border border-[#ccc] rounded-[4px] transition-all cursor-pointer",{"opacity-30 bg-[#ccc] cursor-no-drop! active:scale-[1]!":!item.disabled.value||"default"!==currentCommand.value,[item.class??""]:!0}]),key:item.command},[createElementVNode("img",{class:"size-[14px]",src:item.src},null,8,_hoisted_13)],10,_hoisted_12),[[vShow,!(!1===item.show?.value)]])),64))]),_:1})])]),_:1}),"admin"===__props.permission?(openBlock(),createBlock(unref(ElDropdown),{key:0,trigger:"hover",style:{width:"100%"},placement:"right-end"},{dropdown:withCtx(()=>[createVNode(unref(ElDropdownMenu),null,{default:withCtx(()=>[createVNode(unref(ElDropdownItem),{onClick:selectLocalFile},{default:withCtx(()=>[..._cache[32]||(_cache[32]=[createTextVNode(" 选择文件 ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[4]||(_cache[4]=$event=>unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))},{default:withCtx(()=>[..._cache[33]||(_cache[33]=[createTextVNode(" 下载Json ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[5]||(_cache[5]=$event=>unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))},{default:withCtx(()=>[..._cache[34]||(_cache[34]=[createTextVNode(" 下载DXF ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[6]||(_cache[6]=$event=>unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))},{default:withCtx(()=>[..._cache[35]||(_cache[35]=[createTextVNode(" 下载JPG ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[7]||(_cache[7]=$event=>unref(whiteModel).downloadGltf("test.glb",!0))},{default:withCtx(()=>[..._cache[36]||(_cache[36]=[createTextVNode(" 下载白膜 ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),{onClick:_cache[8]||(_cache[8]=$event=>unref(threeVJia).download())},{default:withCtx(()=>[..._cache[37]||(_cache[37]=[createTextVNode(" 下载三维家JSON ",-1)])]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>["admin"===__props.permission?(openBlock(),createBlock(unref(ElDropdown),{key:0,trigger:"hover",style:{width:"100%",outline:"unset"},placement:"right-end"},{dropdown:withCtx(()=>[createVNode(unref(ElInput),{modelValue:z.value,"onUpdate:modelValue":_cache[9]||(_cache[9]=$event=>z.value=$event),placeholder:"z",type:"number"},null,8,["modelValue"])]),default:withCtx(()=>[_cache[38]||(_cache[38]=createElementVNode("div",{class:"w-full"},"z值调整",-1))]),_:1})):createCommentVNode("",!0)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[10]||(_cache[10]=withModifiers(()=>{},["stop"])),onClick:_cache[11]||(_cache[11]=$event=>console.log("选中线段:",unref(defaultComponent).selectLines,"选中窗户:",unref(defaultComponent).selectHoleLine))},"打印选中",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[12]||(_cache[12]=withModifiers(()=>{},["stop"])),onClick:withModifiers(ringTest,["stop","prevent"])},"回环测试",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[13]||(_cache[13]=withModifiers(()=>{},["stop"])),onClick:withModifiers(angleTest,["stop","prevent"])},"角度测试",32)]),_:1}),createVNode(unref(ElDropdownItem),null,{default:withCtx(()=>[createElementVNode("div",{class:"w-full",onMousedown:_cache[14]||(_cache[14]=withModifiers(()=>{},["stop"])),onClick:withModifiers(intersectionTest,["stop","prevent"])},"交点测试",32)]),_:1})]),_:1})]),default:withCtx(()=>[createVNode(unref(ElButton),{size:"small",class:"mt-[10px] w-full"},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode("其他功能",-1)])]),_:1})]),_:1})):createCommentVNode("",!0)])):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([{"translate-y-full":isMainCommand.value},"z-8 absolute left-0 bottom-0 transition-transform w-full bg-white p-[5px] box-border text-[14px]"]),onMousedown:_cache[18]||(_cache[18]=e=>e.stopPropagation()),onPointerdown:_cache[19]||(_cache[19]=e=>e.stopPropagation())},[createElementVNode("div",_hoisted_14,[createVNode(unref(ElCheckbox),{size:"small",modelValue:dxfVisible.value,"onUpdate:modelValue":_cache[15]||(_cache[15]=$event=>dxfVisible.value=$event)},{default:withCtx(()=>[..._cache[39]||(_cache[39]=[createTextVNode("Dxf",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{size:"small",modelValue:unref(editor).renderManager.lineAdsorption.value,"onUpdate:modelValue":_cache[16]||(_cache[16]=$event=>unref(editor).renderManager.lineAdsorption.value=$event)},{default:withCtx(()=>[..._cache[40]||(_cache[40]=[createTextVNode("线吸附",-1)])]),_:1},8,["modelValue"]),createVNode(unref(ElCheckbox),{disabled:!unref(editor).renderManager.lineAdsorption.value,size:"small",modelValue:unref(editor).renderManager.pointAdsorption.value,"onUpdate:modelValue":_cache[17]||(_cache[17]=$event=>unref(editor).renderManager.pointAdsorption.value=$event)},{default:withCtx(()=>[..._cache[41]||(_cache[41]=[createTextVNode("点吸附",-1)])]),_:1},8,["disabled","modelValue"])]),createElementVNode("ul",_hoisted_15,[(openBlock(),createElementBlock(Fragment,null,renderList(commandList,item=>(openBlock(),createElementBlock(Fragment,{key:item.command},[item.show?(openBlock(),createElementBlock("li",{key:0,onClick:$event=>startCurrentCommandItem(item),class:normalizeClass([{"bg-(--primary-color)!":currentCommand.value===item.command},"gap-[10px] relative hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])},[createElementVNode("div",_hoisted_17,[createElementVNode("img",{class:"size-[20px]",src:item.src,alt:"",srcset:""},null,8,_hoisted_18)])],10,_hoisted_16)):createCommentVNode("",!0)],64))),64))]),createElementVNode("div",_hoisted_19,[createVNode(TransitionGroup,null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(otherCommandList,item=>withDirectives(createElementVNode("div",{onClick:$event=>item.disabled.value&&"default"===currentCommand.value&&(item.action?item.action():unref(editor).commandManager.start(item.command,[...unref(defaultComponent).selectLines])),title:`${item.name}(${item.shortcut})`,class:normalizeClass(["size-[28px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border rounded-[4px] transition-all cursor-pointer",{"opacity-30 bg-[#ccc] cursor-no-drop! active:scale-[1]!":!item.disabled.value||"default"!==currentCommand.value,[item.class??""]:!0}]),key:item.command},[createElementVNode("img",{class:"size-[20px]",src:item.src},null,8,_hoisted_21)],10,_hoisted_20),[[vShow,!(!1===item.show?.value)]])),64))]),_:1})])],34)),(openBlock(),createBlock(Teleport,{to:unref(domContainer).dialogLayer},[isMainCommand.value?(openBlock(),createElementBlock("div",{key:0,onMousemove:_cache[21]||(_cache[21]=e=>e.stopPropagation()),onClick:_cache[22]||(_cache[22]=withModifiers(()=>{},["stop"])),onPointerdown:_cache[23]||(_cache[23]=withModifiers(()=>{},["stop"])),onPointermove:_cache[24]||(_cache[24]=withModifiers(()=>{},["stop"])),onMousedown:_cache[25]||(_cache[25]=withModifiers(()=>{},["stop"])),class:"cursor-pointer z-8 box-border bg-[rgba(0,0,0,0.5)] rounded-[6px] p-[5px] absolute left-[50%] translate-x-[-50%] top-[20px] flex gap-[5px] items-center"},[createElementVNode("button",{onClick:_cache[20]||(_cache[20]=withModifiers(e=>(unref(editor).cancelCommand(),e.stopPropagation()),["stop"])),class:"bg-transparent! button cursor-pointer"},[..._cache[42]||(_cache[42]=[createElementVNode("svg",{fill:"#fff",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},[createElementVNode("path",{d:"M952.532295 495.269967 767.686357 310.423005c-9.060353-9.060353-23.75196-9.060353-32.81743 0l-37.363979 37.362956c-9.060353 9.060353-9.060353 23.757077 0 32.81743l81.538061 81.538061L407.384337 462.141452c-12.812817 0-23.199375 10.386558-23.199375 23.199375l0 52.845579c0 12.815887 10.386558 23.204491 23.199375 23.204491l371.479593 0-81.538061 81.538061c-9.060353 9.060353-9.060353 23.757077 0 32.81743l37.368072 37.363979c9.060353 9.05933 23.75503 9.05933 32.815383 0l147.653875-147.653875c0-0.005117 0.005117-0.005117 0.005117-0.005117l37.368072-37.368072C961.592648 519.020904 961.592648 504.33032 952.532295 495.269967L952.532295 495.269967zM634.083499 64.754816l-499.803213 0c-38.441521 0-69.608358 31.166837-69.608358 69.608358l0 754.806002c0 38.446637 31.166837 69.608358 69.608358 69.608358l499.803213 0c38.441521 0 69.608358-31.16172 69.608358-69.608358l0-97.937566c0-12.811794-10.386558-23.204491-23.204491-23.204491l-50.29243 0c-12.812817 0-23.205515 10.392698-23.205515 23.204491l0 37.257555c0 34.328853 0 34.328853-34.791387 34.328853L195.199751 862.818017c-34.801621 0-34.801621 0.00614-34.801621-34.806737L160.39813 194.712657c0-34.900881-0.074701-34.802644 34.801621-34.802644l376.99726 0c34.798551 0 34.791387 0.285502 34.791387 34.329876l0 38.353516c0 12.815887 10.392698 23.204491 23.205515 23.204491l50.29243 0c12.817933 0 23.204491-10.388605 23.204491-23.204491L703.690834 134.363174C703.691857 95.921653 672.52502 64.754816 634.083499 64.754816L634.083499 64.754816zM634.083499 64.754816"})],-1)])]),showConfirm.value?(openBlock(),createElementBlock("button",{key:0,onClick:withModifiers(commandConfirm,["stop"]),class:"button bg-transparent! cursor-pointer"},[..._cache[43]||(_cache[43]=[createElementVNode("svg",{fill:"#28c932",viewBox:"0 0 1026 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},[createElementVNode("path",{d:"M79.288 400c19.2 0 38.4 9.6 54.4 25.6l240 249.6c12.8 16 19.2 16 35.2 0 147.2-153.6 294.4-304 441.6-457.6 16-16 32-35.2 48-51.2 28.8-28.8 70.4-32 99.2-6.4 32 25.6 38.4 73.6 9.6 105.6-32 38.4-67.2 73.6-102.4 108.8-150.4 156.8-300.8 313.6-454.4 470.4-38.4 38.4-80 41.6-115.2 6.4-105.6-108.8-211.2-217.6-313.6-326.4-22.4-25.6-28.8-54.4-12.8-83.2 12.8-25.6 35.2-41.6 70.4-41.6z"})],-1)])])):createCommentVNode("",!0)],32)):createCommentVNode("",!0),isMainCommand.value&¤tMainCommand.value?(openBlock(),createElementBlock("div",_hoisted_22,[createElementVNode("div",_hoisted_23,toDisplayString(currentMainCommand.value.name),1)])):createCommentVNode("",!0)],8,["to"]))],64))}}),EditorToolContent=/* @__PURE__ */_export_sfc(_sfc_main$1,[["__scopeId","data-v-a092e898"]]);class StorageHelper{static get(key,defaultValue=void 0){const value=localStorage.getItem(key);return void 0===value?defaultValue:value}static getBoolean(key,defaultValue=!1){return"true"===this.get(key,defaultValue?"true":"false")}static getNumber(key,defaultValue=0){const v=this.get(key,defaultValue);return"number"==typeof v?v:Number(v)}static getJson(key,defaultValue){const v=this.get(key,defaultValue);try{if(v)return JSON.parse(v)}catch(error){}return defaultValue}static set(key,vaalue){localStorage.setItem(key,String(vaalue))}static setJson(key,value){this.set(key,JSON.stringify(value))}}const _hoisted_1=["innerHTML"],_sfc_main=/* @__PURE__ */defineComponent({__name:"EditorTool",props:{dxfSystem:{},permission:{}},setup(__props){const props=__props,isPc=computed(()=>!isMobileRef.value),toolBarExpand=ref(StorageHelper.getBoolean("toolBarExpand",!0)),promptMessage=ref(),editor=props.dxfSystem.findComponentByType(Editor);return watch(toolBarExpand,()=>{localStorage.setItem("toolBarExpand",toolBarExpand.value+"")}),editor.commandManager.addEventListener("executing",e=>{const commandFlow=editor.commandManager.getCommandFlow(e.name),data=commandFlow.getData(commandFlow.currentIndex);promptMessage.value=data.prompt}),(_ctx,_cache)=>isPc.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(_sfc_main$7,{showTitle:isPc.value,showContent:toolBarExpand.value,"onUpdate:showContent":_cache[0]||(_cache[0]=$event=>toolBarExpand.value=$event),title:"控制面板",name:"PropertiesPanel",style:{"z-index":"9"},onClickIcon:_cache[1]||(_cache[1]=$event=>toolBarExpand.value=!toolBarExpand.value)},{icon:withCtx(()=>[(openBlock(),createElementBlock("svg",{fill:"#666",class:normalizeClass([{"rotate-90":toolBarExpand.value},"transition-all"]),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12"},[..._cache[2]||(_cache[2]=[createElementVNode("path",{d:"M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z"},null,-1)])],2))]),default:withCtx(()=>[toolBarExpand.value?(openBlock(),createBlock(EditorToolContent,{key:0,dxfSystem:__props.dxfSystem,permission:__props.permission},null,8,["dxfSystem","permission"])):createCommentVNode("",!0)]),_:1},8,["showTitle","showContent"]),promptMessage.value?(openBlock(),createElementBlock("div",{key:0,innerHTML:promptMessage.value,class:"text-white pointer-events-none z-8 text-[12px] absolute left-[20px] bottom-[20px] rounded-[8px] min-w-[150px] bg-white/15 p-[10px]"},null,8,_hoisted_1)):createCommentVNode("",!0)],64)):(openBlock(),createBlock(EditorToolContent,{key:1,dxfSystem:__props.dxfSystem,permission:__props.permission},null,8,["dxfSystem","permission"]))}});class Editor extends Component{static name="Editor";container=new THREE.Group;get renderer(){return this.parent?.findComponentByName("Renderer")}get dxf(){return this.parent?.findComponentByName("Dxf")}get variable(){return this.parent?.findComponentByName("Variable")}get eventInput(){return this.parent?.findComponentByName("EventInput")}get renderManager(){return this.parent?.findComponentByName("RenderManager")}get domEventRegister(){return this.parent?.findComponentByName("DomEventRegister")}get domContainer(){return this.parent?.findComponentByName("DomContainer")}commandManager=new CommandManager;plane=new THREE.Mesh(new THREE.PlaneGeometry(2e3,2e3,2,2));app;domElement=document.createElement("div");viewPermission;imgEl=document.createElement("img");imgWidth=80;constructor(viewPermission){super(),this.viewPermission=viewPermission,Object.assign(this.imgEl.style,{position:"absolute",left:"5px",top:"5px",width:`${this.imgWidth}px`,height:`${this.imgWidth}px`,borderRadius:"10px",objectFit:"contain",background:"rgba(255,255,255,0.2)",pointerEvents:"none",cursor:"pointer",transition:"all 0.25s"}),this.imgEl.addEventListener("mousedown",e=>e.stopPropagation()),this.imgEl.addEventListener("mouseup",e=>e.stopPropagation()),this.imgEl.addEventListener("mousemove",e=>e.stopPropagation()),this.imgEl.draggable=!1}onAddFromParent(parent2){setTimeout(()=>this.openEdit(),10);const grid=new THREE.GridHelper(200,100,6710886,4473924);grid.rotation.x=.5*Math.PI,grid.position.z=-.01,this.container.add(grid),this.container.add(this.plane),this.plane.visible=!1;const cancelEvent=this.addEventListener("update",()=>{this.domContainer.dialogLayer.appendChild(this.domElement),isMobileRef.value||this.domContainer.dialogLayer.appendChild(this.imgEl),cancelEvent()});setTimeout(()=>{this.app=createApp(_sfc_main,{dxfSystem:this.parent,permission:this.viewPermission}),this.app.mount(this.domElement)}),parent2.CorrectionDxf.addEventListener("cadChange",async()=>{this.imgEl.src&&URL.revokeObjectURL(this.imgEl.src),setTimeout(async()=>{this.imgEl.src=URL.createObjectURL(await parent2.CorrectionDxf.toDxfImageBlob("Centimeters","image/png","transparent"))})}),this.domEventRegister.addEventListener("mousedown",e=>{e.x<this.imgWidth+10&&e.x>10&&e.y<this.imgWidth&&e.y>10&&Object.assign(this.imgEl.style,{width:`${Math.min(10*this.imgWidth,.9*this.renderer.width)}px`,height:`${Math.min(10*this.imgWidth,.9*this.renderer.height)}px`,background:"rgba(0,0,0,1)",zIndex:100})}),this.domEventRegister.addEventListener("mousemove",e=>{e.x<this.imgWidth+10&&e.x>10&&e.y<this.imgWidth&&e.y>10||Object.assign(this.imgEl.style,{width:`${this.imgWidth}px`,height:`${this.imgWidth}px`,background:"rgba(255,255,255,0.2)",zIndex:0})})}cancelCommand(){this.dispatchEvent({type:"cancelCommand"})}coords=new THREE.Vector2;pointerPosition=new THREE.Vector2;_exitEditCallBack;openEdit(){const renderer=this.renderer,domEventRegister=this.domEventRegister,dxf2=this.dxf,orbitControls=renderer.orbitControls,camera=renderer.camera,center=dxf2.box.center,cameraPosition=renderer.camera.position.clone(),target=orbitControls?.target?.clone(),size=new THREE.Vector2,raycaster=new THREE.Raycaster,coords=this.coords,pointerPosition=this.pointerPosition;this.container.position.z=dxf2.originalZAverage,renderer.scene.add(this.container),orbitControls&&(camera.position.set(center.x,center.y,15),orbitControls.target.set(center.x,center.y,0),orbitControls.enableRotate=!1);const mousemoveFun=()=>{renderer.renderer.getSize(size);const x=domEventRegister.pointer.x/size.x*2-1,y=-(domEventRegister.pointer.y/size.y*2-1);coords.set(x,y),raycaster.setFromCamera(coords,renderer.camera.children.length?renderer.camera.children[0]:renderer.camera);const intersections=raycaster.intersectObject(this.plane);intersections.length&&(pointerPosition.copy(intersections[0].point),this.dispatchEvent({type:"pointerPositionChange",position:pointerPosition}))};isMobileRef.value||domEventRegister.addEventListener("mousemove",mousemoveFun),isMobileRef.value&&(domEventRegister.addEventListener("pointermove",mousemoveFun),domEventRegister.addEventListener("pointerdown",mousemoveFun)),this.commandManager.disabled=!1,this.commandManager.start("default"),this._exitEditCallBack=()=>{domEventRegister.removeEventListener("mousemove",mousemoveFun),orbitControls&&(camera.position.copy(cameraPosition),orbitControls.enableRotate=!0,orbitControls.target.copy(target))}}exitEdit(){"function"==typeof this._exitEditCallBack&&(this._exitEditCallBack(),this._exitEditCallBack=void 0,this.commandManager.disabled=!0)}destroy(){this.commandManager.destroy(),super.destroy(),this.exitEdit(),this.renderer.scene.remove(this.container),this.domElement.remove(),this.app?.unmount()}}function Editor_(dxfSystem,option={}){dxfSystem.addComponent(new Editor(option.viewPermission)),dxfSystem.addComponent(new RenderManager),dxfSystem.addComponent(new DefaultCommand),dxfSystem.addComponent(new DrawLine),dxfSystem.addComponent(new DrawDoorLine),dxfSystem.addComponent(new DrawWindow),dxfSystem.addComponent(new PointDrag),dxfSystem.addComponent(new DeleteSelectLine),dxfSystem.addComponent(new MergeLine),dxfSystem.addComponent(new VerticalCorr),dxfSystem.addComponent(new VerticalCorrContinue),dxfSystem.addComponent(new TwoPointConnection),dxfSystem.addComponent(new TwoLineConnectionLine),dxfSystem.addComponent(new SelectAll),dxfSystem.addComponent(new ViewAngle),dxfSystem.addComponent(new ClippingLine),dxfSystem.addComponent(new PropertiesPanel),dxfSystem.addComponent(new RayDistance),dxfSystem.addComponent(new ManualDistance),dxfSystem.addComponent(new DrawHole),dxfSystem.addComponent(new DrawBalconyRailing)}const EditorPlugin=Object.assign(Editor_,{create:(option={})=>dxfSystem=>Editor_(dxfSystem,option)});export{EditorPlugin,Editor_};
|