@snabcentr/vue-ui-lib 2.19.1 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(D,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],H):(D=typeof globalThis<"u"?globalThis:D||self,H(D.SC_VueUiLib={},D["lodash-es"],D.Vue,D["naive-ui"],D["@snabcentr/common-lib"],D["date-fns"],D["libphonenumber-js"],D["vue-tel-input"]))})(this,function(D,H,i,O,W,Sn,Wi,zh){"use strict";var Rk=Object.defineProperty;var Oh=D=>{throw TypeError(D)};var Pk=(D,H,i)=>H in D?Rk(D,H,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[H]=i;var k=(D,H,i)=>Pk(D,typeof H!="symbol"?H+"":H,i),Ih=(D,H,i)=>H.has(D)||Oh("Cannot "+i);var Ct=(D,H,i)=>(Ih(D,H,"read from private field"),i?i.call(D):H.get(D)),ha=(D,H,i)=>H.has(D)?Oh("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(D):H.set(D,i),Vh=(D,H,i,O)=>(Ih(D,H,"write to private field"),O?O.call(D,i):H.set(D,i),i);var pi,at,vs;var Ye=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ye||{});class zn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&H.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&zn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!zn.isVnodeEmpty(t()):!1}}class Ot{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Ot.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Ot.convertReferencesToOptionsList(t,n,r,s,o)}}const Lh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dh(e,t){return i.openBlock(),i.createElementBlock("svg",Lh,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)]))}const ua=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Dh}),Hh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wh(e,t){return i.openBlock(),i.createElementBlock("svg",Hh,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)]))}const fa=i.markRaw({name:"tabler-edit",render:Wh}),jh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)]))}const qh=i.markRaw({name:"fluent-pin32-regular",render:Xh}),Yh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uh(e,t){return i.openBlock(),i.createElementBlock("svg",Yh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}const Gh=i.markRaw({name:"ion-eye-outline",render:Uh}),Kh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zh(e,t){return i.openBlock(),i.createElementBlock("svg",Kh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)]))}const Jh=i.markRaw({name:"fluent-pin32-filled",render:Zh}),Qh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eu(e,t){return i.openBlock(),i.createElementBlock("svg",Qh,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)]))}const pa=i.markRaw({name:"ion-cart-outline",render:eu}),tu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nu(e,t){return i.openBlock(),i.createElementBlock("svg",tu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)]))}const iu=i.markRaw({name:"ion-bookmark-outline",render:nu}),ru={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function su(e,t){return i.openBlock(),i.createElementBlock("svg",ru,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)]))}const ou=i.markRaw({name:"ion-eye-off-sharp",render:su}),au={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lu(e,t){return i.openBlock(),i.createElementBlock("svg",au,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const cu=i.markRaw({name:"ion-chevron-forward-outline",render:lu}),du=["data-name"],hu={class:"sc-collapse-item-header flex flex-row gap-2.5"},uu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},fu={key:0},pu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gu={class:"flex flex-1 flex-col"},mu={key:0,class:"sc-collapse-item-sub-title flex-1"},_u={key:1,class:"sc-collapse-item-title-extra flex-none"},yu={key:0,class:"sc-collapse-item-content"},bu={},wu=i.defineComponent({...bu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{emit:t}){const n=e,r=t,s=i.inject("itemHeaderClickHandler",H.noop),o=i.inject("defaultExpandedNames",[]),a=i.inject("expandedNames",[]),l=H.some(o,u=>u===n.name),c=i.computed(()=>H.some(a,u=>u===n.name)),d=i.ref(l),h=()=>{n.disabled||(d.value=c.value||!d.value,r("header:click",n.name,d.value),s(n.name,d.value))};return(u,p)=>{const f=cu;return i.openBlock(),i.createElementBlock("div",{"data-name":u.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":u.disabled})},[i.createElementVNode("div",hu,[i.createElementVNode("div",uu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":d.value}),onClick:h},[i.renderSlot(u.$slots,"arrow",{},()=>[i.createVNode(f)],!0)],2)]),i.unref(zn).hasSlotContent(u.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",fu,[i.createElementVNode("div",pu,[i.renderSlot(u.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(u.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(u.title),1)],!0)]),i.unref(zn).hasSlotContent(u.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mu,[i.renderSlot(u.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(zn).hasSlotContent(u.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",_u,[i.renderSlot(u.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[c.value||d.value?(i.openBlock(),i.createElementBlock("div",yu,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,du)}}}),Ln=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ga=Ln(wu,[["__scopeId","data-v-a72ddc14"]]),vr=Symbol(),vu={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},ku={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},xu={},ma=i.defineComponent({...xu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>H.isNil(t.productContextButtonsConfig)?[]:H.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=pa,h=O.NButton,u=O.NTooltip,p=fa,f=ua,g=O.NDropdown;return i.openBlock(),i.createElementBlock("div",ku,[(i.unref(H.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(H.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Cu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Su(e,t){return i.openBlock(),i.createElementBlock("svg",Cu,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)]))}const Bu=i.markRaw({name:"tabler-history",render:Su}),Tu={class:"flex flex-row gap-1"},Eu={key:0,class:"flex flex-row text-nowrap text-sm"},$u={key:1,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Nu={},kr=i.defineComponent({...Nu,__name:"product-cost",props:{product:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(e){const t=e,n=i.computed(()=>H.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:H.get(t.product,t.costFieldName)),s=i.computed(()=>t.product.costDate?Sn.format(t.product.costDate,W.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),o=i.computed(()=>(H.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!H.isNil(r.value)),a=i.computed(()=>H.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),l=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const c=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*c)});return(c,d)=>{var f;const h=O.NTag,u=O.NTooltip,p=Bu;return i.openBlock(),i.createElementBlock("div",Tu,[c.showTag?(i.openBlock(),i.createBlock(u,{key:0},{trigger:i.withCtx(()=>[i.createVNode(h,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var g;return[i.createTextVNode(i.toDisplayString(((g=n.value)==null?void 0:g.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var g;return[i.createTextVNode(" "+i.toDisplayString(((g=n.value)==null?void 0:g.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(f=n.value)==null?void 0:f.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":o.value&&c.eventEmitter}),onClick:d[0]||(d[0]=()=>{var g;o.value&&((g=c.eventEmitter)==null||g.emit("cost:click",{product:c.product,cost:r.value}))})},i.toDisplayString(a.value),3),i.createTextVNode(" "+i.toDisplayString(c.showQuantityUnit?` ${c.product.currency}/${c.product.quantityUnit}`:""),1)],2),l.value?(i.openBlock(),i.createElementBlock("span",Eu," ~ "+i.toDisplayString(l.value)+" "+i.toDisplayString(c.showQuantityUnit?`₽/${c.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),c.showCostDate&&!i.unref(H.isNil)(s.value)?(i.openBlock(),i.createElementBlock("span",$u,[i.createTextVNode(i.toDisplayString(s.value)+" ",1),c.showPriceHistory&&c.eventEmitter?(i.openBlock(),i.createBlock(u,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"cursor-pointer",onClick:d[1]||(d[1]=g=>{var m;return(m=c.eventEmitter)==null?void 0:m.emit("cost:show-price-history",{product:c.product})})})]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Ru={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pu(e,t){return i.openBlock(),i.createElementBlock("svg",Ru,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)]))}const Cs=i.markRaw({name:"ion-information-circle-outline",render:Pu}),Fu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mu(e,t){return i.openBlock(),i.createElementBlock("svg",Fu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)]))}const _a=i.markRaw({name:"ion-images",render:Mu});/*!
1
+ (function(D,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],W):(D=typeof globalThis<"u"?globalThis:D||self,W(D.SC_VueUiLib={},D["lodash-es"],D.Vue,D["naive-ui"],D["@snabcentr/common-lib"],D["date-fns"],D["libphonenumber-js"],D["vue-tel-input"]))})(this,function(D,W,i,V,H,Sn,Wi,Lh){"use strict";var Fk=Object.defineProperty;var Oh=D=>{throw TypeError(D)};var Mk=(D,W,i)=>W in D?Fk(D,W,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[W]=i;var C=(D,W,i)=>Mk(D,typeof W!="symbol"?W+"":W,i),Ih=(D,W,i)=>W.has(D)||Oh("Cannot "+i);var Ct=(D,W,i)=>(Ih(D,W,"read from private field"),i?i.call(D):W.get(D)),ha=(D,W,i)=>W.has(D)?Oh("Cannot add the same private member more than once"):W instanceof WeakSet?W.add(D):W.set(D,i),zh=(D,W,i,V)=>(Ih(D,W,"write to private field"),V?V.call(D,i):W.set(D,i),i);var pi,at,vs;var Ye=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ye||{});class zn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&W.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&zn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!zn.isVnodeEmpty(t()):!1}}class Vt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Vt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Vt.convertReferencesToOptionsList(t,n,r,s,o)}}const Dh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hh(e,t){return i.openBlock(),i.createElementBlock("svg",Dh,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)]))}const ua=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Hh}),Wh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jh(e,t){return i.openBlock(),i.createElementBlock("svg",Wh,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)]))}const fa=i.markRaw({name:"tabler-edit",render:jh}),Xh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qh(e,t){return i.openBlock(),i.createElementBlock("svg",Xh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)]))}const Yh=i.markRaw({name:"fluent-pin32-regular",render:qh}),Uh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)]))}const Kh=i.markRaw({name:"ion-eye-outline",render:Gh}),Zh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)]))}const Qh=i.markRaw({name:"fluent-pin32-filled",render:Jh}),eu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)]))}const pa=i.markRaw({name:"ion-cart-outline",render:tu}),nu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function iu(e,t){return i.openBlock(),i.createElementBlock("svg",nu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)]))}const ru=i.markRaw({name:"ion-bookmark-outline",render:iu}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)]))}const au=i.markRaw({name:"ion-eye-off-sharp",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const du=i.markRaw({name:"ion-chevron-forward-outline",render:cu}),hu=["data-name"],uu={class:"sc-collapse-item-header flex flex-row gap-2.5"},fu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},pu={key:0},gu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},mu={class:"flex flex-1 flex-col"},_u={key:0,class:"sc-collapse-item-sub-title flex-1"},yu={key:1,class:"sc-collapse-item-title-extra flex-none"},bu={key:0,class:"sc-collapse-item-content"},wu={},vu=i.defineComponent({...wu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{emit:t}){const n=e,r=t,s=i.inject("itemHeaderClickHandler",W.noop),o=i.inject("defaultExpandedNames",[]),a=i.inject("expandedNames",[]),l=W.some(o,u=>u===n.name),c=i.computed(()=>W.some(a,u=>u===n.name)),d=i.ref(l),h=()=>{n.disabled||(d.value=c.value||!d.value,r("header:click",n.name,d.value),s(n.name,d.value))};return(u,p)=>{const f=du;return i.openBlock(),i.createElementBlock("div",{"data-name":u.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":u.disabled})},[i.createElementVNode("div",uu,[i.createElementVNode("div",fu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":d.value}),onClick:h},[i.renderSlot(u.$slots,"arrow",{},()=>[i.createVNode(f)],!0)],2)]),i.unref(zn).hasSlotContent(u.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",pu,[i.createElementVNode("div",gu,[i.renderSlot(u.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",mu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(u.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(u.title),1)],!0)]),i.unref(zn).hasSlotContent(u.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",_u,[i.renderSlot(u.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(zn).hasSlotContent(u.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",yu,[i.renderSlot(u.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[c.value||d.value?(i.openBlock(),i.createElementBlock("div",bu,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,hu)}}}),Ln=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ga=Ln(vu,[["__scopeId","data-v-a72ddc14"]]),vr=Symbol(),ku={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},xu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Cu={},ma=i.defineComponent({...Cu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>W.isNil(t.productContextButtonsConfig)?[]:W.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=pa,h=V.NButton,u=V.NTooltip,p=fa,f=ua,g=V.NDropdown;return i.openBlock(),i.createElementBlock("div",xu,[(i.unref(W.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(W.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Su={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bu(e,t){return i.openBlock(),i.createElementBlock("svg",Su,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)]))}const Tu=i.markRaw({name:"tabler-history",render:Bu}),Eu={class:"flex flex-row gap-1"},$u={key:0,class:"flex flex-row text-nowrap text-sm"},Nu={key:1,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Ru={},kr=i.defineComponent({...Ru,__name:"product-cost",props:{product:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(e){const t=e,n=i.computed(()=>W.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:W.get(t.product,t.costFieldName)),s=i.computed(()=>t.product.costDate?Sn.format(t.product.costDate,H.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),o=i.computed(()=>(W.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!W.isNil(r.value)),a=i.computed(()=>W.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),l=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const c=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*c)});return(c,d)=>{var f;const h=V.NTag,u=V.NTooltip,p=Tu;return i.openBlock(),i.createElementBlock("div",Eu,[c.showTag?(i.openBlock(),i.createBlock(u,{key:0},{trigger:i.withCtx(()=>[i.createVNode(h,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var g;return[i.createTextVNode(i.toDisplayString(((g=n.value)==null?void 0:g.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var g;return[i.createTextVNode(" "+i.toDisplayString(((g=n.value)==null?void 0:g.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(f=n.value)==null?void 0:f.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":o.value&&c.eventEmitter}),onClick:d[0]||(d[0]=()=>{var g;o.value&&((g=c.eventEmitter)==null||g.emit("cost:click",{product:c.product,cost:r.value}))})},i.toDisplayString(a.value),3),i.createTextVNode(" "+i.toDisplayString(c.showQuantityUnit?` ${c.product.currency}/${c.product.quantityUnit}`:""),1)],2),l.value?(i.openBlock(),i.createElementBlock("span",$u," ~ "+i.toDisplayString(l.value)+" "+i.toDisplayString(c.showQuantityUnit?`₽/${c.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),c.showCostDate&&!i.unref(W.isNil)(s.value)?(i.openBlock(),i.createElementBlock("span",Nu,[i.createTextVNode(i.toDisplayString(s.value)+" ",1),c.showPriceHistory&&c.eventEmitter?(i.openBlock(),i.createBlock(u,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"cursor-pointer",onClick:d[1]||(d[1]=g=>{var m;return(m=c.eventEmitter)==null?void 0:m.emit("cost:show-price-history",{product:c.product})})})]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Pu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fu(e,t){return i.openBlock(),i.createElementBlock("svg",Pu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)]))}const Cs=i.markRaw({name:"ion-information-circle-outline",render:Fu}),Mu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Au(e,t){return i.openBlock(),i.createElementBlock("svg",Mu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)]))}const _a=i.markRaw({name:"ion-images",render:Au});/*!
2
2
  * lightgallery | 2.8.3 | March 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -16,7 +16,7 @@
16
16
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
17
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
18
  PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */var xr=function(){return xr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xr.apply(this,arguments)},Au={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},ji={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},Ou=function(){function e(t,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=t,this.$LG=n,this}return e.prototype.init=function(){this.settings=xr(xr({},Au),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},e.prototype.build=function(){var t=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=t.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(t.thumbClickable&&!t.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));t.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(ji.beforeSlide+".thumb",function(n){var r=n.detail.index;t.animateThumb(r)}),this.core.LGel.on(ji.beforeOpen+".thumb",function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth}),this.core.LGel.on(ji.updateSlides+".thumb",function(){t.rebuildThumbnails()}),this.core.LGel.on(ji.containerResize+".thumb",function(){t.core.lgOpened&&setTimeout(function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth,t.animateThumb(t.core.index),t.thumbOuterWidth=t.core.outer.get().offsetWidth},50)})},e.prototype.setThumbMarkup=function(){var t="lg-thumb-outer ";this.settings.alignThumbnails&&(t+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+t+`">
19
+ ***************************************************************************** */var xr=function(){return xr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xr.apply(this,arguments)},Vu={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},ji={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},Ou=function(){function e(t,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=t,this.$LG=n,this}return e.prototype.init=function(){this.settings=xr(xr({},Vu),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},e.prototype.build=function(){var t=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=t.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(t.thumbClickable&&!t.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));t.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(ji.beforeSlide+".thumb",function(n){var r=n.detail.index;t.animateThumb(r)}),this.core.LGel.on(ji.beforeOpen+".thumb",function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth}),this.core.LGel.on(ji.updateSlides+".thumb",function(){t.rebuildThumbnails()}),this.core.LGel.on(ji.containerResize+".thumb",function(){t.core.lgOpened&&setTimeout(function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth,t.animateThumb(t.core.index),t.thumbOuterWidth=t.core.outer.get().offsetWidth},50)})},e.prototype.setThumbMarkup=function(){var t="lg-thumb-outer ";this.settings.alignThumbnails&&(t+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+t+`">
20
20
  <div class="lg-thumb lg-group">
21
21
  </div>
22
22
  </div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},e.prototype.enableThumbDrag=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){t.thumbTotalWidth>t.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,t.thumbClickable=!1,r=!0,t.core.outer.get().scrollLeft+=1,t.core.outer.get().scrollLeft-=1,t.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){t.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=t.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){t.core.lgOpened&&(n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0,r&&(r=!1,t.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},e.prototype.enableThumbSwipe=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,t.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=t.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0})},e.prototype.rebuildThumbnails=function(){var t=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){t.thumbTotalWidth=t.core.galleryItems.length*(t.settings.thumbWidth+t.settings.thumbMargin),t.$lgThumb.css("width",t.thumbTotalWidth+"px"),t.$lgThumb.empty(),t.setThumbItemHtml(t.core.galleryItems),t.animateThumb(t.core.index)},50),setTimeout(function(){t.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},e.prototype.setTranslate=function(t){this.$lgThumb.css("transform","translate3d(-"+t+"px, 0px, 0px)")},e.prototype.getPossibleTransformX=function(t){return t>this.thumbTotalWidth-this.thumbOuterWidth&&(t=this.thumbTotalWidth-this.thumbOuterWidth),t<0&&(t=0),t},e.prototype.animateThumb=function(t){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*t-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},e.prototype.onThumbTouchMove=function(t){return t.newTranslateX=this.translateX,t.isMoved=!0,t.touchMoveTime=new Date().valueOf(),t.newTranslateX-=t.cords.endX-t.cords.startX,t.newTranslateX=this.getPossibleTransformX(t.newTranslateX),this.setTranslate(t.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),t},e.prototype.onThumbTouchEnd=function(t){t.isMoved=!1,t.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=t.endTime.valueOf()-t.startTime.valueOf(),r=t.cords.endX-t.cords.startX,s=Math.abs(r)/n;return s>.15&&t.endTime.valueOf()-t.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=t.newTranslateX,Math.abs(t.cords.endX-t.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),t},e.prototype.getThumbHtml=function(t,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=t;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},e.prototype.setThumbItemHtml=function(t){for(var n=0;n<t.length;n++){var r=this.getThumbHtml(t[n].thumb,n,t[n].alt);this.$lgThumb.append(r)}},e.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},e.prototype.manageActiveClassOnSlideChange=function(){var t=this;this.core.LGel.on(ji.beforeSlide+".thumb",function(n){var r=t.core.outer.find(".lg-thumb-item"),s=n.detail.index;r.removeClass("active"),r.eq(s).addClass("active")})},e.prototype.toggleThumbBar=function(){var t=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){t.core.outer.toggleClass("lg-components-open")}))},e.prototype.thumbKeyPress=function(){var t=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(n){!t.core.lgOpened||!t.settings.toggleThumb||(n.keyCode===38?(n.preventDefault(),t.core.outer.addClass("lg-components-open")):n.keyCode===40&&(n.preventDefault(),t.core.outer.removeClass("lg-components-open")))})},e.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},e}();/*!
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Cr=function(){return Cr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Cr.apply(this,arguments)},Iu={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},dn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ss=500,Vu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Cr(Cr({},Iu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(dn.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var p=this.getPossibleSwipeDragCords(n),f,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),f=m/y,g=_/y}else{var y=(t-n)*n;f=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(f,p.minX)?f=p.minX:this.isBeyondPossibleRight(f,p.maxX)&&(f=p.maxX):t>1&&(f<p.minX?f=p.minX:f>p.maxX&&(f=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:f,y:g,scale:t}),this.left=f,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ss),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ss+50)},e.prototype.setZoomStyles=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ss+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(dn.containerResize+".zoom "+dn.rotateRight+".zoom "+dn.rotateLeft+".zoom "+dn.flipHorizontal+".zoom "+dn.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(dn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(dn.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(dn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var u=t.scale-o;t.zoomImage(t.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,p.minY)?u.y=p.minY:this.isBeyondPossibleBottom(u.y,p.maxY)&&(u.y=p.maxY)),r&&(this.isBeyondPossibleLeft(u.x,p.minX)?u.x=p.minX:this.isBeyondPossibleRight(u.x,p.maxX)&&(u.x=p.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-t.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;t&&(o=o+t*o,a=a+t*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var f=t.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var f=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,f))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,f)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var f=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target)){c=new Date,u=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var f=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var f=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,f)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const Le=class Le{static init(t){if(Le.uiConfig)throw new Error("UI provider already initialized.");Le.uiConfig=t,Le.windowResizeHandler(),window.addEventListener("resize",Le.windowResizeHandler)}static destroy(){window.removeEventListener("resize",Le.windowResizeHandler)}static getMessagesService(){return Le.getUiConfig().messagesService}static getNotificationsService(){return Le.getUiConfig().notificationsService}static getDeviceTypeByResolution(){const{deviceTypeResolutionsConfig:t}=Le.getUiConfig();return window.innerWidth<t.tablet?W.WindowResolutionEnum.phone:window.innerWidth<t.laptop?W.WindowResolutionEnum.tablet:W.WindowResolutionEnum.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return Le.setRefValueDependingOnDeviceResolution(s,t,n,r),Le.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return Le.getDeviceTypeByResolution()===W.WindowResolutionEnum.phone}static isTabletDevice(){return Le.getDeviceTypeByResolution()===W.WindowResolutionEnum.tablet}static isLaptopDevice(){return Le.getDeviceTypeByResolution()===W.WindowResolutionEnum.laptop}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(H.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";Le.getNotificationsService().error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3})}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new W.FieldValidationResultData(t.errors[o].toString(),"error"):Le.getMessagesService().error(t.errors[o].toString())}static getUiConfig(){if(!Le.uiConfig)throw new Error("UI provider is not initialized.");return Le.uiConfig}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(Le.getDeviceTypeByResolution()){case W.WindowResolutionEnum.phone:t.value=n;break;case W.WindowResolutionEnum.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){H.forEach(Le.refsDependingOnDeviceResolution,t=>{Le.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};k(Le,"uiConfig"),k(Le,"refsDependingOnDeviceResolution",[]);let _t=Le;const zu={ref:"gallery-container",class:"lightgallery-wrapper"},Lu={},ya=i.defineComponent({...Lu,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),H.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",zu,[i.renderSlot(o.$slots,"default")],512))}}),Du=["href"],Hu=["src","alt"],Wu={},ba=i.defineComponent({...Wu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Ou,Vu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(_t.getDeviceTypeByResolution()===W.WindowResolutionEnum.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=_a,p=O.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ya,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,Hu)],8,Du))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),ju={class:"flex flex-col text-sm"},Xu={},qu=i.defineComponent({...Xu,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Cs,s=O.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",ju,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.quantityUnit),1))),128))])]),_:3})}}}),Yu={class:"flex flex-row justify-between"},Uu={key:0},Gu={class:"ml-2 align-sub"},Ku={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Zu={class:"@container"},Ju={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Qu={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},ef={class:"text-sc-dark-grey"},tf={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},nf={class:"text-gray-600"},rf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},sf={key:3,class:"underline decoration-dashed"},of={key:4,class:"sc-product-pack whitespace-nowrap"},af={class:"text-gray-600"},lf={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},cf={class:"text-gray-600"},df={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},hf={key:0},uf={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},ff={},Xi=i.defineComponent({...ff,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>H.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>H.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>H.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,u)=>{var y,b,S,x,C;const p=_a,f=O.NText,g=ma,m=Cs,_=O.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Yu,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Uu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Gu,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ba,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Ku,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Zu,[i.createElementVNode("div",Ju,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",Qu,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",ef,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",tf,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",nf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(qu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",rf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",sf," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",of,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",af,i.toDisplayString((C=(x=h.product)==null?void 0:x.properties)==null?void 0:C.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",lf,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",cf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",df,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(kr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(kr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":!0,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates,"cost-field-name":"cost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",hf,[i.createElementVNode("ul",uf,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),pf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(kr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),gf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(_t.getDeviceTypeByResolution()){case W.WindowResolutionEnum.phone:case W.WindowResolutionEnum.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,currencyRates:t.currencyRates})}),t.showProductCosts&&(H.forEach(e,s=>{H.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),H.forEach(H.sortBy(r,["slug"]),s=>{n.push(pf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(kr,{product:s,costFieldName:"cost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showCostDate:!0,showPriceHistory:t.showPriceHistory,currencyRates:t.currencyRates})})),(t.showProductEditButton||!H.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ma,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},mf={key:0,class:"pt-0.5"},_f={class:"flex flex-row gap-1"},yf={key:0},bf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},wf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},vf={},kf=i.defineComponent({...vf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>{var E;return(E=t==null?void 0:t.filteredItems)==null?void 0:E[t.categoryItem.id]}),s=i.computed(()=>{var E,A;return H.isArray((E=t.categoryItem)==null?void 0:E.categories)&&((A=t.categoryItem.categories)==null?void 0:A.length)>0}),o=i.computed(()=>{var E;return H.isArray((E=t.categoryItem)==null?void 0:E.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([E,A])=>`${A} руб./${S(E)}`).join(", ")),l=i.computed(()=>H.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(E=>{var A,K;return(K=(A=r.value)==null?void 0:A.products)==null?void 0:K.includes(E.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>H.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>H.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),u=i.computed(()=>H.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>H.isNil(t.categoryContextButtonsConfig)?[]:H.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new W.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!H.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some(E=>E.id===t.categoryItem.id)),b=i.computed(()=>q.value&&_t.getDeviceTypeByResolution()===W.WindowResolutionEnum.laptop?"auto":"fixed"),S=(E,A="ru-RU")=>0 .toLocaleString(A,{style:"currency",currency:E,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),x=E=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:E})},C=(E,A)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:A,isLoadingState:g})},B=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem})},v=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem})},N=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem})},F=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem})},P=E=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:E})},q=i.ref(0),U=i.computed(()=>q.value&&o.value.length>0?gf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),M=H.debounce(()=>{q.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",M)}),window.addEventListener("resize",M),M(),(E,A)=>{const K=O.NCheckbox,R=ou,$=O.NTooltip,j=iu,z=pa,Y=O.NTag,I=Jh,V=Gh,J=O.NButton,pe=qh,ie=fa,ge=ua,re=O.NDropdown,Me=O.NDataTable,Fe=O.NAlert,Ge=O.NSpin;return i.openBlock(),i.createBlock(ga,{name:E.categoryItem.id,"data-id":E.categoryItem.id,"onHeader:click":C},{"pre-arrow":i.withCtx(()=>{var xe,Se,st;return[_.value?(i.openBlock(),i.createElementBlock("div",mf,[i.createVNode(K,{checked:y.value,"onUpdate:checked":x},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((xe=f.value)!=null&&xe.isDisabled)?(i.openBlock(),i.createBlock($,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"pt-1.5"})]),default:i.withCtx(()=>[A[1]||(A[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((Se=f.value)==null?void 0:Se.isFavorite)??!1?(i.openBlock(),i.createBlock($,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(j,{class:"pt-1.5"})]),default:i.withCtx(()=>[A[2]||(A[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((st=f.value)==null?void 0:st.isRequired)??!1?(i.openBlock(),i.createBlock($,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[A[3]||(A[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var xe,Se,st;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":E.categoryItem.isHidden,"text-gray-400":(xe=f.value)==null?void 0:xe.isDisabled})},[i.createVNode($,{disabled:!E.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E.categoryItem.name),1)]),default:i.withCtx(()=>[A[4]||(A[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:A[0]||(A[0]=i.withModifiers((...Ke)=>i.unref(H.noop)&&i.unref(H.noop)(...Ke),["prevent","stop"]))},[(Se=E.categoryItem.properties)!=null&&Se.m2Price?(i.openBlock(),i.createBlock(Y,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(E.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Y,{key:1,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((st=f.value)!=null&&st.manager)?(i.openBlock(),i.createBlock(Y,{key:2,size:i.unref(n),closable:!0,round:"",onClose:N},{default:i.withCtx(()=>[i.createVNode($,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ke,nt;return[i.createElementVNode("span",_f,[i.createVNode(I),i.createTextVNode(" "+i.toDisplayString((nt=(Ke=f.value)==null?void 0:Ke.manager)==null?void 0:nt.name),1)])]}),default:i.withCtx(()=>{var Ke,nt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((nt=(Ke=f.value)==null?void 0:Ke.manager)==null?void 0:nt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[E.showSlugs||E.showProperties?(i.openBlock(),i.createElementBlock("div",yf,[i.createElementVNode("ul",bf,[E.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:E.categoryItem.id,slug:E.categoryItem.slug},(xe,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0),E.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(E.categoryItem.properties,(xe,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var xe;return[i.createElementVNode("div",wf,[d.value?(i.openBlock(),i.createBlock($,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{size:i.unref(n),onClick:B},{default:i.withCtx(()=>{var Se;return[(Se=f.value)!=null&&Se.isDisabled?(i.openBlock(),i.createBlock(R,{key:1})):(i.openBlock(),i.createBlock(V,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Se;return[(Se=f.value)!=null&&Se.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((xe=f.value)!=null&&xe.manager)?(i.openBlock(),i.createBlock($,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{size:i.unref(n),onClick:v},{default:i.withCtx(()=>[i.createVNode(pe)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Se,st,Ke;return[(Se=f.value)!=null&&Se.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ke=(st=f.value)==null?void 0:st.manager)==null?void 0:Ke.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock($,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{ghost:!0,size:i.unref(n),type:"primary",onClick:F},{default:i.withCtx(()=>[i.createVNode(ie)]),_:1},8,["size"])]),default:i.withCtx(()=>[A[5]||(A[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(re,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:P},{default:i.withCtx(()=>[i.createVNode(J,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(ge)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(E.$slots,"default",{},()=>{var xe;return[s.value?(i.openBlock(),i.createBlock(va,{key:0,"categories-items":E.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":E.eventEmitter,"filtered-items":r.value?((xe=r.value)==null?void 0:xe.categories)??{}:void 0,"selected-categories-items":E.selectedCategoriesItems,"selected-products-items":E.selectedProductsItems,"show-slugs":E.showSlugs,"show-properties":E.showProperties,"show-product-costs":E.showProductCosts,"allow-name-click":E.allowNameClick,"allow-price-click":E.allowPriceClick,"show-price-history":E.showPriceHistory,"show-product-add-to-cart-button":E.showProductAddToCartButton,"show-product-edit-button":E.showProductEditButton,"product-context-buttons-config":E.productContextButtonsConfig,"show-hide-for-client-button":E.showHideForClientButton,"show-pin-button":E.showPinButton,"show-category-edit-button":E.showCategoryEditButton,"category-context-buttons-config":E.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Me,{key:1,columns:U.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":Se=>Se.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Fe,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(Fe,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Ge,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>A[6]||(A[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),xf=Ln(kf,[["__scopeId","data-v-56546932"]]),Cf={class:"sc-collapse flex w-full flex-col"},Sf={},wa=i.defineComponent({...Sf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",Cf,[i.renderSlot(o.$slots,"default")]))}}),Bf={},va=i.defineComponent({...Bf,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>H.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(H.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=O.NSpin,c=O.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(wa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(xf,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Tf={class:"text-sm"},Ef={class:"text-sm"},$f={},Nf=i.defineComponent({...$f,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,u,p,f,g;const n=e,r=i.ref(new W.CartItemBase(n.cartItem??new W.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(u=n.product)==null?void 0:u.properties)!=null&&p.ignoreMinCountCheck?0:(g=(f=n.product)==null?void 0:f.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,x,C,B,v,N,F;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(C=n.product)==null?void 0:C.properties)==null?void 0:B.minCount),_=(N=(v=n.product)==null?void 0:v.properties)==null?void 0:N.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(F=n.product)==null?void 0:F.unit})`:""}),a=()=>{W.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(O.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(W.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(O.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(W.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(O.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(W.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(W.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(W.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(W.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Tf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(W.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(W.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(W.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(W.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(W.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(W.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ef,"Количество должно быть кратно "+i.toDisplayString(i.unref(W.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(O.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(O.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),Rf={class:"flex flex-row gap-1"},Pf={class:"sc-client-name flex flex-col gap-1 text-base"},Ff=["href"],Mf={key:1,class:"text-sc-grey"},Af={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Of={key:0},If={key:1,class:"text-sm"},Vf={},Sr=i.defineComponent({...Vf,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Sn.format(n.client.lastLoginAt,W.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{H.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Cs,d=O.NButton,h=O.NPopover;return i.openBlock(),i.createElementBlock("div",Rf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(H.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Pf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",Mf," [ Деактивирован ] "))],8,Ff),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Af," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Of,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",If," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),zf={class:"text-base"},Lf={},ka=i.defineComponent({...Lf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",zf,i.toDisplayString(t.contragent.name),1))}}),Df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(e,t){return i.openBlock(),i.createElementBlock("svg",Df,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)]))}const Wf=i.markRaw({name:"tabler-mail",render:Hf}),jf=["href"],Xf={},qf=i.defineComponent({...Xf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Wf;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,jf)],2)}}}),Yf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uf(e,t){return i.openBlock(),i.createElementBlock("svg",Yf,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)]))}const xa=i.markRaw({name:"fa6-brands-viber",render:Uf}),Gf={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Kf=["id"],Zf=["id"],Jf=["fill"],Qf=["fill"];function ep(e,t){return i.openBlock(),i.createElementBlock("svg",Gf,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,Kf),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,Zf)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,Jf),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,Qf),t[2]||(t[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ca=i.markRaw({name:"logos-whatsapp-icon",render:ep,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),tp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},np=["id"],ip=["fill"];function rp(e,t){return i.openBlock(),i.createElementBlock("svg",tp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,np)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,ip),t[1]||(t[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Sa=i.markRaw({name:"logos-telegram",render:rp,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),sp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function op(e,t){return i.openBlock(),i.createElementBlock("svg",sp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)]))}const Ba=i.markRaw({name:"ion-call",render:op}),ap={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lp(e,t){return i.openBlock(),i.createElementBlock("svg",ap,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)]))}const cp=i.markRaw({name:"tabler-phone-call",render:lp}),dp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},hp=["href"],up=["href"],fp=["href"],pp=["href"],gp={},mp=i.defineComponent({...gp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Wi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return H.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=cp,h=Ba,u=Sa,p=Ca,f=xa;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":l.showPhoneIcon})},[l.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",dp,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(h)],8,hp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,up)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,fp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,pp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),_p={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yp(e,t){return i.openBlock(),i.createElementBlock("svg",_p,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)]))}const bp=i.markRaw({name:"mdi-envelope",render:yp}),wp={class:"flex flex-col gap-1"},vp={key:0,class:"mb-2 flex flex-col text-base"},kp={key:0,class:"text-sc-dark-grey text-sm"},xp={key:1,class:"whitespace-nowrap text-sm"},Cp={key:2,class:"whitespace-nowrap text-sm"},Sp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Bp=["href"],Tp=["href"],Ep=["href"],$p=["href"],Np=["href"],Rp={key:0,class:"flex flex-col text-base"},Pp={key:0,class:"text-sc-dark-grey text-sm"},Fp={key:1,class:"mt-2 text-sm"},Mp={key:0,class:"-mt-1"},Ap={},Op=i.defineComponent({...Ap,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Wi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return H.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Ba,u=Sa,p=Ca,f=xa,g=bp,m=O.NPopover;return i.openBlock(),i.createElementBlock("div",wp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,C;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",vp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",kp,i.toDisplayString((C=c.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",xp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Cp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Sp,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,Bp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Tp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Ep)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,$p)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Np)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,C;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Rp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Pp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=c.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",Fp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((C=c.contact)==null?void 0:C.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Mp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=c.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Ip={key:0,class:"flex w-fit items-center gap-2"},Vp={key:1,class:"flex flex-wrap gap-1"},zp={key:0},Lp={},qi=i.defineComponent({...Lp,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=O.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Ip,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Vp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",zp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Dp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hp(e,t){return i.openBlock(),i.createElementBlock("svg",Dp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)]))}const Br=i.markRaw({name:"ion-close",render:Hp}),Wp={class:"mr-3 flex flex-col gap-2"},jp=["onClick"],Xp={class:"h-full p-2"},qp={},Yp=i.defineComponent({...qp,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Br;return i.openBlock(),i.createBlock(i.unref(O.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Wp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(O.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Xp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,jp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ta=Ln(Yp,[["__scopeId","data-v-828c3059"]]),Up={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gp(e,t){return i.openBlock(),i.createElementBlock("svg",Up,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)]))}const Ea=i.markRaw({name:"ion-trash",render:Gp}),Kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zp(e,t){return i.openBlock(),i.createElementBlock("svg",Kp,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const $a=i.markRaw({name:"ion-plus",render:Zp}),Jp={class:"flex flex-col gap-4"},Qp={class:"flex flex-col gap-2"},eg={class:"mt-8 font-bold"},tg={class:"grid grow grid-cols-2 items-start gap-2"},ng={class:"flex flex-col gap-4"},ig={class:"flex gap-3"},rg={},Na=i.defineComponent({...rg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new W.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=H.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=$a,u=Ea,p=O.NInput;return i.openBlock(),i.createBlock(i.unref(O.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,m,_,y,b,S,x,C;return[i.createElementVNode("div",Jp,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(O.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Qp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,v)=>{var N,F,P,q,U,M;return i.openBlock(),i.createElementBlock("div",{key:v,class:"flex items-start gap-2"},[i.createElementVNode("div",eg,i.toDisplayString(v+1),1),i.createElementVNode("div",tg,[i.createVNode(i.unref(O.NFormItem),{label:"Ширина, мм",required:!0,feedback:((N=c.validation[`lines_widths[${v+1}]`])==null?void 0:N.feedback)||"","show-feedback":((F=c.validation[`lines_widths[${v+1}]`])==null?void 0:F.showFeedback)||!1,"validation-status":(P=c.validation[`lines_widths[${v+1}]`])==null?void 0:P.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:s.value.linesWidths[v],"onUpdate:value":[E=>s.value.linesWidths[v]=E,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:E=>E%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(O.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((q=c.validation[`lines_angles[${v+1}]`])==null?void 0:q.feedback)||"","show-feedback":((U=c.validation[`lines_angles[${v+1}]`])==null?void 0:U.showFeedback)||!1,"validation-status":(M=c.validation[`lines_angles[${v+1}]`])==null?void 0:M.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:s.value.linesAngles[v],"onUpdate:value":[E=>s.value.linesAngles[v]=E,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:E=>E%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(O.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,size:"medium",onClick:E=>r("click:add-line",v)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:E=>r("click:remove-line",v)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(O.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",ng,[i.createVNode(i.unref(O.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":((f=c.validation.length)==null?void 0:f.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":((_=c.validation.quantity)==null?void 0:_.showFeedback)||!1,feedback:((y=c.validation.quantity)==null?void 0:y.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((x=c.validation.marker)==null?void 0:x.feedback)||"","validation-status":(C=c.validation.marker)==null?void 0:C.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",ig,[i.createVNode(i.unref(O.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Ra=Object.defineProperty,sg=Object.defineProperties,og=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertySymbols,ag=Object.prototype.hasOwnProperty,lg=Object.prototype.propertyIsEnumerable,Bs=(e,t,n)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ts=(e,t)=>{for(var n in t||(t={}))ag.call(t,n)&&Bs(e,n,t[n]);if(Pa)for(var n of Pa(t))lg.call(t,n)&&Bs(e,n,t[n]);return e},Es=(e,t)=>sg(e,og(t)),Fa=(e,t)=>{for(var n in t)Ra(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Bs(e,typeof t!="symbol"?t+"":t,n),n),Ma=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},St=(e,t,n)=>(Ma(e,t,"read from private field"),n?n.call(e):t.get(e)),Aa=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},cg=(e,t,n,r)=>(Ma(e,t,"write to private field"),t.set(e,n),n),yt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return yt.shim(e),typeof t<"u"&&(yt.Image=t),yt.isHeadless=!0,e}},Oa={};Fa(Oa,{Curve:()=>vi,getAnchorsFromArcData:()=>ug,getComponentOnCubicBezier:()=>Yi,getControlPoints:()=>Ua,getCurveBoundingBox:()=>Xa,getCurveFromPoints:()=>Ya,getCurveLength:()=>ja,getReflection:()=>Rs,integrate:()=>qa,subdivide:()=>Ns});var Ia={};Fa(Ia,{HALF_PI:()=>Ze,NumArray:()=>Gt,TWO_PI:()=>ct,decomposeMatrix:()=>wi,getComputedMatrix:()=>La,getPoT:()=>Da,lerp:()=>Nt,mod:()=>Rt,setMatrix:()=>za,toFixed:()=>Re});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var Va,ct=Math.PI*2,Ze=Math.PI*.5;function wi(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function za(e){Va=e}function La(e,t){t=t&&t.identity()||new Va;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Nt(e,t,n){return n*(t-e)+e}var $s=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Da(e){let t=0;for(;$s[t]&&$s[t]<e;)t++;return $s[t]}function Rt(e,t){for(;e<0;)e+=t;return e%t}var Gt=De.Float32Array||Array,dg=Math.floor;function Re(e){return dg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var Ha={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(X.Types.change))}}},Ht=class extends X{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in Ha)Object.defineProperty(this,n,Ha[n]);this.x=e,this.y=t}static add(e,t){return new Ht(e.x+t.x,e.y+t.y)}static sub(e,t){return new Ht(e.x-t.x,e.y-t.y)}static subtract(e,t){return Ht.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(Ht.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Ht(this.x,this.y)}add(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Re(this.x),y:Re(this.y)}}rotate(e){const t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},Z=Ht;w(Z,"zero",new Ht),w(Z,"left",new Ht(-1,0)),w(Z,"right",new Ht(1,0)),w(Z,"up",new Ht(0,-1)),w(Z,"down",new Ht(0,1));var ve=class extends Z{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",ee.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in Wa)Object.defineProperty(this,d,Wa[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(X.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().copy(this)}toObject(){return{x:Re(this.x),y:Re(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Re(this.rx),ry:Re(this.ry),xAxisRotation:Re(this.xAxisRotation),largeArcFlag:Re(this.largeArcFlag),sweepFlag:Re(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Wa={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}}},hg=0,bt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return hg++}},vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Yi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ns(e,t,n,r,s,o,a,l,c){c=c||vi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Yi(p,e,n,s,a),g=Yi(p,t,r,o,l);h.push(new ve(f,g))}return h}function ja(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return qa(m,0,1,c||vi.RecursionLimit)}function Xa(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function qa(e,t,n,r){let s=vi.abscissas[r-2],o=vi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Ya(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Rt(s-1,n):Math.max(s-1,0),l=t?Rt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ua(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ua(e,t,n){const r=Z.angleBetween(e,t),s=Z.angleBetween(n,t);let o=Z.distanceBetween(e,t),a=Z.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Ze:l-=Ze,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Rs(e,t,n){return new Z(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function ug(e,t,n,r,s,o,a){const l=bt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),p=r*Math.sin(h),f=new ve(u,p);f.command=ee.line}}var Ga=Array.prototype.slice;function fg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Ga.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Ga.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!fg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:De.performance&&De.performance.now?De.performance:Date},Pt={hasEventListeners:typeof De.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),Pt},unbind:function(e,t,n,r){return Pt.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),Pt},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=De[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=De.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},ki=De.document?De.document.createElement("div"):{};ki.id="help-two-load",Object.defineProperty(Pt,"temp",{enumerable:!0,get:function(){return ae.isElement(ki)&&!De.document.head.contains(ki)&&(ki.style.display="none",De.document.head.appendChild(ki)),ki}});var Bt=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},pg=De.devicePixelRatio||1;function gg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ps(e){return pg/gg(e)}var Tr=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},dt,Bn=class extends Array{constructor(){super(),Aa(this,dt,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return St(this,dt)}set _events(t){cg(this,dt,t)}get _bound(){return St(this,dt)._bound}set _bound(t){St(this,dt)._bound=t}addEventListener(){return St(this,dt).addEventListener.apply(this,arguments)}on(){return St(this,dt).on.apply(this,arguments)}bind(){return St(this,dt).bind.apply(this,arguments)}removeEventListener(){return St(this,dt).removeEventListener.apply(this,arguments)}off(){return St(this,dt).off.apply(this,arguments)}unbind(){return St(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return St(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return St(this,dt).trigger.apply(this,arguments)}listen(){return St(this,dt).listen.apply(this,arguments)}ignore(){return St(this,dt).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};dt=new WeakMap;var Ka=class extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",bt.Identifier+bt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in Za)Object.defineProperty(this,e,Za[e])}static fromObject(e){const t=new Ka().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Dn=Ka;w(Dn,"Properties",["renderer","id","className"]);var Za={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Er,Ja={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Er=document.createElement("a"));var Je=class extends Dn{constructor(e,t){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let n in Qa)Object.defineProperty(this,n,Qa[n]);if(this._renderer.type="texture",this._renderer.flagOffset=mg.bind(this),this._renderer.flagScale=_g.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(X.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(X.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Je().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Er?(Er.href=e,Er.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=Je.getAbsoluteURL(e);if(Je.ImageRegistry.contains(t))return Je.ImageRegistry.get(t);let n;return yt.Image?(n=new yt.Image,yt.shim(n,"img")):De.document?Ja.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Je.getTag(n);e._flagImage&&(/canvas/i.test(r)?Je.Register.canvas(e,t):(e._src=!yt.isHeadless&&n.getAttribute("two-src")||n.src,Je.Register[r](e,t))),e._flagSrc&&(n||(n=Je.getImage(e.src),e.image=n),r=Je.getTag(n),Je.Register[r](e,t))}clone(){const e=new Je(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Je.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Ee=Je;w(Ee,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Ee,"RegularExpressions",Ja),w(Ee,"ImageRegistry",new Tr),w(Ee,"Register",{canvas:function(e,t){e._src="#"+e.id,Je.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!yt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!yt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Bt("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!yt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Je.getAbsoluteURL(e._src),!(!yt.isHeadless&&n&&n.getAttribute("two-src"))&&(yt.isHeadless||n.setAttribute("two-src",e.src),Je.ImageRegistry.add(e.src,n),yt.isHeadless?Je.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(yt.isHeadless)throw new Bt("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new Bt("unable to load "+e.src)};e._src=Je.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Je.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var Qa={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Ee.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Ee.ImageRegistry.contains(n)?this._image=Ee.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function mg(){this._flagOffset=!0}function _g(){this._flagScale=!0}var Wt=class extends Dn{constructor(e,t,n){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let r in el)Object.defineProperty(this,r,el[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Wt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Wt.Index<=0?"#fff":"#000",Wt.Index=(Wt.Index+1)%2}static fromObject(e){const t=new Wt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Wt.Properties.length;t++){const n=Wt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Wt;return ae.each(Wt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(Wt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Kt=Wt;w(Kt,"Index",0),w(Kt,"Properties",["offset","opacity","color"]);var el={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Hn=class extends Dn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in tl)Object.defineProperty(this,t,tl[t]);this._renderer.type="gradient",this._renderer.flagStops=yg.bind(this),this._renderer.bindStops=bg.bind(this),this._renderer.unbindStops=wg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof Kt?r:new Kt().copy(r)));const n=new Hn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new Hn(t);return ae.each(Hn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<Hn.Properties.length;t++){const n=Hn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(Hn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},qe=Hn;w(qe,"Stop",Kt),w(qe,"Properties",["spread","stops","units"]);var tl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._stops=new Bn((e||[]).slice(0)),this._stops.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._stops)}}};function yg(){this._flagStops=!0}function bg(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function wg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ui=class extends qe{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in nl)Object.defineProperty(this,o,nl[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=vg.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ui().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ui.Properties.length;t++){const n=Ui.Properties[t];n in e&&(this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ui(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(qe.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Oe=Ui;w(Oe,"Stop",Kt),w(Oe,"Properties",["left","right"]);var nl={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Z&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function vg(){this._flagEndPoints=!0}var Wn=class extends qe{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in il)Object.defineProperty(this,a,il[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=kg.bind(this),this._renderer.flagFocal=xg.bind(this),this.center=new Z,this.radius=typeof n=="number"?n:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Wn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Wn.Properties.length;t++){const n=Wn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Wn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(qe.Properties.concat(Wn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Wn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ie=Wn;w(Ie,"Stop",Kt),w(Ie,"Properties",["center","radius","focal"]);var il={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function kg(){this._flagCenter=!0}function xg(){this._flagFocal=!0}function rl(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function $r(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function sl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),ja(r,l,s,c,o,d,a,h,n)}function ol(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ns(r,l,s,c,o,d,a,h,n)}function jn(e){switch(e.renderer.type){case"texture":return Ee.fromObject(e);case"gradient":return qe.fromObject(e);case"linear-gradient":return Oe.fromObject(e);case"radial-gradient":return Ie.fromObject(e)}return e}var Cg=Math.cos,Sg=Math.sin,al=Math.tan,Fs=[],Ft=class extends X{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Gt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const C=e;let B,v,N;const F=t[0]||0,P=t[1]||0,q=t[2]||0;return B=C[0]*F+C[1]*P+C[2]*q,v=C[3]*F+C[4]*P+C[5]*q,N=C[6]*F+C[7]*P+C[8]*q,[B,v,N]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],u=e[8],p=t[0],f=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Gt(9),n[0]=r*p+s*m+o*b,n[1]=r*f+s*_+o*S,n[2]=r*g+s*y+o*x,n[3]=a*p+l*m+c*b,n[4]=a*f+l*_+c*S,n[5]=a*g+l*y+c*x,n[6]=d*p+h*m+u*b,n[7]=d*f+h*_+u*S,n[8]=d*g+h*y+u*x,n}static fromObject(e){return new Ft().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(X.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(X.Types.change)}identity(){return this.elements[0]=Ft.Identity[0],this.elements[1]=Ft.Identity[1],this.elements[2]=Ft.Identity[2],this.elements[3]=Ft.Identity[3],this.elements[4]=Ft.Identity[4],this.elements[5]=Ft.Identity[5],this.elements[6]=Ft.Identity[6],this.elements[7]=Ft.Identity[7],this.elements[8]=Ft.Identity[8],this.trigger(X.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(X.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const M=s[0]*e+s[1]*t+s[2]*n,E=s[3]*e+s[4]*t+s[5]*n,A=s[6]*e+s[7]*t+s[8]*n;return[M,E,A]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],p=d[1],f=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],x=h[0],C=h[1],B=h[2],v=h[3],N=h[4],F=h[5],P=h[6],q=h[7],U=h[8];return this.elements[0]=u*x+p*v+f*P,this.elements[1]=u*C+p*N+f*q,this.elements[2]=u*B+p*F+f*U,this.elements[3]=g*x+m*v+_*P,this.elements[4]=g*C+m*N+_*q,this.elements[5]=g*B+m*F+_*U,this.elements[6]=y*x+b*v+S*P,this.elements[7]=y*C+b*N+S*q,this.elements[8]=y*B+b*F+S*U,this.trigger(X.Types.change)}inverse(e){const t=this.elements;e=e||new Ft;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=h*a-l*d,p=-h*o+l*c,f=d*o-a*c;let g=n*u+r*p+s*f;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=f*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Cg(e),n=Sg(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=al(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=al(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Fs.length=0,this.toTransformArray(e,Fs),Fs.map(Re).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,u,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=u,t[8]=p;return}return[s,o,a,l,c,d,h,u,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ft().copy(this)}},Xn=Ft;w(Xn,"Identity",[1,0,0,0,1,0,0,0,1]),za(Xn);var Ms=class extends Dn{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Nr)Object.defineProperty(this,e,Nr[e]);this._renderer.flagMatrix=ll.bind(this),this.isShape=!0,this.matrix=new Xn,this.worldMatrix=new Xn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Ms().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Nr.position.get.apply(this,arguments)}set translation(e){Nr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Z?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Ms;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Z?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Z?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},hn=Ms;w(hn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Nr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(X.Types.change,this._renderer.flagMatrix),ll.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&this._scale.bind(X.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return La(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ll(){this._flagMatrix=!0}var xi=Math.min,Ci=Math.max,Bg=Math.ceil,Tg=Math.floor,Eg=new Z,Tn=class extends hn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in cl)Object.defineProperty(this,s,cl[s]);this._renderer.type="path",this._renderer.flagVertices=dl.bind(this),this._renderer.bindVertices=hl.bind(this),this._renderer.unbindVertices=ul.bind(this),this._renderer.flagFill=fl.bind(this),this._renderer.flagStroke=pl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Tn().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Tn.Properties.length;t++){const n=Tn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Tn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Tn.Properties.length;n++){const r=Tn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Tn.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:p}=wi(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof p=="number"&&(n=Math.max(u,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[u,p]=t.multiply(o.x,o.y),[f,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=o.controls.right.y;o.relative&&(m+=o.x,_+=o.y);let[y,b]=t.multiply(m,_),S=a.controls.left.x,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[C,B]=t.multiply(S,x);const v=Xa(u,p,y,b,C,B,f,g);d=xi(v.min.y-n,d),l=xi(v.min.x-n,l),c=Ci(v.max.x+n,c),h=Ci(v.max.y+n,h)}else s<=1&&(d=xi(p-n,d),l=xi(u-n,l),c=Ci(u+n,c),h=Ci(p+n,h)),d=xi(g-n,d),l=xi(f-n,l),c=Ci(f+n,c),h=Ci(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,C=null;for(let K=0,R=this._lengths.length,$=0;K<R;K++){if($+this._lengths[K]>=y){this._closed?(n=Rt(K,b),r=Rt(K-1,b),K===0&&(n=r,r=K)):(n=K,r=Math.min(Math.max(K-1,0),S)),x=this.vertices[n],C=this.vertices[r],y-=$,this._lengths[K]!==0?e=y/this._lengths[K]:e=0;break}$+=this._lengths[K]}if(x===null||C===null)return null;if(x){if(!C)return x}else return C;_=C.controls&&C.controls.right,m=x.controls&&x.controls.left,a=C.x,u=C.y,l=(_||C).x,p=(_||C).y,c=(m||x).x,f=(m||x).y,d=x.x,g=x.y,_&&C.relative&&(l+=C.x,p+=C.y),m&&x.relative&&(c+=x.x,f+=x.y),o=Yi(e,a,l,c,d),h=Yi(e,u,p,f,g);const B=Nt(a,l,e),v=Nt(u,p,e),N=Nt(l,c,e),F=Nt(p,f,e),P=Nt(c,d,e),q=Nt(f,g,e),U=Nt(B,N,e),M=Nt(v,F,e),E=Nt(N,P,e),A=Nt(F,q,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=U,t.controls.left.y=M,t.controls.right.x=E,t.controls.right.y=A,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,U-o,M-h,E-o,A-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Ya(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=ol(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=ol(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=sl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=$r(this,n*this._length),o=$r(this,r*this._length),a=Bg(s),l=Tg(o);let c,d,h,u,p,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>l&&!d?(p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,p),p.command=this._renderer.collection[f].command,this._renderer.vertices.push(p),d=p,h=this._collection[f-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-p.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):f>=a&&f<=l&&(p=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(p),f===l&&rl(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):f===a&&rl(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(f=a-1,p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),u=this._collection[f+1],u&&u.controls&&(p.controls.left.clear(),u.relative?this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(Z.zero,p.t):(Eg.copy(u),this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(u,p.t))))}return hn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,hn.prototype.flagReset.call(this),this}},Ce=Tn;w(Ce,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(Ce,"Utils",{getCurveLength:sl});var cl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,t).unbind(X.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function dl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function hl(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ul(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fl(){this._flagFill=!0}function pl(){this._flagStroke=!0}var Gi=class extends Ce{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in gl)Object.defineProperty(this,o,gl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Gi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gi.Properties.length;t++){const n=Gi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Gi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},En=Gi;w(En,"Properties",["width","height"]);var gl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ki=class extends En{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in ml)Object.defineProperty(this,a,ml[a]);this.noStroke(),this.noFill(),e instanceof Ee?this.texture=e:typeof e=="string"&&(this.texture=new Ee(e)),this.origin=new Z,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ki(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,u;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Nt(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,f=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*f+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Rr=Ki;w(Rr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var ml={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},As,_l=class extends Bn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),Aa(this,As,{}),this.attach(t),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return St(this,As)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};As=new WeakMap;var qn=class extends Ce{constructor(e,t,n,r,s,o,a){const l=a||bt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ct),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in yl)Object.defineProperty(this,d,yl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Rt(e,ct)===Rt(t,ct),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,p,f,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(p=h/u,f=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=r*m/Math.PI,f.controls.left.x=b*Math.cos(g-Ze),f.controls.left.y=b*Math.sin(g-Ze),f.controls.right.x=b*Math.cos(g+Ze),f.controls.right.y=b*Math.sin(g+Ze),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,u=l-1),h=0;h<l;h++)p=h/u,f=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=n*m/Math.PI,f.controls.left.x=b*Math.cos(g+Ze),f.controls.left.y=b*Math.sin(g+Ze),f.controls.right.x=b*Math.cos(g-Ze),f.controls.right.y=b*Math.sin(g-Ze),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new qn(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ce.Properties.length;l++){const c=Ce.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];e[n]=this[n]}return e}},Pr=qn;w(Pr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var yl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Os=Math.cos,Is=Math.sin,Yn=class extends Ce{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in bl)Object.defineProperty(this,a,bl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Yn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Os(a),c=n*Is(a),d=r*Os(a-Ze),h=r*Is(a-Ze),u=r*Os(a+Ze),p=r*Is(a+Ze),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Yn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];e[n]=this[n]}return e}},Zi=Yn;w(Zi,"Properties",["radius"]);var bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Vs=Math.cos,zs=Math.sin,Un=class extends Ce{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in wl)Object.defineProperty(this,l,wl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Un().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Vs(a),c=r*zs(a),d=n*t*Vs(a-Ze),h=r*t*zs(a-Ze),u=n*t*Vs(a+Ze),p=r*t*zs(a+Ze),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Un(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Ji=Un;w(Ji,"Properties",["width","height"]);var wl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},$g=Math.ceil,Ng=Math.floor,$n=class extends hn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",Ce.prototype.noFill),w(this,"noStroke",Ce.prototype.noStroke),w(this,"corner",Ce.prototype.corner),w(this,"center",Ce.prototype.center),w(this,"getBoundingClientRect",Ce.prototype.getBoundingClientRect),w(this,"_updateLength",Ce.prototype._updateLength);for(let t in vl)Object.defineProperty(this,t,vl[t]);this._renderer.type="points",this._renderer.flagVertices=dl.bind(this),this._renderer.bindVertices=hl.bind(this),this._renderer.unbindVertices=ul.bind(this),this._renderer.flagFill=fl.bind(this),this._renderer.flagStroke=pl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new $n().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<$n.Properties.length;t++){const n=$n.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new $n;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<$n.Properties.length;n++){const r=$n.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ns(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=$r(this,e*this._length),r=$r(this,t*this._length),s=$g(n),o=Ng(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Fr=$n;w(Fr,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var vl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,t).unbind(X.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},Rg=Math.cos,Pg=Math.sin,Gn=class extends Ce{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in kl)Object.defineProperty(this,s,kl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Gn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s+Math.PI/2,a=this._width*Rg(o)/2,l=this._height*Pg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Gn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Mr=Gn;w(Mr,"Properties",["width","height","sides"]);var kl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Kn=class extends Ce{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let a in xl)Object.defineProperty(this,a,xl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Fg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Z?r:new Z().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof Z?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new Kn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},Qi=Kn;w(Qi,"Properties",["width","height","radius"]);var xl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Z&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Fg(){this._flagRadius=!0}var Mg=Math.cos,Ag=Math.sin,Zn=class extends Ce{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in Cl)Object.defineProperty(this,o,Cl[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Mg(o),c=a*Ag(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new Zn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ar=Zn;w(Ar,"Properties",["innerRadius","outerRadius","sides"]);var Cl={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Ls,Sl=Math.min,Bl=Math.max;De.document&&(Ls=document.createElement("canvas"));var Mt=class extends hn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in Tl)Object.defineProperty(this,s,Tl[s]);if(this._renderer.type="text",this._renderer.flagFill=Og.bind(this),this._renderer.flagStroke=Ig.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Mt.Properties.length;s++){const o=Mt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Ls){const t=Ls.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Mt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Mt().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Mt.Properties.length;t++){const n=Mt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Mt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Mt.Properties.length;n++){const r=Mt.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Mt.Properties.length;t++){const n=Mt.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Mt.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[u,p]=t.multiply(n,o),[f,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=Sl(h,p,g,_),n=Sl(d,u,f,m),r=Bl(d,u,f,m),o=Bl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},It=Mt;w(It,"Ratio",.6),w(It,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Tl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Oe||this._fill instanceof Ie||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Oe||this._stroke instanceof Ie||this._stroke instanceof Ee)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Og(){this._flagFill=!0}function Ig(){this._flagStroke=!0}var Or=Math.min,Ir=Math.max,Si=class extends hn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in El)Object.defineProperty(this,t,El[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)$l.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)$l.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Si;for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:jn(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Pr.fromObject(r);case"circle":return Zi.fromObject(r);case"ellipse":return Ji.fromObject(r);case"points":return Fr.fromObject(r);case"polygon":return Mr.fromObject(r);case"rectangle":return En.fromObject(r);case"rounded-rectangle":return Qi.fromObject(r);case"star":return Ar.fromObject(r);case"path":return Ce.fromObject(r);case"text":return It.fromObject(r);case"group":return Si.fromObject(r);case"shape":return hn.fromObject(r);case"element":return Dn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Si,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const f=this.children[p];if(!(!f.visible||u.test(f._renderer.type))&&(t=f.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[x,C]=n.multiply(t.right,t.bottom);d=Or(m,y,S,C,d),l=Or(g,_,b,x,l),c=Ir(g,_,b,x,c),h=Ir(m,y,S,C,h)}else d=Or(t.top,d),l=Or(t.left,l),c=Ir(t.right,c),h=Ir(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ue=Si;w(Ue,"Children",_l),w(Ue,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var El={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ue.InsertChildren.bind(this),n=Ue.RemoveChildren.bind(this),r=Ue.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new _l(e),this._children.bind(X.Types.insert,t),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function $l(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ds=class extends Ce{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Nl)Object.defineProperty(this,a,Nl[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Nl={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new Bt("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new Bt("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Zt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Vg={start:"left",middle:"center",end:"right"},Rl=["id","class","transform","xmlns","viewBox"],zg=["x","y","width","height","href","xlink:href"];function Lg(e){return Vg[e]}function Dg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function er(e){return e.replace(/svg:/gi,"").toLowerCase()}function Pl(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function Hg(e,t){t||(t={});const n=e.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");t[l]=c}return t}function Wg(e){const t={},n=jg(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function jg(e){const t=e.getAttributeNames();for(let n=0;n<Rl.length;n++){const r=Rl[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function Xg(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<e.children.length;u++){const p=e.children[u];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Z(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new En(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Vt(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,p,f,g,m,_,y,b,S,x,C,B;if(e===null)return r;if(De.getComputedStyle){const v=De.getComputedStyle(e);for(a=v.length;a--;)c=v[a],d=v[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?Hg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=wi(l),t._renderer.type){case"linear-gradient":Pl(p,t.left),Pl(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=wi(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Z(p.scaleX,p.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(t.translation.x=f),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ue){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ue){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ue){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ue){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ue){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ue){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Zt.cssBackgroundImage.test(d)&&(m=d.replace(Zt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=er(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ue?"_":"")+c,Zt.cssBackgroundImage.test(d)?(m=d.replace(Zt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=er(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=Yg(this),y=_.getById(m)),t[h]=y):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof qe,x=t instanceof Oe,C=t instanceof Ie,S||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Bt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof It&&(t.family=d);break;case"font-size":t instanceof It&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Bt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof It&&(t.weight=d);break;case"font-style":t instanceof It&&(t.style=d);break;case"text-decoration":t instanceof It&&(t.decoration=d);break;case"line-height":t instanceof It&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function qg(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||er(e.nodeName)==="#text"||t.add(s.id,s)}}function Yg(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new Tr,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)qg(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,u=a!==null,p=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(Zt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Zt.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(Zt.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(Zt.unitSuffix,""))),d&&Xg(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Bt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Bt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<e.attributes.length;c++){const d=e.attributes[c],h=zg.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=er(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ue;Vt.call(this,e,n,t),this.add(n);const r=Wg.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=er(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",Vt.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;ae.each(h.slice(0),function(p,f){const g=p.slice(1).trim().match(Zt.path),m=p[0],_=m.toLowerCase();let y,b,S,x,C;const B=[];switch(f===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,C=0;b<S;b+=y){if(x=m,C>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+y).join(" ")),C++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,f){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(Zt.path),o=y===b;let S,x,C,B,v,N,F,P,q,U,M,E,A,K,R,$,j;switch(b){case"z":if(f>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const Y=r[z];if(/m/i.test(Y.command)){l=Y;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),_=parseFloat(d[1]),g=new ve(m,_,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":U=/h/i.test(b)?"x":"y",M=/x/i.test(U)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[U]=parseFloat(d[0]),g[M]=l[M],o&&(g[U]+=l[U]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new Z),/c/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[2]),N=parseFloat(d[3]),F=parseFloat(d[4]),P=parseFloat(d[5])):(q=Rs(l,c,o),C=q.x,B=q.y,v=parseFloat(d[0]),N=parseFloat(d[1]),F=parseFloat(d[2]),P=parseFloat(d[3])),o&&(C+=S,B+=x,v+=S,N+=x,F+=S,P+=x),l.controls.right.set(C-l.x,B-l.y),g=new ve(F,P,v-F,N-P,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new Z),/q/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[0]),N=parseFloat(d[1]),F=parseFloat(d[2]),P=parseFloat(d[3])):(q=Rs(l,c,o),C=q.x,B=q.y,v=q.x,N=q.y,F=parseFloat(d[0]),P=parseFloat(d[1])),o&&(C+=S,B+=x,v+=S,N+=x,F+=S,P+=x),l.controls.right.set((C-l.x)*.33,(B-l.y)*.33),g=new ve(F,P,v-F,N-P,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,A=parseFloat(d[0]),K=parseFloat(d[1]),R=parseFloat(d[2]),$=parseFloat(d[3]),j=parseFloat(d[4]),F=parseFloat(d[5]),P=parseFloat(d[6]),o&&(F+=S,P+=x),E=new ve(F,P),E.command=ee.arc,E.rx=A,E.ry=K,E.xAxisRotation=R,E.largeArcFlag=$,E.sweepFlag=j,g=E,l=E,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Ce(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Vt.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Zi(0,0,s);return o.stroke="none",o.fill="black",Vt.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new Ji(0,0,s,o);return a.stroke="none",a.fill="black",Vt.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new En(0,0,s,o);return c.stroke="none",c.fill="black",Vt.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new Qi(0,0,s,o,c);return d.stroke="none",d.fill="black",Vt.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ds(n,r,s,o).noFill();return Vt.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const f=e.children[p];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=f.getAttribute("stop-color"),_=f.getAttribute("stop-opacity"),y=f.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new Kt(g,m,_))}const u=new Oe(s,o,a,l,h);return u.spread=r,u.units=n,Vt.call(this,e,u,t),u},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<e.children.length;f++){const g=e.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),u.push(new Kt(m,_,y))}const p=new Ie(s,o,a,u,l,c);return p.spread=r,p.units=n,Vt.call(this,e,p,t),p},text:function(e,t){const n=Lg(e.getAttribute("text-anchor"))||"left",r=Dg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new It(s);return Vt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Bt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Rr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Vt.call(this,e,c,t),c}};function Fl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Bi=class extends En{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Ml)Object.defineProperty(this,s,Ml[s]);this._renderer.flagTextures=Ug.bind(this),this._renderer.bindTextures=Gg.bind(this),this._renderer.unbindTextures=Kg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Al.bind(this)):this.textures=[Al(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Bi.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Bi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Bi.Properties.length;t++){const n=Bi.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Bi(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Nt(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ee))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Vr=Bi;w(Vr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Vr,"DefaultFrameRate",30);var Ml={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._textures=new Bn((e||[]).slice(0)),this._textures.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function Ug(){this._flagTextures=!0}function Gg(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Kg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Al(e){if(e instanceof Ee)return e;if(typeof e=="string")return new Ee(e)}var Hs=[],Ws=Math.max,Zg=Math.min,Ol=Math.abs,zr=Math.sin,Lr=Math.cos,Jg=Math.acos,Dr=Math.sqrt,Te={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Te?e:"path"},group:{renderChild:function(e){const t=Te.getRendererType(e._renderer.type);Te[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Hr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Te.getRendererType(r._renderer.type);Te[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Te.getRendererType(l._renderer.type);Te[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S,x,C,B,v,N,F,P,q,U,M,E,A,K,R,$,j,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,A=this._mask,K=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||K||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,p=this._closed,f=this._renderer.vertices,g=f.length,m=g-1,R=Hr(r),j=this.dashes,R||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),A){const re=Te.getRendererType(A._renderer.type);Te[re].render.call(A,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Te.getRendererType(a._renderer.type);Te[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Te.getRendererType(s._renderer.type);Te[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),j&&j.length>0&&(e.lineDashOffset=j.offset||0,e.setLineDash(j)),e.beginPath();let Y,I,V,J,pe,ie,ge;for(let re=0;re<g;re++)switch(b=f[re],M=b.x,E=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:Y=b.rx,I=b.ry,V=b.xAxisRotation,J=b.largeArcFlag,pe=b.sweepFlag,_=p?Rt(re-1,g):Ws(re-1,0),y=f[_],ie=y.x,ge=y.y,Te.renderSvgArcCommand(e,ie,ge,Y,I,J,pe,V,M,E);break;case ee.curve:_=p?Rt(re-1,g):Math.max(re-1,0),y=f[_],F=y.controls&&y.controls.right||Z.zero,P=b.controls&&b.controls.left||Z.zero,y._relative?(v=F.x+y.x,N=F.y+y.y):(v=F.x,N=F.y),b._relative?(C=P.x+b.x,B=P.y+b.y):(C=P.x,B=P.y),e.bezierCurveTo(v,N,C,B,M,E),re>=m&&p&&(S=x,q=b.controls&&b.controls.right||Z.zero,U=S.controls&&S.controls.left||Z.zero,b._relative?(v=q.x+b.x,N=q.y+b.y):(v=q.x,N=q.y),S._relative?(C=U.x+S.x,B=U.y+S.y):(C=U.x,B=U.y),M=S.x,E=S.y,e.bezierCurveTo(v,N,C,B,M,E));break;case ee.line:e.lineTo(M,E);break;case ee.move:x=b,e.moveTo(M,E);break}return p&&e.closePath(),!K&&!n&&(Te.isHidden.test(a)||($=a._renderer&&a._renderer.offset,$&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),$&&e.restore()),Te.isHidden.test(s)||($=s._renderer&&s._renderer.offset,$&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),$&&e.restore())),R||e.restore(),K&&!n&&e.clip(),j&&j.length>0&&e.setLineDash(Hs),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,m=Hr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const C=Te.getRendererType(a._renderer.type);Te[C].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const C=Te.getRendererType(s._renderer.type);Te[C].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),e.beginPath();let S=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=wi(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let C=0;C<u;C++)p=h[C],f=p.x,g=p.y,e.moveTo(f+S,g),e.arc(f,g,S,0,ct);return n||(Te.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Te.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(Hs),this.flagReset()}},text:{render:function(e,t,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,p=this._decoration,f=this._direction,g=Hr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Te.alignments[this._alignment]||this._alignment,b=Te.baselines[this._baseline]||this._baseline;let S,x,C,B,v,N,F,P,q,U,M;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const E=Te.getRendererType(a._renderer.type);Te[E].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=f,u)if(typeof u=="string")e.fillStyle=u;else{const E=Te.getRendererType(u._renderer.type);Te[E].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const E=Te.getRendererType(d._renderer.type);Te[E].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?(N=u._renderer.scale.x,F=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale(N,F),S=this._size/u._renderer.scale.y,x=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),C=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,C,B),e.restore()):e.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?(N=d._renderer.scale.x,F=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(N,F),S=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),C=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,v=h/d._renderer.scale.x,e.lineWidth=v,e.strokeText(this.value,C,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const E=e.measureText(this.value);let A=1;switch(p){case"underline":q=E.actualBoundingBoxDescent,M=E.actualBoundingBoxDescent;break;case"strikethrough":q=0,M=0,A=.5;break}switch(b){case"top":q+=this._size*A,M+=this._size*A;break;case"baseline":case"bottom":q-=this._size*A,M-=this._size*A;break}switch(y){case"left":case"start":P=0,U=E.width;break;case"right":case"end":P=-E.width,U=0;break;default:P=-E.width/2,U=E.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(P,q),e.lineTo(U,M),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(Hs),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ol(r),s=Ol(s);const h=(t-c)/2,u=(n-d)/2,p=Lr(l)*h+zr(l)*u,f=-zr(l)*h+Lr(l)*u,g=p*p,m=f*f;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const E=Dr(b);r=E*r,s=E*s,_=r*r,y=s*s}const S=_*m+y*g,x=(_*y-S)/S;let C=Dr(Ws(0,x));o===a&&(C=-C);const B=C*r*f/s,v=-C*s*p/r,N=Lr(l)*B-zr(l)*v+(t+c)/2,F=zr(l)*B+Lr(l)*v+(n+d)/2,P=Il(1,0,(p-B)/r,(f-v)/s),q=Il((p-B)/r,(f-v)/s,(-p-B)/r,(-f-v)/s)%ct,U=P+q;Qg(e,N,F,r,s,P,U,a===0,l)}},ht=class extends X{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ue,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ps(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(X.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Te.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ht,"Utils",Te);function Qg(e,t,n,r,s,o,a,l,c){const d=a-o,h=vi.Tolerance.epsilon,u=Math.abs(d)<h;let p=Rt(d,ct);p<h&&(u?p=0:p=ct),l===!0&&!u&&(p===ct?p=-ct:p=p-ct);for(let f=0;f<bt.Resolution;f++){const g=f/(bt.Resolution-1),m=o+g*p;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=_-t,C=y-n;_=x*b-C*S+t,y=x*S+C*b+n}e.lineTo(_,y)}}function Il(e,t,n,r){const s=e*n+t*r,o=Dr(e*e+t*t)*Dr(n*n+r*r);let a=Jg(Ws(-1,Zg(1,s/o)));return e*r-t*n<0&&(a=-a),a}function Hr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?Rt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,p,f,g,m,_,y,b,S,x,C,B,v,N,F=Re(l.x),P=Re(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:x=l.rx,C=l.ry,B=l.xAxisRotation,v=l.largeArcFlag,N=l.sweepFlag,h=ee.arc+" "+x+" "+C+" "+B+" "+v+" "+N+" "+F+" "+P;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(p=Re(_.x+d.x),f=Re(_.y+d.y)):(p=Re(_.x),f=Re(_.y)),l.relative?(g=Re(y.x+l.x),m=Re(y.y+l.y)):(g=Re(y.x),m=Re(y.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+f+" "+g+" "+m+" "+F+" "+P;break;case ee.move:s=l,h=ee.move+" "+F+" "+P;break;default:h=l.command+" "+F+" "+P}a>=r&&t&&(l.command===ee.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(p=Re(b.x+l.x),f=Re(b.y+l.y)):(p=Re(b.x),f=Re(b.y)),u.relative?(g=Re(S.x+u.x),m=Re(S.y+u.y)):(g=Re(S.x),m=Re(S.y)),F=Re(u.x),P=Re(u.y),h+=" C "+p+" "+f+" "+g+" "+m+" "+F+" "+P),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=wi(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Z?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},Vl=class extends X{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ue,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(X.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(Vl,"Utils",se);var zt={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Bt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
40
+ ***************************************************************************** */var Cr=function(){return Cr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Cr.apply(this,arguments)},Iu={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},dn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ss=500,zu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Cr(Cr({},Iu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(dn.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var p=this.getPossibleSwipeDragCords(n),f,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),f=m/y,g=_/y}else{var y=(t-n)*n;f=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(f,p.minX)?f=p.minX:this.isBeyondPossibleRight(f,p.maxX)&&(f=p.maxX):t>1&&(f<p.minX?f=p.minX:f>p.maxX&&(f=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:f,y:g,scale:t}),this.left=f,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ss),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ss+50)},e.prototype.setZoomStyles=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ss+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(dn.containerResize+".zoom "+dn.rotateRight+".zoom "+dn.rotateLeft+".zoom "+dn.flipHorizontal+".zoom "+dn.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(dn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(dn.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(dn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var u=t.scale-o;t.zoomImage(t.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,p.minY)?u.y=p.minY:this.isBeyondPossibleBottom(u.y,p.maxY)&&(u.y=p.maxY)),r&&(this.isBeyondPossibleLeft(u.x,p.minX)?u.x=p.minX:this.isBeyondPossibleRight(u.x,p.maxX)&&(u.x=p.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-t.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;t&&(o=o+t*o,a=a+t*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var f=t.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var f=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,f))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,f)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var f=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target)){c=new Date,u=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var f=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var f=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,f)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const Le=class Le{static init(t){if(Le.uiConfig)throw new Error("UI provider already initialized.");Le.uiConfig=t,Le.windowResizeHandler(),window.addEventListener("resize",Le.windowResizeHandler)}static destroy(){window.removeEventListener("resize",Le.windowResizeHandler)}static getMessagesService(){return Le.getUiConfig().messagesService}static getNotificationsService(){return Le.getUiConfig().notificationsService}static getDeviceTypeByResolution(){const{deviceTypeResolutionsConfig:t}=Le.getUiConfig();return window.innerWidth<t.tablet?H.WindowResolutionEnum.phone:window.innerWidth<t.laptop?H.WindowResolutionEnum.tablet:H.WindowResolutionEnum.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return Le.setRefValueDependingOnDeviceResolution(s,t,n,r),Le.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return Le.getDeviceTypeByResolution()===H.WindowResolutionEnum.phone}static isTabletDevice(){return Le.getDeviceTypeByResolution()===H.WindowResolutionEnum.tablet}static isLaptopDevice(){return Le.getDeviceTypeByResolution()===H.WindowResolutionEnum.laptop}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(W.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";Le.getNotificationsService().error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3})}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new H.FieldValidationResultData(t.errors[o].toString(),"error"):Le.getMessagesService().error(t.errors[o].toString())}static getUiConfig(){if(!Le.uiConfig)throw new Error("UI provider is not initialized.");return Le.uiConfig}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(Le.getDeviceTypeByResolution()){case H.WindowResolutionEnum.phone:t.value=n;break;case H.WindowResolutionEnum.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){W.forEach(Le.refsDependingOnDeviceResolution,t=>{Le.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};C(Le,"uiConfig"),C(Le,"refsDependingOnDeviceResolution",[]);let _t=Le;const Lu={ref:"gallery-container",class:"lightgallery-wrapper"},Du={},ya=i.defineComponent({...Du,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),W.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",Lu,[i.renderSlot(o.$slots,"default")],512))}}),Hu=["href"],Wu=["src","alt"],ju={},ba=i.defineComponent({...ju,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Ou,zu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(_t.getDeviceTypeByResolution()===H.WindowResolutionEnum.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=_a,p=V.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ya,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,Wu)],8,Hu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Xu={class:"flex flex-col text-sm"},qu={},Yu=i.defineComponent({...qu,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Cs,s=V.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Xu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.quantityUnit),1))),128))])]),_:3})}}}),Uu={class:"flex flex-row justify-between"},Gu={key:0},Ku={class:"ml-2 align-sub"},Zu={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Ju={class:"@container"},Qu={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ef={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},tf={class:"text-sc-dark-grey"},nf={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},rf={class:"text-gray-600"},sf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},of={key:3,class:"underline decoration-dashed"},af={key:4,class:"sc-product-pack whitespace-nowrap"},lf={class:"text-gray-600"},cf={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},df={class:"text-gray-600"},hf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},uf={key:0},ff={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},pf={},Xi=i.defineComponent({...pf,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>W.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>W.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>W.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,u)=>{var y,b,S,x,v;const p=_a,f=V.NText,g=ma,m=Cs,_=V.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Uu,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Gu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Ku,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ba,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Zu,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Ju,[i.createElementVNode("div",Qu,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ef,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",tf,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",nf,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",rf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Yu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",sf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",of," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",af,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",lf,i.toDisplayString((v=(x=h.product)==null?void 0:x.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",cf,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",df,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",hf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(kr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(kr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":!0,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates,"cost-field-name":"cost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",uf,[i.createElementVNode("ul",ff,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),gf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(kr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),mf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(_t.getDeviceTypeByResolution()){case H.WindowResolutionEnum.phone:case H.WindowResolutionEnum.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,currencyRates:t.currencyRates})}),t.showProductCosts&&(W.forEach(e,s=>{W.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),W.forEach(W.sortBy(r,["slug"]),s=>{n.push(gf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(kr,{product:s,costFieldName:"cost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showCostDate:!0,showPriceHistory:t.showPriceHistory,currencyRates:t.currencyRates})})),(t.showProductEditButton||!W.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ma,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},_f={key:0,class:"pt-0.5"},yf={class:"flex flex-row gap-1"},bf={key:0},wf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},vf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},kf={},xf=i.defineComponent({...kf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>{var E;return(E=t==null?void 0:t.filteredItems)==null?void 0:E[t.categoryItem.id]}),s=i.computed(()=>{var E,M;return W.isArray((E=t.categoryItem)==null?void 0:E.categories)&&((M=t.categoryItem.categories)==null?void 0:M.length)>0}),o=i.computed(()=>{var E;return W.isArray((E=t.categoryItem)==null?void 0:E.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([E,M])=>`${M} руб./${S(E)}`).join(", ")),l=i.computed(()=>W.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(E=>{var M,K;return(K=(M=r.value)==null?void 0:M.products)==null?void 0:K.includes(E.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>W.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>W.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),u=i.computed(()=>W.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>W.isNil(t.categoryContextButtonsConfig)?[]:W.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new H.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!W.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some(E=>E.id===t.categoryItem.id)),b=i.computed(()=>j.value&&_t.getDeviceTypeByResolution()===H.WindowResolutionEnum.laptop?"auto":"fixed"),S=(E,M="ru-RU")=>0 .toLocaleString(M,{style:"currency",currency:E,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),x=E=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:E})},v=(E,M)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:M,isLoadingState:g})},B=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem})},k=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem})},$=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem})},P=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem})},R=E=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:E})},j=i.ref(0),Y=i.computed(()=>j.value&&o.value.length>0?mf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),A=W.debounce(()=>{j.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",A)}),window.addEventListener("resize",A),A(),(E,M)=>{const K=V.NCheckbox,F=au,N=V.NTooltip,X=ru,z=pa,U=V.NTag,O=Qh,I=Kh,J=V.NButton,pe=Yh,ie=fa,ge=ua,re=V.NDropdown,Me=V.NDataTable,Fe=V.NAlert,Ge=V.NSpin;return i.openBlock(),i.createBlock(ga,{name:E.categoryItem.id,"data-id":E.categoryItem.id,"onHeader:click":v},{"pre-arrow":i.withCtx(()=>{var xe,Se,st;return[_.value?(i.openBlock(),i.createElementBlock("div",_f,[i.createVNode(K,{checked:y.value,"onUpdate:checked":x},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((xe=f.value)!=null&&xe.isDisabled)?(i.openBlock(),i.createBlock(N,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(F,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[1]||(M[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((Se=f.value)==null?void 0:Se.isFavorite)??!1?(i.openBlock(),i.createBlock(N,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(X,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[2]||(M[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((st=f.value)==null?void 0:st.isRequired)??!1?(i.openBlock(),i.createBlock(N,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[3]||(M[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var xe,Se,st;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":E.categoryItem.isHidden,"text-gray-400":(xe=f.value)==null?void 0:xe.isDisabled})},[i.createVNode(N,{disabled:!E.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E.categoryItem.name),1)]),default:i.withCtx(()=>[M[4]||(M[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:M[0]||(M[0]=i.withModifiers((...Ke)=>i.unref(W.noop)&&i.unref(W.noop)(...Ke),["prevent","stop"]))},[(Se=E.categoryItem.properties)!=null&&Se.m2Price?(i.openBlock(),i.createBlock(U,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(E.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(U,{key:1,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((st=f.value)!=null&&st.manager)?(i.openBlock(),i.createBlock(U,{key:2,size:i.unref(n),closable:!0,round:"",onClose:$},{default:i.withCtx(()=>[i.createVNode(N,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ke,nt;return[i.createElementVNode("span",yf,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString((nt=(Ke=f.value)==null?void 0:Ke.manager)==null?void 0:nt.name),1)])]}),default:i.withCtx(()=>{var Ke,nt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((nt=(Ke=f.value)==null?void 0:Ke.manager)==null?void 0:nt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[E.showSlugs||E.showProperties?(i.openBlock(),i.createElementBlock("div",bf,[i.createElementVNode("ul",wf,[E.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:E.categoryItem.id,slug:E.categoryItem.slug},(xe,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0),E.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(E.categoryItem.properties,(xe,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var xe;return[i.createElementVNode("div",vf,[d.value?(i.openBlock(),i.createBlock(N,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{size:i.unref(n),onClick:B},{default:i.withCtx(()=>{var Se;return[(Se=f.value)!=null&&Se.isDisabled?(i.openBlock(),i.createBlock(F,{key:1})):(i.openBlock(),i.createBlock(I,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Se;return[(Se=f.value)!=null&&Se.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((xe=f.value)!=null&&xe.manager)?(i.openBlock(),i.createBlock(N,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{size:i.unref(n),onClick:k},{default:i.withCtx(()=>[i.createVNode(pe)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Se,st,Ke;return[(Se=f.value)!=null&&Se.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ke=(st=f.value)==null?void 0:st.manager)==null?void 0:Ke.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(N,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{ghost:!0,size:i.unref(n),type:"primary",onClick:P},{default:i.withCtx(()=>[i.createVNode(ie)]),_:1},8,["size"])]),default:i.withCtx(()=>[M[5]||(M[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(re,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:R},{default:i.withCtx(()=>[i.createVNode(J,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(ge)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(E.$slots,"default",{},()=>{var xe;return[s.value?(i.openBlock(),i.createBlock(va,{key:0,"categories-items":E.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":E.eventEmitter,"filtered-items":r.value?((xe=r.value)==null?void 0:xe.categories)??{}:void 0,"selected-categories-items":E.selectedCategoriesItems,"selected-products-items":E.selectedProductsItems,"show-slugs":E.showSlugs,"show-properties":E.showProperties,"show-product-costs":E.showProductCosts,"allow-name-click":E.allowNameClick,"allow-price-click":E.allowPriceClick,"show-price-history":E.showPriceHistory,"show-product-add-to-cart-button":E.showProductAddToCartButton,"show-product-edit-button":E.showProductEditButton,"product-context-buttons-config":E.productContextButtonsConfig,"show-hide-for-client-button":E.showHideForClientButton,"show-pin-button":E.showPinButton,"show-category-edit-button":E.showCategoryEditButton,"category-context-buttons-config":E.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Me,{key:1,columns:Y.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":Se=>Se.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Fe,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(Fe,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Ge,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>M[6]||(M[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Cf=Ln(xf,[["__scopeId","data-v-56546932"]]),Sf={class:"sc-collapse flex w-full flex-col"},Bf={},wa=i.defineComponent({...Bf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",Sf,[i.renderSlot(o.$slots,"default")]))}}),Tf={},va=i.defineComponent({...Tf,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(vr,"medium"),r=i.computed(()=>W.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(W.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=V.NSpin,c=V.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(wa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Cf,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Ef={class:"text-sm"},$f={class:"text-sm"},Nf={},Rf=i.defineComponent({...Nf,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,u,p,f,g;const n=e,r=i.ref(new H.CartItemBase(n.cartItem??new H.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(u=n.product)==null?void 0:u.properties)!=null&&p.ignoreMinCountCheck?0:(g=(f=n.product)==null?void 0:f.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,x,v,B,k,$,P;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),_=($=(k=n.product)==null?void 0:k.properties)==null?void 0:$.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{H.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(H.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(H.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(V.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(H.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(H.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(H.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(H.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ef,"Метраж должен быть кратен "+i.toDisplayString(i.unref(H.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(H.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(H.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(H.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(H.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(H.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",$f,"Количество должно быть кратно "+i.toDisplayString(i.unref(H.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),Pf={},ka=i.defineComponent({...Pf,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=new H.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=W.isUndefined(r.value)?f:r.value;return W.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=f=>{var g;if(W.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f===a.id||(g=c.value.find(_=>_.value===f))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":f.consistentMenuWidth,disabled:f.disabled||c.value.length===0,filterable:f.filterable,"max-tag-count":f.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Ff={},Mf=i.defineComponent({...Ff,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,x;const n=e,r=t,s=()=>{const v=H.PriceCoefficient.getRetailPriceCoefficient();return W.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,$,P;return v.id===s().id?(B=l.value)==null?void 0:B.cost:(P=($=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:$.find(R=>R.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=H.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const $=c(k);$?k.name+=` (${$} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((x=(S=n.value)==null?void 0:S.value)==null?void 0:x.toString())??null),p=i.ref(null),f=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===H.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,$;g.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const P=s(),R=c(h.value??P)??0,j=R+R*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(j),j>(((k=l.value)==null?void 0:k.cost)??j)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&j<((($=f.value)==null?void 0:$.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},_=v=>{W.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),m())},y=()=>{h.value||(h.value=s()),m()},b=v=>{var k,$,P,R,j,Y;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let A=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((k=f.value)==null?void 0:k.cost)??0))h.value=($=f.value)==null?void 0:$.coefficient,A=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.cost)??B)){h.value=s();const E=((R=l.value)==null?void 0:R.cost)??0;A=(B-E)*100/E,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const E=(Y=(j=l.value)==null?void 0:j.priceCoefficients)==null?void 0:Y.filter(M=>M.cost<B);if(E&&E.length>0){const M=E.at(-1);h.value=M==null?void 0:M.coefficient,A=(B-((M==null?void 0:M.cost)??0))*100/((M==null?void 0:M.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(A),r("update:value",{value:Number.isNaN(A)?void 0:A,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return(v,B)=>{var P,R,j;const k=V.NInput,$=V.NInputGroup;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{"show-label":!i.unref(W.isNil)(v.label),label:v.label,"show-feedback":!i.unref(W.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((R=g.value)==null?void 0:R.feedback)??v.feedback,"validation-status":((j=g.value)==null?void 0:j.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"grid-cols-1":!a.value||v.calculationType===i.unref(H.CalculationTypeEnum).m2Cost,"grid-cols-3":a.value&&v.calculationType!==i.unref(H.CalculationTypeEnum).m2Cost},"grid w-full gap-2"])},[v.calculationType!==i.unref(H.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock($,{key:0,class:i.normalizeClass({"col-span-2":a.value})},{default:i.withCtx(()=>[i.createVNode(ka,{value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":_},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=Y=>u.value=Y),y],clearable:v.clearable,disabled:v.disabled,placeholder:""},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%"))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + "))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(H.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=Y=>p.value=Y),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var Y;return[i.createTextVNode(i.toDisplayString((Y=l.value)==null?void 0:Y.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Af={class:"flex flex-row gap-1"},Vf={class:"sc-client-name flex flex-col gap-1 text-base"},Of=["href"],If={key:1,class:"text-sc-grey"},zf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Lf={key:0},Df={key:1,class:"text-sm"},Hf={},Sr=i.defineComponent({...Hf,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Sn.format(n.client.lastLoginAt,H.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{W.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Cs,d=V.NButton,h=V.NPopover;return i.openBlock(),i.createElementBlock("div",Af,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(W.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Vf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",If," [ Деактивирован ] "))],8,Of),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",zf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Lf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Df," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Wf={class:"text-base"},jf={},xa=i.defineComponent({...jf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Wf,i.toDisplayString(t.contragent.name),1))}}),Xf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qf(e,t){return i.openBlock(),i.createElementBlock("svg",Xf,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)]))}const Yf=i.markRaw({name:"tabler-mail",render:qf}),Uf=["href"],Gf={},Kf=i.defineComponent({...Gf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Yf;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,Uf)],2)}}}),Zf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jf(e,t){return i.openBlock(),i.createElementBlock("svg",Zf,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)]))}const Ca=i.markRaw({name:"fa6-brands-viber",render:Jf}),Qf={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},ep=["id"],tp=["id"],np=["fill"],ip=["fill"];function rp(e,t){return i.openBlock(),i.createElementBlock("svg",Qf,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,ep),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,tp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,np),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,ip),t[2]||(t[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Sa=i.markRaw({name:"logos-whatsapp-icon",render:rp,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),sp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},op=["id"],ap=["fill"];function lp(e,t){return i.openBlock(),i.createElementBlock("svg",sp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,op)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,ap),t[1]||(t[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Ba=i.markRaw({name:"logos-telegram",render:lp,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),cp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function dp(e,t){return i.openBlock(),i.createElementBlock("svg",cp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)]))}const Ta=i.markRaw({name:"ion-call",render:dp}),hp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function up(e,t){return i.openBlock(),i.createElementBlock("svg",hp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)]))}const fp=i.markRaw({name:"tabler-phone-call",render:up}),pp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},gp=["href"],mp=["href"],_p=["href"],yp=["href"],bp={},wp=i.defineComponent({...bp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Wi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return W.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=fp,h=Ta,u=Ba,p=Sa,f=Ca;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":l.showPhoneIcon})},[l.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",pp,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(h)],8,gp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,mp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,_p)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,yp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),vp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kp(e,t){return i.openBlock(),i.createElementBlock("svg",vp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)]))}const xp=i.markRaw({name:"mdi-envelope",render:kp}),Cp={class:"flex flex-col gap-1"},Sp={key:0,class:"mb-2 flex flex-col text-base"},Bp={key:0,class:"text-sc-dark-grey text-sm"},Tp={key:1,class:"whitespace-nowrap text-sm"},Ep={key:2,class:"whitespace-nowrap text-sm"},$p={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Np=["href"],Rp=["href"],Pp=["href"],Fp=["href"],Mp=["href"],Ap={key:0,class:"flex flex-col text-base"},Vp={key:0,class:"text-sc-dark-grey text-sm"},Op={key:1,class:"mt-2 text-sm"},Ip={key:0,class:"-mt-1"},zp={},Lp=i.defineComponent({...zp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Wi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return W.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return W.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return W.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Ta,u=Ba,p=Sa,f=Ca,g=xp,m=V.NPopover;return i.openBlock(),i.createElementBlock("div",Cp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",Sp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",Bp,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Tp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Ep,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",$p,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,Np)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Rp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Pp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,Fp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Mp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Ap,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Vp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=c.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",Op,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Ip,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=c.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Dp={key:0,class:"flex w-fit items-center gap-2"},Hp={key:1,class:"flex flex-wrap gap-1"},Wp={key:0},jp={},qi=i.defineComponent({...jp,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=V.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Dp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Hp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Wp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Xp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qp(e,t){return i.openBlock(),i.createElementBlock("svg",Xp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)]))}const Br=i.markRaw({name:"ion-close",render:qp}),Yp={class:"mr-3 flex flex-col gap-2"},Up=["onClick"],Gp={class:"h-full p-2"},Kp={},Zp=i.defineComponent({...Kp,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Br;return i.openBlock(),i.createBlock(i.unref(V.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(V.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Gp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Up)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ea=Ln(Zp,[["__scopeId","data-v-828c3059"]]),Jp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Qp(e,t){return i.openBlock(),i.createElementBlock("svg",Jp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)]))}const $a=i.markRaw({name:"ion-trash",render:Qp}),eg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tg(e,t){return i.openBlock(),i.createElementBlock("svg",eg,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Na=i.markRaw({name:"ion-plus",render:tg}),ng={class:"flex flex-col gap-4"},ig={class:"flex flex-col gap-2"},rg={class:"mt-8 font-bold"},sg={class:"grid grow grid-cols-2 items-start gap-2"},og={class:"flex flex-col gap-4"},ag={class:"flex gap-3"},lg={},Ra=i.defineComponent({...lg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new H.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=W.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Na,u=$a,p=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,m,_,y,b,S,x,v;return[i.createElementVNode("div",ng,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ig,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var $,P,R,j,Y,A;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",rg,i.toDisplayString(k+1),1),i.createElementVNode("div",sg,[i.createVNode(i.unref(V.NFormItem),{label:"Ширина, мм",required:!0,feedback:(($=c.validation[`lines_widths[${k+1}]`])==null?void 0:$.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[E=>s.value.linesWidths[k]=E,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:E=>E%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((j=c.validation[`lines_angles[${k+1}]`])==null?void 0:j.feedback)||"","show-feedback":((Y=c.validation[`lines_angles[${k+1}]`])==null?void 0:Y.showFeedback)||!1,"validation-status":(A=c.validation[`lines_angles[${k+1}]`])==null?void 0:A.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[E=>s.value.linesAngles[k]=E,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:E=>E%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(V.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,size:"medium",onClick:E=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:E=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",og,[i.createVNode(i.unref(V.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((f=c.validation.length)==null?void 0:f.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((_=c.validation.quantity)==null?void 0:_.showFeedback)||!1,feedback:((y=c.validation.quantity)==null?void 0:y.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((x=c.validation.marker)==null?void 0:x.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",ag,[i.createVNode(i.unref(V.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Pa=Object.defineProperty,cg=Object.defineProperties,dg=Object.getOwnPropertyDescriptors,Fa=Object.getOwnPropertySymbols,hg=Object.prototype.hasOwnProperty,ug=Object.prototype.propertyIsEnumerable,Bs=(e,t,n)=>t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ts=(e,t)=>{for(var n in t||(t={}))hg.call(t,n)&&Bs(e,n,t[n]);if(Fa)for(var n of Fa(t))ug.call(t,n)&&Bs(e,n,t[n]);return e},Es=(e,t)=>cg(e,dg(t)),Ma=(e,t)=>{for(var n in t)Pa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Bs(e,typeof t!="symbol"?t+"":t,n),n),Aa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},St=(e,t,n)=>(Aa(e,t,"read from private field"),n?n.call(e):t.get(e)),Va=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},fg=(e,t,n,r)=>(Aa(e,t,"write to private field"),t.set(e,n),n),yt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return yt.shim(e),typeof t<"u"&&(yt.Image=t),yt.isHeadless=!0,e}},Oa={};Ma(Oa,{Curve:()=>vi,getAnchorsFromArcData:()=>mg,getComponentOnCubicBezier:()=>Yi,getControlPoints:()=>Ga,getCurveBoundingBox:()=>qa,getCurveFromPoints:()=>Ua,getCurveLength:()=>Xa,getReflection:()=>Rs,integrate:()=>Ya,subdivide:()=>Ns});var Ia={};Ma(Ia,{HALF_PI:()=>Ze,NumArray:()=>Gt,TWO_PI:()=>ct,decomposeMatrix:()=>wi,getComputedMatrix:()=>Da,getPoT:()=>Ha,lerp:()=>Nt,mod:()=>Rt,setMatrix:()=>La,toFixed:()=>Re});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var za,ct=Math.PI*2,Ze=Math.PI*.5;function wi(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function La(e){za=e}function Da(e,t){t=t&&t.identity()||new za;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Nt(e,t,n){return n*(t-e)+e}var $s=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Ha(e){let t=0;for(;$s[t]&&$s[t]<e;)t++;return $s[t]}function Rt(e,t){for(;e<0;)e+=t;return e%t}var Gt=De.Float32Array||Array,pg=Math.floor;function Re(e){return pg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},q=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var Wa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(q.Types.change))}}},Ht=class extends q{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in Wa)Object.defineProperty(this,n,Wa[n]);this.x=e,this.y=t}static add(e,t){return new Ht(e.x+t.x,e.y+t.y)}static sub(e,t){return new Ht(e.x-t.x,e.y-t.y)}static subtract(e,t){return Ht.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(Ht.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Ht(this.x,this.y)}add(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Re(this.x),y:Re(this.y)}}rotate(e){const t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},Z=Ht;w(Z,"zero",new Ht),w(Z,"left",new Ht(-1,0)),w(Z,"right",new Ht(1,0)),w(Z,"up",new Ht(0,-1)),w(Z,"down",new Ht(0,1));var ve=class extends Z{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",ee.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in ja)Object.defineProperty(this,d,ja[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(q.Types.change,c),this.controls.right.set(o,a).addEventListener(q.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(q.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().copy(this)}toObject(){return{x:Re(this.x),y:Re(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Re(this.rx),ry:Re(this.ry),xAxisRotation:Re(this.xAxisRotation),largeArcFlag:Re(this.largeArcFlag),sweepFlag:Re(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},ja={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(q.Types.change))}}},gg=0,bt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return gg++}},vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Yi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ns(e,t,n,r,s,o,a,l,c){c=c||vi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Yi(p,e,n,s,a),g=Yi(p,t,r,o,l);h.push(new ve(f,g))}return h}function Xa(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return Ya(m,0,1,c||vi.RecursionLimit)}function qa(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ya(e,t,n,r){let s=vi.abscissas[r-2],o=vi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Ua(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Rt(s-1,n):Math.max(s-1,0),l=t?Rt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ga(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ga(e,t,n){const r=Z.angleBetween(e,t),s=Z.angleBetween(n,t);let o=Z.distanceBetween(e,t),a=Z.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Ze:l-=Ze,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Rs(e,t,n){return new Z(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function mg(e,t,n,r,s,o,a){const l=bt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),p=r*Math.sin(h),f=new ve(u,p);f.command=ee.line}}var Ka=Array.prototype.slice;function _g(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Ka.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Ka.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!_g(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:De.performance&&De.performance.now?De.performance:Date},Pt={hasEventListeners:typeof De.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),Pt},unbind:function(e,t,n,r){return Pt.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),Pt},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=De[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=De.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},ki=De.document?De.document.createElement("div"):{};ki.id="help-two-load",Object.defineProperty(Pt,"temp",{enumerable:!0,get:function(){return ae.isElement(ki)&&!De.document.head.contains(ki)&&(ki.style.display="none",De.document.head.appendChild(ki)),ki}});var Bt=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},yg=De.devicePixelRatio||1;function bg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ps(e){return yg/bg(e)}var Tr=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},dt,Bn=class extends Array{constructor(){super(),Va(this,dt,new q),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return St(this,dt)}set _events(t){fg(this,dt,t)}get _bound(){return St(this,dt)._bound}set _bound(t){St(this,dt)._bound=t}addEventListener(){return St(this,dt).addEventListener.apply(this,arguments)}on(){return St(this,dt).on.apply(this,arguments)}bind(){return St(this,dt).bind.apply(this,arguments)}removeEventListener(){return St(this,dt).removeEventListener.apply(this,arguments)}off(){return St(this,dt).off.apply(this,arguments)}unbind(){return St(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return St(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return St(this,dt).trigger.apply(this,arguments)}listen(){return St(this,dt).listen.apply(this,arguments)}ignore(){return St(this,dt).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(q.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(q.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(q.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(q.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(q.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(q.Types.insert,n),this.trigger(q.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};dt=new WeakMap;var Za=class extends q{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",bt.Identifier+bt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in Ja)Object.defineProperty(this,e,Ja[e])}static fromObject(e){const t=new Za().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Dn=Za;w(Dn,"Properties",["renderer","id","className"]);var Ja={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Er,Qa={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Er=document.createElement("a"));var Je=class extends Dn{constructor(e,t){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let n in el)Object.defineProperty(this,n,el[n]);if(this._renderer.type="texture",this._renderer.flagOffset=wg.bind(this),this._renderer.flagScale=vg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(q.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(q.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Je().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Er?(Er.href=e,Er.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=Je.getAbsoluteURL(e);if(Je.ImageRegistry.contains(t))return Je.ImageRegistry.get(t);let n;return yt.Image?(n=new yt.Image,yt.shim(n,"img")):De.document?Qa.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Je.getTag(n);e._flagImage&&(/canvas/i.test(r)?Je.Register.canvas(e,t):(e._src=!yt.isHeadless&&n.getAttribute("two-src")||n.src,Je.Register[r](e,t))),e._flagSrc&&(n||(n=Je.getImage(e.src),e.image=n),r=Je.getTag(n),Je.Register[r](e,t))}clone(){const e=new Je(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Je.load(this,(function(){this.loaded=!0,this.trigger(q.Types.change).trigger(q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Ee=Je;w(Ee,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Ee,"RegularExpressions",Qa),w(Ee,"ImageRegistry",new Tr),w(Ee,"Register",{canvas:function(e,t){e._src="#"+e.id,Je.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!yt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!yt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Bt("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!yt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Je.getAbsoluteURL(e._src),!(!yt.isHeadless&&n&&n.getAttribute("two-src"))&&(yt.isHeadless||n.setAttribute("two-src",e.src),Je.ImageRegistry.add(e.src,n),yt.isHeadless?Je.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(yt.isHeadless)throw new Bt("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new Bt("unable to load "+e.src)};e._src=Je.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Je.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var el={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Ee.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Ee.ImageRegistry.contains(n)?this._image=Ee.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(q.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(q.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function wg(){this._flagOffset=!0}function vg(){this._flagScale=!0}var Wt=class extends Dn{constructor(e,t,n){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let r in tl)Object.defineProperty(this,r,tl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Wt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Wt.Index<=0?"#fff":"#000",Wt.Index=(Wt.Index+1)%2}static fromObject(e){const t=new Wt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Wt.Properties.length;t++){const n=Wt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Wt;return ae.each(Wt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(Wt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Kt=Wt;w(Kt,"Index",0),w(Kt,"Properties",["offset","opacity","color"]);var tl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Hn=class extends Dn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in nl)Object.defineProperty(this,t,nl[t]);this._renderer.type="gradient",this._renderer.flagStops=kg.bind(this),this._renderer.bindStops=xg.bind(this),this._renderer.unbindStops=Cg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof Kt?r:new Kt().copy(r)));const n=new Hn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new Hn(t);return ae.each(Hn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<Hn.Properties.length;t++){const n=Hn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(Hn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},qe=Hn;w(qe,"Stop",Kt),w(qe,"Properties",["spread","stops","units"]);var nl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(q.Types.insert,t).unbind(q.Types.remove,n),this._stops=new Bn((e||[]).slice(0)),this._stops.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._stops)}}};function kg(){this._flagStops=!0}function xg(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Cg(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ui=class extends qe{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in il)Object.defineProperty(this,o,il[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Sg.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ui().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ui.Properties.length;t++){const n=Ui.Properties[t];n in e&&(this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ui(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(qe.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ve=Ui;w(Ve,"Stop",Kt),w(Ve,"Properties",["left","right"]);var il={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(q.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Z&&this._right.unbind(q.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Sg(){this._flagEndPoints=!0}var Wn=class extends qe{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in rl)Object.defineProperty(this,a,rl[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Bg.bind(this),this._renderer.flagFocal=Tg.bind(this),this.center=new Z,this.radius=typeof n=="number"?n:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Wn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Wn.Properties.length;t++){const n=Wn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Wn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(qe.Properties.concat(Wn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Wn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Oe=Wn;w(Oe,"Stop",Kt),w(Oe,"Properties",["center","radius","focal"]);var rl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(q.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(q.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Bg(){this._flagCenter=!0}function Tg(){this._flagFocal=!0}function sl(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function $r(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function ol(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Xa(r,l,s,c,o,d,a,h,n)}function al(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ns(r,l,s,c,o,d,a,h,n)}function jn(e){switch(e.renderer.type){case"texture":return Ee.fromObject(e);case"gradient":return qe.fromObject(e);case"linear-gradient":return Ve.fromObject(e);case"radial-gradient":return Oe.fromObject(e)}return e}var Eg=Math.cos,$g=Math.sin,ll=Math.tan,Fs=[],Ft=class extends q{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Gt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,$;const P=t[0]||0,R=t[1]||0,j=t[2]||0;return B=v[0]*P+v[1]*R+v[2]*j,k=v[3]*P+v[4]*R+v[5]*j,$=v[6]*P+v[7]*R+v[8]*j,[B,k,$]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],u=e[8],p=t[0],f=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Gt(9),n[0]=r*p+s*m+o*b,n[1]=r*f+s*_+o*S,n[2]=r*g+s*y+o*x,n[3]=a*p+l*m+c*b,n[4]=a*f+l*_+c*S,n[5]=a*g+l*y+c*x,n[6]=d*p+h*m+u*b,n[7]=d*f+h*_+u*S,n[8]=d*g+h*y+u*x,n}static fromObject(e){return new Ft().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(q.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(q.Types.change)}identity(){return this.elements[0]=Ft.Identity[0],this.elements[1]=Ft.Identity[1],this.elements[2]=Ft.Identity[2],this.elements[3]=Ft.Identity[3],this.elements[4]=Ft.Identity[4],this.elements[5]=Ft.Identity[5],this.elements[6]=Ft.Identity[6],this.elements[7]=Ft.Identity[7],this.elements[8]=Ft.Identity[8],this.trigger(q.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(q.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const A=s[0]*e+s[1]*t+s[2]*n,E=s[3]*e+s[4]*t+s[5]*n,M=s[6]*e+s[7]*t+s[8]*n;return[A,E,M]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],p=d[1],f=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],x=h[0],v=h[1],B=h[2],k=h[3],$=h[4],P=h[5],R=h[6],j=h[7],Y=h[8];return this.elements[0]=u*x+p*k+f*R,this.elements[1]=u*v+p*$+f*j,this.elements[2]=u*B+p*P+f*Y,this.elements[3]=g*x+m*k+_*R,this.elements[4]=g*v+m*$+_*j,this.elements[5]=g*B+m*P+_*Y,this.elements[6]=y*x+b*k+S*R,this.elements[7]=y*v+b*$+S*j,this.elements[8]=y*B+b*P+S*Y,this.trigger(q.Types.change)}inverse(e){const t=this.elements;e=e||new Ft;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=h*a-l*d,p=-h*o+l*c,f=d*o-a*c;let g=n*u+r*p+s*f;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=f*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Eg(e),n=$g(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=ll(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=ll(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Fs.length=0,this.toTransformArray(e,Fs),Fs.map(Re).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,u,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=u,t[8]=p;return}return[s,o,a,l,c,d,h,u,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ft().copy(this)}},Xn=Ft;w(Xn,"Identity",[1,0,0,0,1,0,0,0,1]),La(Xn);var Ms=class extends Dn{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Nr)Object.defineProperty(this,e,Nr[e]);this._renderer.flagMatrix=cl.bind(this),this.isShape=!0,this.matrix=new Xn,this.worldMatrix=new Xn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Ms().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Nr.position.get.apply(this,arguments)}set translation(e){Nr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Z?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Ms;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Z?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Z?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},hn=Ms;w(hn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Nr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(q.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(q.Types.change,this._renderer.flagMatrix),cl.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(q.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&this._scale.bind(q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Da(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function cl(){this._flagMatrix=!0}var xi=Math.min,Ci=Math.max,Ng=Math.ceil,Rg=Math.floor,Pg=new Z,Tn=class extends hn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in dl)Object.defineProperty(this,s,dl[s]);this._renderer.type="path",this._renderer.flagVertices=hl.bind(this),this._renderer.bindVertices=ul.bind(this),this._renderer.unbindVertices=fl.bind(this),this._renderer.flagFill=pl.bind(this),this._renderer.flagStroke=gl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Tn().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Tn.Properties.length;t++){const n=Tn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Tn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Tn.Properties.length;n++){const r=Tn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Tn.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:p}=wi(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof p=="number"&&(n=Math.max(u,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[u,p]=t.multiply(o.x,o.y),[f,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=o.controls.right.y;o.relative&&(m+=o.x,_+=o.y);let[y,b]=t.multiply(m,_),S=a.controls.left.x,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[v,B]=t.multiply(S,x);const k=qa(u,p,y,b,v,B,f,g);d=xi(k.min.y-n,d),l=xi(k.min.x-n,l),c=Ci(k.max.x+n,c),h=Ci(k.max.y+n,h)}else s<=1&&(d=xi(p-n,d),l=xi(u-n,l),c=Ci(u+n,c),h=Ci(p+n,h)),d=xi(g-n,d),l=xi(f-n,l),c=Ci(f+n,c),h=Ci(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,v=null;for(let K=0,F=this._lengths.length,N=0;K<F;K++){if(N+this._lengths[K]>=y){this._closed?(n=Rt(K,b),r=Rt(K-1,b),K===0&&(n=r,r=K)):(n=K,r=Math.min(Math.max(K-1,0),S)),x=this.vertices[n],v=this.vertices[r],y-=N,this._lengths[K]!==0?e=y/this._lengths[K]:e=0;break}N+=this._lengths[K]}if(x===null||v===null)return null;if(x){if(!v)return x}else return v;_=v.controls&&v.controls.right,m=x.controls&&x.controls.left,a=v.x,u=v.y,l=(_||v).x,p=(_||v).y,c=(m||x).x,f=(m||x).y,d=x.x,g=x.y,_&&v.relative&&(l+=v.x,p+=v.y),m&&x.relative&&(c+=x.x,f+=x.y),o=Yi(e,a,l,c,d),h=Yi(e,u,p,f,g);const B=Nt(a,l,e),k=Nt(u,p,e),$=Nt(l,c,e),P=Nt(p,f,e),R=Nt(c,d,e),j=Nt(f,g,e),Y=Nt(B,$,e),A=Nt(k,P,e),E=Nt($,R,e),M=Nt(P,j,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=Y,t.controls.left.y=A,t.controls.right.x=E,t.controls.right.y=M,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,Y-o,A-h,E-o,M-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Ua(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=al(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=al(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=ol(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=$r(this,n*this._length),o=$r(this,r*this._length),a=Ng(s),l=Rg(o);let c,d,h,u,p,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>l&&!d?(p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,p),p.command=this._renderer.collection[f].command,this._renderer.vertices.push(p),d=p,h=this._collection[f-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-p.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):f>=a&&f<=l&&(p=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(p),f===l&&sl(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):f===a&&sl(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(f=a-1,p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),u=this._collection[f+1],u&&u.controls&&(p.controls.left.clear(),u.relative?this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(Z.zero,p.t):(Pg.copy(u),this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(u,p.t))))}return hn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,hn.prototype.flagReset.call(this),this}},Ce=Tn;w(Ce,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(Ce,"Utils",{getCurveLength:ol});var dl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(q.Types.insert,t).unbind(q.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function hl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function ul(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fl(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function pl(){this._flagFill=!0}function gl(){this._flagStroke=!0}var Gi=class extends Ce{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in ml)Object.defineProperty(this,o,ml[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Gi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gi.Properties.length;t++){const n=Gi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Gi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},En=Gi;w(En,"Properties",["width","height"]);var ml={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(q.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ki=class extends En{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in _l)Object.defineProperty(this,a,_l[a]);this.noStroke(),this.noFill(),e instanceof Ee?this.texture=e:typeof e=="string"&&(this.texture=new Ee(e)),this.origin=new Z,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ki(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,u;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Nt(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,f=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*f+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Rr=Ki;w(Rr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var _l={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},As,yl=class extends Bn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),Va(this,As,{}),this.attach(t),this.on(q.Types.insert,this.attach),this.on(q.Types.remove,this.detach)}get ids(){return St(this,As)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};As=new WeakMap;var qn=class extends Ce{constructor(e,t,n,r,s,o,a){const l=a||bt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ct),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in bl)Object.defineProperty(this,d,bl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Rt(e,ct)===Rt(t,ct),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,p,f,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(p=h/u,f=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=r*m/Math.PI,f.controls.left.x=b*Math.cos(g-Ze),f.controls.left.y=b*Math.sin(g-Ze),f.controls.right.x=b*Math.cos(g+Ze),f.controls.right.y=b*Math.sin(g+Ze),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,u=l-1),h=0;h<l;h++)p=h/u,f=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=n*m/Math.PI,f.controls.left.x=b*Math.cos(g+Ze),f.controls.left.y=b*Math.sin(g+Ze),f.controls.right.x=b*Math.cos(g-Ze),f.controls.right.y=b*Math.sin(g-Ze),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new qn(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ce.Properties.length;l++){const c=Ce.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];e[n]=this[n]}return e}},Pr=qn;w(Pr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var bl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Vs=Math.cos,Os=Math.sin,Yn=class extends Ce{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in wl)Object.defineProperty(this,a,wl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Yn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Vs(a),c=n*Os(a),d=r*Vs(a-Ze),h=r*Os(a-Ze),u=r*Vs(a+Ze),p=r*Os(a+Ze),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Yn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];e[n]=this[n]}return e}},Zi=Yn;w(Zi,"Properties",["radius"]);var wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Is=Math.cos,zs=Math.sin,Un=class extends Ce{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in vl)Object.defineProperty(this,l,vl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Un().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Is(a),c=r*zs(a),d=n*t*Is(a-Ze),h=r*t*zs(a-Ze),u=n*t*Is(a+Ze),p=r*t*zs(a+Ze),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Un(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Ji=Un;w(Ji,"Properties",["width","height"]);var vl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Fg=Math.ceil,Mg=Math.floor,$n=class extends hn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",Ce.prototype.noFill),w(this,"noStroke",Ce.prototype.noStroke),w(this,"corner",Ce.prototype.corner),w(this,"center",Ce.prototype.center),w(this,"getBoundingClientRect",Ce.prototype.getBoundingClientRect),w(this,"_updateLength",Ce.prototype._updateLength);for(let t in kl)Object.defineProperty(this,t,kl[t]);this._renderer.type="points",this._renderer.flagVertices=hl.bind(this),this._renderer.bindVertices=ul.bind(this),this._renderer.unbindVertices=fl.bind(this),this._renderer.flagFill=pl.bind(this),this._renderer.flagStroke=gl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new $n().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<$n.Properties.length;t++){const n=$n.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new $n;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<$n.Properties.length;n++){const r=$n.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ns(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=$r(this,e*this._length),r=$r(this,t*this._length),s=Fg(n),o=Mg(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Fr=$n;w(Fr,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var kl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(q.Types.insert,t).unbind(q.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},Ag=Math.cos,Vg=Math.sin,Gn=class extends Ce{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in xl)Object.defineProperty(this,s,xl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Gn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s+Math.PI/2,a=this._width*Ag(o)/2,l=this._height*Vg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Gn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<Ce.Properties.length;n++){const r=Ce.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Mr=Gn;w(Mr,"Properties",["width","height","sides"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Kn=class extends Ce{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let a in Cl)Object.defineProperty(this,a,Cl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Og.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Z?r:new Z().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof Z?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new Kn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},Qi=Kn;w(Qi,"Properties",["width","height","radius"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Z&&this._radius.unbind(q.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Og(){this._flagRadius=!0}var Ig=Math.cos,zg=Math.sin,Zn=class extends Ce{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in Sl)Object.defineProperty(this,o,Sl[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Ig(o),c=a*zg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new Zn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<Ce.Properties.length;o++){const a=Ce.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ar=Zn;w(Ar,"Properties",["innerRadius","outerRadius","sides"]);var Sl={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Ls,Bl=Math.min,Tl=Math.max;De.document&&(Ls=document.createElement("canvas"));var Mt=class extends hn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in El)Object.defineProperty(this,s,El[s]);if(this._renderer.type="text",this._renderer.flagFill=Lg.bind(this),this._renderer.flagStroke=Dg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Mt.Properties.length;s++){const o=Mt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Ls){const t=Ls.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Mt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Mt().copy(Es(Ts({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Mt.Properties.length;t++){const n=Mt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Mt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Mt.Properties.length;n++){const r=Mt.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Mt.Properties.length;t++){const n=Mt.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Mt.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[u,p]=t.multiply(n,o),[f,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=Bl(h,p,g,_),n=Bl(d,u,f,m),r=Tl(d,u,f,m),o=Tl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},Ot=Mt;w(Ot,"Ratio",.6),w(Ot,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var El={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof qe||this._fill instanceof Ve||this._fill instanceof Oe||this._fill instanceof Ee)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof qe||this._stroke instanceof Ve||this._stroke instanceof Oe||this._stroke instanceof Ee)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Lg(){this._flagFill=!0}function Dg(){this._flagStroke=!0}var Vr=Math.min,Or=Math.max,Si=class extends hn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in $l)Object.defineProperty(this,t,$l[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Nl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Nl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Si;for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:jn(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Pr.fromObject(r);case"circle":return Zi.fromObject(r);case"ellipse":return Ji.fromObject(r);case"points":return Fr.fromObject(r);case"polygon":return Mr.fromObject(r);case"rectangle":return En.fromObject(r);case"rounded-rectangle":return Qi.fromObject(r);case"star":return Ar.fromObject(r);case"path":return Ce.fromObject(r);case"text":return Ot.fromObject(r);case"group":return Si.fromObject(r);case"shape":return hn.fromObject(r);case"element":return Dn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Si,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const f=this.children[p];if(!(!f.visible||u.test(f._renderer.type))&&(t=f.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[x,v]=n.multiply(t.right,t.bottom);d=Vr(m,y,S,v,d),l=Vr(g,_,b,x,l),c=Or(g,_,b,x,c),h=Or(m,y,S,v,h)}else d=Vr(t.top,d),l=Vr(t.left,l),c=Or(t.right,c),h=Or(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ue=Si;w(Ue,"Children",yl),w(Ue,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var $l={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ue.InsertChildren.bind(this),n=Ue.RemoveChildren.bind(this),r=Ue.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new yl(e),this._children.bind(q.Types.insert,t),this._children.bind(q.Types.remove,n),this._children.bind(q.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Nl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ds=class extends Ce{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Rl)Object.defineProperty(this,a,Rl[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Rl={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new Bt("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new Bt("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Zt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Hg={start:"left",middle:"center",end:"right"},Pl=["id","class","transform","xmlns","viewBox"],Wg=["x","y","width","height","href","xlink:href"];function jg(e){return Hg[e]}function Xg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function er(e){return e.replace(/svg:/gi,"").toLowerCase()}function Fl(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function qg(e,t){t||(t={});const n=e.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");t[l]=c}return t}function Yg(e){const t={},n=Ug(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function Ug(e){const t=e.getAttributeNames();for(let n=0;n<Pl.length;n++){const r=Pl[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function Gg(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<e.children.length;u++){const p=e.children[u];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Z(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new En(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function It(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,p,f,g,m,_,y,b,S,x,v,B;if(e===null)return r;if(De.getComputedStyle){const k=De.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?qg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=wi(l),t._renderer.type){case"linear-gradient":Fl(p,t.left),Fl(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=wi(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Z(p.scaleX,p.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(t.translation.x=f),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ue){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ue){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ue){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ue){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ue){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ue){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Zt.cssBackgroundImage.test(d)&&(m=d.replace(Zt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=er(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ue?"_":"")+c,Zt.cssBackgroundImage.test(d)?(m=d.replace(Zt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=er(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=Zg(this),y=_.getById(m)),t[h]=y):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof qe,x=t instanceof Ve,v=t instanceof Oe,S||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Bt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Ot&&(t.family=d);break;case"font-size":t instanceof Ot&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Bt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Ot&&(t.weight=d);break;case"font-style":t instanceof Ot&&(t.style=d);break;case"text-decoration":t instanceof Ot&&(t.decoration=d);break;case"line-height":t instanceof Ot&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function Kg(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||er(e.nodeName)==="#text"||t.add(s.id,s)}}function Zg(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new Tr,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)Kg(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,u=a!==null,p=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(Zt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Zt.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(Zt.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(Zt.unitSuffix,""))),d&&Gg(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Bt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Bt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<e.attributes.length;c++){const d=e.attributes[c],h=Wg.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=er(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ue;It.call(this,e,n,t),this.add(n);const r=Yg.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=er(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",It.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;ae.each(h.slice(0),function(p,f){const g=p.slice(1).trim().match(Zt.path),m=p[0],_=m.toLowerCase();let y,b,S,x,v;const B=[];switch(f===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,v=0;b<S;b+=y){if(x=m,v>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,f){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(Zt.path),o=y===b;let S,x,v,B,k,$,P,R,j,Y,A,E,M,K,F,N,X;switch(b){case"z":if(f>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const U=r[z];if(/m/i.test(U.command)){l=U;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),_=parseFloat(d[1]),g=new ve(m,_,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":Y=/h/i.test(b)?"x":"y",A=/x/i.test(Y)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[Y]=parseFloat(d[0]),g[A]=l[A],o&&(g[Y]+=l[Y]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new Z),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),$=parseFloat(d[3]),P=parseFloat(d[4]),R=parseFloat(d[5])):(j=Rs(l,c,o),v=j.x,B=j.y,k=parseFloat(d[0]),$=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])),o&&(v+=S,B+=x,k+=S,$+=x,P+=S,R+=x),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,R,k-P,$-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new Z),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),$=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])):(j=Rs(l,c,o),v=j.x,B=j.y,k=j.x,$=j.y,P=parseFloat(d[0]),R=parseFloat(d[1])),o&&(v+=S,B+=x,k+=S,$+=x,P+=S,R+=x),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,R,k-P,$-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,M=parseFloat(d[0]),K=parseFloat(d[1]),F=parseFloat(d[2]),N=parseFloat(d[3]),X=parseFloat(d[4]),P=parseFloat(d[5]),R=parseFloat(d[6]),o&&(P+=S,R+=x),E=new ve(P,R),E.command=ee.arc,E.rx=M,E.ry=K,E.xAxisRotation=F,E.largeArcFlag=N,E.sweepFlag=X,g=E,l=E,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Ce(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),It.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Zi(0,0,s);return o.stroke="none",o.fill="black",It.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new Ji(0,0,s,o);return a.stroke="none",a.fill="black",It.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new En(0,0,s,o);return c.stroke="none",c.fill="black",It.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new Qi(0,0,s,o,c);return d.stroke="none",d.fill="black",It.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ds(n,r,s,o).noFill();return It.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const f=e.children[p];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=f.getAttribute("stop-color"),_=f.getAttribute("stop-opacity"),y=f.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new Kt(g,m,_))}const u=new Ve(s,o,a,l,h);return u.spread=r,u.units=n,It.call(this,e,u,t),u},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<e.children.length;f++){const g=e.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),u.push(new Kt(m,_,y))}const p=new Oe(s,o,a,u,l,c);return p.spread=r,p.units=n,It.call(this,e,p,t),p},text:function(e,t){const n=jg(e.getAttribute("text-anchor"))||"left",r=Xg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Ot(s);return It.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Bt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Rr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),It.call(this,e,c,t),c}};function Ml(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Bi=class extends En{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Al)Object.defineProperty(this,s,Al[s]);this._renderer.flagTextures=Jg.bind(this),this._renderer.bindTextures=Qg.bind(this),this._renderer.unbindTextures=em.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Vl.bind(this)):this.textures=[Vl(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Bi.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Bi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Bi.Properties.length;t++){const n=Bi.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Bi(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Nt(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ee))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Ir=Bi;w(Ir,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Ir,"DefaultFrameRate",30);var Al={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(q.Types.insert,t).unbind(q.Types.remove,n),this._textures=new Bn((e||[]).slice(0)),this._textures.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function Jg(){this._flagTextures=!0}function Qg(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function em(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Vl(e){if(e instanceof Ee)return e;if(typeof e=="string")return new Ee(e)}var Hs=[],Ws=Math.max,tm=Math.min,Ol=Math.abs,zr=Math.sin,Lr=Math.cos,nm=Math.acos,Dr=Math.sqrt,Te={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Te?e:"path"},group:{renderChild:function(e){const t=Te.getRendererType(e._renderer.type);Te[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Hr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Te.getRendererType(r._renderer.type);Te[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Te.getRendererType(l._renderer.type);Te[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S,x,v,B,k,$,P,R,j,Y,A,E,M,K,F,N,X,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,M=this._mask,K=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||K||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,p=this._closed,f=this._renderer.vertices,g=f.length,m=g-1,F=Hr(r),X=this.dashes,F||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),M){const re=Te.getRendererType(M._renderer.type);Te[re].render.call(M,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Te.getRendererType(a._renderer.type);Te[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Te.getRendererType(s._renderer.type);Te[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),X&&X.length>0&&(e.lineDashOffset=X.offset||0,e.setLineDash(X)),e.beginPath();let U,O,I,J,pe,ie,ge;for(let re=0;re<g;re++)switch(b=f[re],A=b.x,E=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:U=b.rx,O=b.ry,I=b.xAxisRotation,J=b.largeArcFlag,pe=b.sweepFlag,_=p?Rt(re-1,g):Ws(re-1,0),y=f[_],ie=y.x,ge=y.y,Te.renderSvgArcCommand(e,ie,ge,U,O,J,pe,I,A,E);break;case ee.curve:_=p?Rt(re-1,g):Math.max(re-1,0),y=f[_],P=y.controls&&y.controls.right||Z.zero,R=b.controls&&b.controls.left||Z.zero,y._relative?(k=P.x+y.x,$=P.y+y.y):(k=P.x,$=P.y),b._relative?(v=R.x+b.x,B=R.y+b.y):(v=R.x,B=R.y),e.bezierCurveTo(k,$,v,B,A,E),re>=m&&p&&(S=x,j=b.controls&&b.controls.right||Z.zero,Y=S.controls&&S.controls.left||Z.zero,b._relative?(k=j.x+b.x,$=j.y+b.y):(k=j.x,$=j.y),S._relative?(v=Y.x+S.x,B=Y.y+S.y):(v=Y.x,B=Y.y),A=S.x,E=S.y,e.bezierCurveTo(k,$,v,B,A,E));break;case ee.line:e.lineTo(A,E);break;case ee.move:x=b,e.moveTo(A,E);break}return p&&e.closePath(),!K&&!n&&(Te.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),N&&e.restore()),Te.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),N&&e.restore())),F||e.restore(),K&&!n&&e.clip(),X&&X.length>0&&e.setLineDash(Hs),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,m=Hr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Te.getRendererType(a._renderer.type);Te[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Te.getRendererType(s._renderer.type);Te[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),e.beginPath();let S=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=wi(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<u;v++)p=h[v],f=p.x,g=p.y,e.moveTo(f+S,g),e.arc(f,g,S,0,ct);return n||(Te.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Te.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(Hs),this.flagReset()}},text:{render:function(e,t,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,p=this._decoration,f=this._direction,g=Hr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Te.alignments[this._alignment]||this._alignment,b=Te.baselines[this._baseline]||this._baseline;let S,x,v,B,k,$,P,R,j,Y,A;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const E=Te.getRendererType(a._renderer.type);Te[E].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=f,u)if(typeof u=="string")e.fillStyle=u;else{const E=Te.getRendererType(u._renderer.type);Te[E].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const E=Te.getRendererType(d._renderer.type);Te[E].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?($=u._renderer.scale.x,P=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale($,P),S=this._size/u._renderer.scale.y,x=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?($=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale($,P),S=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const E=e.measureText(this.value);let M=1;switch(p){case"underline":j=E.actualBoundingBoxDescent,A=E.actualBoundingBoxDescent;break;case"strikethrough":j=0,A=0,M=.5;break}switch(b){case"top":j+=this._size*M,A+=this._size*M;break;case"baseline":case"bottom":j-=this._size*M,A-=this._size*M;break}switch(y){case"left":case"start":R=0,Y=E.width;break;case"right":case"end":R=-E.width,Y=0;break;default:R=-E.width/2,Y=E.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,j),e.lineTo(Y,A),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(Hs),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ol(r),s=Ol(s);const h=(t-c)/2,u=(n-d)/2,p=Lr(l)*h+zr(l)*u,f=-zr(l)*h+Lr(l)*u,g=p*p,m=f*f;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const E=Dr(b);r=E*r,s=E*s,_=r*r,y=s*s}const S=_*m+y*g,x=(_*y-S)/S;let v=Dr(Ws(0,x));o===a&&(v=-v);const B=v*r*f/s,k=-v*s*p/r,$=Lr(l)*B-zr(l)*k+(t+c)/2,P=zr(l)*B+Lr(l)*k+(n+d)/2,R=Il(1,0,(p-B)/r,(f-k)/s),j=Il((p-B)/r,(f-k)/s,(-p-B)/r,(-f-k)/s)%ct,Y=R+j;im(e,$,P,r,s,R,Y,a===0,l)}},ht=class extends q{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ue,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ps(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(q.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Te.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ht,"Utils",Te);function im(e,t,n,r,s,o,a,l,c){const d=a-o,h=vi.Tolerance.epsilon,u=Math.abs(d)<h;let p=Rt(d,ct);p<h&&(u?p=0:p=ct),l===!0&&!u&&(p===ct?p=-ct:p=p-ct);for(let f=0;f<bt.Resolution;f++){const g=f/(bt.Resolution-1),m=o+g*p;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=_-t,v=y-n;_=x*b-v*S+t,y=x*S+v*b+n}e.lineTo(_,y)}}function Il(e,t,n,r){const s=e*n+t*r,o=Dr(e*e+t*t)*Dr(n*n+r*r);let a=nm(Ws(-1,tm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function Hr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?Rt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,p,f,g,m,_,y,b,S,x,v,B,k,$,P=Re(l.x),R=Re(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:x=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,$=l.sweepFlag,h=ee.arc+" "+x+" "+v+" "+B+" "+k+" "+$+" "+P+" "+R;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(p=Re(_.x+d.x),f=Re(_.y+d.y)):(p=Re(_.x),f=Re(_.y)),l.relative?(g=Re(y.x+l.x),m=Re(y.y+l.y)):(g=Re(y.x),m=Re(y.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+f+" "+g+" "+m+" "+P+" "+R;break;case ee.move:s=l,h=ee.move+" "+P+" "+R;break;default:h=l.command+" "+P+" "+R}a>=r&&t&&(l.command===ee.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(p=Re(b.x+l.x),f=Re(b.y+l.y)):(p=Re(b.x),f=Re(b.y)),u.relative?(g=Re(S.x+u.x),m=Re(S.y+u.y)):(g=Re(S.x),m=Re(S.y)),P=Re(u.x),R=Re(u.y),h+=" C "+p+" "+f+" "+g+" "+m+" "+P+" "+R),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=wi(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Z?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},zl=class extends q{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ue,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(q.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(zl,"Utils",se);var zt={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Bt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
41
41
  precision mediump float;
42
42
  attribute vec2 a_position;
43
43
 
@@ -100,30 +100,30 @@
100
100
  }
101
101
  gl_FragColor = texel;
102
102
  }
103
- `}},Wr=Xn.Multiply,em=[1,0,0,0,1,0,0,0,1],Nn=new Gt(9),tm=ht.Utils,zl=new Z,js=new Gt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Xn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)ye.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=ht.Utils.getRendererType(this._mask._renderer.type);ye[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)ye.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=zl.copy(t._renderer.scale).multiply(S),C=t._stroke,B=t._linewidth,v=t._fill,N=t._renderer.opacity||t._opacity,F=t._cap,P=t._join,q=t._miter,U=t._closed,M=t.dashes,E=_.length,A=E-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const K=t._renderer.rect.centroid,R=K.x,$=K.y;if(b.clearRect(0,0,y.width,y.height),v)if(typeof v=="string")b.fillStyle=v;else{const ge=ht.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.fillStyle=v._renderer.effect}if(C){if(typeof C=="string")b.strokeStyle=C;else{const ge=ht.Utils.getRendererType(C._renderer.type);ye[ge].render.call(C,b,t),b.strokeStyle=C._renderer.effect}B&&(b.lineWidth=B),q&&(b.miterLimit=q),P&&(b.lineJoin=P),!U&&F&&(b.lineCap=F)}typeof N=="number"&&(b.globalAlpha=N),M&&M.length>0&&(b.lineDashOffset=M.offset||0,b.setLineDash(M));let j,z,Y,I,V,J,pe,ie;b.save(),b.scale(x.x,x.y),b.translate(R,$),b.beginPath();for(let ge=0;ge<_.length;ge++){const re=_[ge];switch(f=re.x,g=re.y,re.command){case ee.close:b.closePath();break;case ee.arc:z=re.rx,Y=re.ry,I=re.xAxisRotation,V=re.largeArcFlag,J=re.sweepFlag,n=U?Rt(ge-1,E):Math.max(ge-1,0),r=_[n],pe=r.x,ie=r.y,tm.renderSvgArcCommand(b,pe,ie,z,Y,V,J,I,f,g);break;case ee.curve:n=U?Rt(ge-1,E):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=re.controls&&re.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=h.x+re.x,a=h.y+re.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,f,g),ge>=A&&U&&(s=j,u=re.controls&&re.controls.right||Z.zero,p=s.controls&&s.controls.left||Z.zero,re._relative?(l=u.x+re.x,c=u.y+re.y):(l=u.x,c=u.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),f=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,f,g));break;case ee.line:b.lineTo(f,g);break;case ee.move:j=re,b.moveTo(f,g);break}}U&&b.closePath(),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(C)||(m=C._renderer&&C._renderer.offset,m&&(b.save(),b.translate(-C._renderer.offset.x,-C._renderer.offset.y),b.scale(C._renderer.scale.x,C._renderer.scale.y),b.lineWidth=B/C._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,u=d.y,p=d.controls;let f,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=p.left,b=p.right,!(!y||!b)&&(f=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!f||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(f,m,r),s=Math.max(f,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=t[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,p;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const u=ht.Utils.getRendererType(this._mask._renderer.type);ye[u].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._size*o;let p=u;ye.isHidden.test(a)||(p+=l),r.width=Da(p),r.height=r.width;const f=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=ht.Utils.getRendererType(c._renderer.type);ye[_].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const _=ht.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,ct),s.restore(),closed&&s.closePath(),ye.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),ye.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,p=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let _,y;this._scale instanceof Z?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,u&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,f),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=zl.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const f=t._renderer.rect.centroid,g=f.x,m=f.y;let _,y,b,S,x,C,B,v,N,F,P;const q=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),q||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const U=ht.Utils.getRendererType(c._renderer.type);ye[U].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const U=ht.Utils.getRendererType(a._renderer.type);ye[U].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(u)){const U=r.measureText(t.value);switch(u){case"underline":N=U.actualBoundingBoxDescent,P=U.actualBoundingBoxDescent;break;case"strikethrough":N=0,P=0;break}v=-U.width/2,F=U.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(v,N),r.lineTo(F,P),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=ye.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!ye.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(ye.alignments[e._alignment]||e._alignment){case ye.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case ye.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=ht.Utils.getRendererType(this._mask._renderer.type);ye[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.text.getBoundingClientRect(this,this._renderer.rect),ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return this.flagReset()}},updateTexture:function(e,t){const n=ht.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(ye,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Bt("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Tr};ye.ctx=ye.canvas.getContext("2d");var Ll=class extends X{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(ye.canvas=e.offscreenElement,ye.ctx=ye.canvas.getContext("2d")),this.scene=new Ue,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Gt(em),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Bt("unable to create a webgl context. Try using another renderer.");r=zt.create(t,zt.path.vertex,zt.types.vertex),s=zt.create(t,zt.path.fragment,zt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=ye.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=ye.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,js,t.STATIC_DRAW),r=zt.create(t,zt.points.vertex,zt.types.vertex),s=zt.create(t,zt.points.fragment,zt.types.fragment),n=this.programs.points=ye.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ps(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(X.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Ll,"Utils",ye);var nm=ae.extend({Error:Bt,getRatio:Ps,read:ze,xhr:Fl},ae,yt,Oa,Ia),tr=class{constructor(e){w(this,"_events",new X),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:tr.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=tr.Types[n])}this.renderer=new tr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=im.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Pt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=rm.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(X.Types.resize,sm.bind(this)),this.scene=this.renderer.scene,tr.Instances.push(this),t.autostart&&nr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,nr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Pt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,t,n,r){const s=new Ds(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new Ce(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new En(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Zi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Ji(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ar(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new Ce(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Mr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Pr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Z(o,a))}}const r=new Fr(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new Ce(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new It(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Oe(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ie(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Rr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Vr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ue;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in ze))return null;const s=ze[r].call(this,e);return n?this.add(t&&s instanceof Ue?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ue;let r,s,o;const a=(function(l){for(Pt.temp.innerHTML=l,s=0;s<Pt.temp.children.length;s++)r=Pt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Pt.temp.children.length<=1?Pt.temp.children[0]:Pt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Fl(e,a),n):(a(e),n)}},he=tr;w(he,"NextFrameId",bt.NextFrameId),w(he,"Types",bt.Types),w(he,"Version",bt.Version),w(he,"PublishDate",bt.PublishDate),w(he,"Identifier",bt.Identifier),w(he,"Resolution",bt.Resolution),w(he,"AutoCalculateImportedMatrices",bt.AutoCalculateImportedMatrices),w(he,"Instances",bt.Instances),w(he,"uniqueId",bt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Bn),w(he,"Events",X),w(he,"Group",Ue),w(he,"Matrix",Xn),w(he,"Path",Ce),w(he,"Registry",Tr),w(he,"Element",Dn),w(he,"Shape",hn),w(he,"Text",It),w(he,"Vector",Z),w(he,"Gradient",qe),w(he,"ImageSequence",Vr),w(he,"LinearGradient",Oe),w(he,"RadialGradient",Ie),w(he,"Sprite",Rr),w(he,"Stop",Kt),w(he,"Texture",Ee),w(he,"ArcSegment",Pr),w(he,"Circle",Zi),w(he,"Ellipse",Ji),w(he,"Line",Ds),w(he,"Points",Fr),w(he,"Polygon",Mr),w(he,"Rectangle",En),w(he,"RoundedRectangle",Qi),w(he,"Star",Ar),w(he,"CanvasRenderer",ht),w(he,"SVGRenderer",Vl),w(he,"WebGLRenderer",Ll),w(he,"Commands",ee),w(he,"Utils",nm);function im(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function rm(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function sm(e,t){this.width=e,this.height=t,this.trigger(X.Types.resize,e,t)}var nr=Pt.getRequestAnimationFrame();function Dl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=nr(Dl)}nr.init=function(){Dl(),nr.init=function(){}};let Jt;typeof window<"u"?Jt=window:typeof global<"u"?Jt=global:typeof self<"u"&&(Jt=self);let Hl;const Jn=Math.PI*2,it=Math.PI*.5;function om(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function am(e){Hl=e}function lm(e,t){t=t&&t.identity()||new Hl;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Qt(e,t,n){return n*(t-e)+e}function Ti(e,t){for(;e<0;)e+=t;return e%t}const Wl=Jt.Float32Array||Array,cm=Math.floor;function en(e){return cm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){k(this,"_events",{});k(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}k(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const jl={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(G.Types.change))}}},ot=class ot extends G{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in jl)Object.defineProperty(this,s,jl[s]);this.x=n,this.y=r}static add(n,r){return new ot(n.x+r.x,n.y+r.y)}static sub(n,r){return new ot(n.x-r.x,n.y-r.y)}static subtract(n,r){return ot.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(ot.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ot(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:en(this.x),y:en(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};k(ot,"zero",new ot),k(ot,"left",new ot(-1,0)),k(ot,"right",new ot(1,0)),k(ot,"up",new ot(0,-1)),k(ot,"down",new ot(0,1));let we=ot;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);k(this,"controls",{left:new we,right:new we});k(this,"_command",fe.move);k(this,"_relative",!0);k(this,"_rx",0);k(this,"_ry",0);k(this,"_xAxisRotation",0);k(this,"_largeArcFlag",0);k(this,"_sweepFlag",1);for(let h in Xl)Object.defineProperty(this,h,Xl[h]);this.command=c,this.relative=!0;const d=$e.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(G.Types.change,d),this.controls.right.set(a,l).addEventListener(G.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(G.Types.change)}}static fromObject(n){return new $e().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new $e().copy(this)}toObject(){return{x:en(this.x),y:en(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:en(this.rx),ry:en(this.ry),xAxisRotation:en(this.xAxisRotation),largeArcFlag:en(this.largeArcFlag),sweepFlag:en(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Xl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}}};let dm=0;const Xs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return dm++}},jr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Xr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function ql(e,t,n,r,s,o,a,l,c){c=c||jr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Xr(p,e,n,s,a),g=Xr(p,t,r,o,l);h.push(new $e(f,g))}return h}function hm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return fm(m,0,1,c||jr.RecursionLimit)}function um(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function fm(e,t,n,r){let s=jr.abscissas[r-2],o=jr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function pm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ti(s-1,n):Math.max(s-1,0),l=t?Ti(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];gm(c,d,h),d.command=s===0?fe.move:fe.curve}}function gm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=it:l-=it,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let ir=(pi=class extends G{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",Xs.Identifier+Xs.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Yl)Object.defineProperty(this,n,Yl[n])}static fromObject(n){const r=new pi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},k(pi,"Properties",["renderer","id","className"]),pi);const Yl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class qr extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class mm{constructor(){k(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Yr;const Ul={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Jt.document&&(Yr=document.createElement("a"));const He=class He extends ir{constructor(n,r){super();k(this,"_flagSrc",!1);k(this,"_flagImage",!1);k(this,"_flagVideo",!1);k(this,"_flagLoaded",!1);k(this,"_flagRepeat",!1);k(this,"_flagOffset",!1);k(this,"_flagScale",!1);k(this,"_src","");k(this,"_image",null);k(this,"_loaded",!1);k(this,"_repeat","no-repeat");k(this,"_scale",1);k(this,"_offset",null);for(let s in Gl)Object.defineProperty(this,s,Gl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=_m.bind(this),this._renderer.flagScale=ym.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,typeof r=="function"){const s=(function(){this.unbind(G.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(G.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new He().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Yr?(Yr.href=n,Yr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=He.getAbsoluteURL(n);if(He.ImageRegistry.contains(r))return He.ImageRegistry.get(r);let s;return Jt.document?Ul.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=He.getTag(s);n._flagImage&&(/canvas/i.test(o)?He.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,He.Register[o](n,r))),n._flagSrc&&(s||(s=He.getImage(n.src),n.image=s),o=He.getTag(s),He.Register[o](n,r))}clone(){const n=new He(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(G.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,He.load(this,(function(){this.loaded=!0,this.trigger(G.Types.change).trigger(G.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(He,"Properties",["src","loaded","repeat","scale","offset","image"]),k(He,"RegularExpressions",Ul),k(He,"ImageRegistry",new mm),k(He,"Register",{canvas:function(n,r){n._src="#"+n.id,He.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new qr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=He.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new qr("unable to load "+n.src)};n._src=He.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let rt=He;const Gl={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=rt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}rt.ImageRegistry.contains(n)?this._image=rt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(G.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function _m(){this._flagOffset=!0}function ym(){this._flagScale=!0}class Ei extends Array{constructor(){super();ha(this,at,new G);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Ct(this,at)}set _events(n){Vh(this,at,n)}get _bound(){return Ct(this,at)._bound}set _bound(n){Ct(this,at)._bound=n}addEventListener(){return Ct(this,at).addEventListener.apply(this,arguments)}on(){return Ct(this,at).on.apply(this,arguments)}bind(){return Ct(this,at).bind.apply(this,arguments)}removeEventListener(){return Ct(this,at).removeEventListener.apply(this,arguments)}off(){return Ct(this,at).off.apply(this,arguments)}unbind(){return Ct(this,at).unbind.apply(this,arguments)}dispatchEvent(){return Ct(this,at).dispatchEvent.apply(this,arguments)}trigger(){return Ct(this,at).trigger.apply(this,arguments)}listen(){return Ct(this,at).listen.apply(this,arguments)}ignore(){return Ct(this,at).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(G.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(G.Types.insert,r),this.trigger(G.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(G.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(G.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}at=new WeakMap;const Kl=Array.prototype.slice;function bm(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!bm(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:Jt.performance&&Jt.performance.now?Jt.performance:Date},Et=class Et extends ir{constructor(n,r,s){super();k(this,"_flagOffset",!0);k(this,"_flagOpacity",!0);k(this,"_flagColor",!0);k(this,"_offset",0);k(this,"_opacity",1);k(this,"_color","#fff");for(let o in Zl)Object.defineProperty(this,o,Zl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Et.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Et.Index<=0?"#fff":"#000",Et.Index=(Et.Index+1)%2}static fromObject(n){const r=new Et().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Et.Properties.length;r++){const s=Et.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Et;return Ae.each(Et.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Ae.each(Et.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Et,"Index",0),k(Et,"Properties",["offset","opacity","color"]);let Qn=Et;const Zl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},sn=class sn extends ir{constructor(n){super();k(this,"_flagStops",!1);k(this,"_flagSpread",!1);k(this,"_flagUnits",!1);k(this,"_spread","");k(this,"_units","");for(let r in Jl)Object.defineProperty(this,r,Jl[r]);this._renderer.type="gradient",this._renderer.flagStops=wm.bind(this),this._renderer.bindStops=vm.bind(this),this._renderer.unbindStops=km.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof Qn?o:new Qn().copy(o)));const s=new sn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new sn(r);return Ae.each(sn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<sn.Properties.length;r++){const s=sn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(sn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(sn,"Stop",Qn),k(sn,"Properties",["spread","stops","units"]);let Qe=sn;const Jl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(G.Types.insert,t).unbind(G.Types.remove,n),this._stops=new Ei((e||[]).slice(0)),this._stops.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._stops)}}};function wm(){this._flagStops=!0}function vm(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function km(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const On=class On extends Qe{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ql)Object.defineProperty(this,l,Ql[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=xm.bind(this),this.left=new we,this.right=new we,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new On(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(Qe.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(On,"Stop",Qn),k(On,"Properties",["left","right"]);let wt=On;const Ql={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function xm(){this._flagEndPoints=!0}const on=class on extends Qe{constructor(n,r,s,o,a,l){super(o);k(this,"_flagRadius",!1);k(this,"_flagCenter",!1);k(this,"_flagFocal",!1);k(this,"_radius",0);k(this,"_center",null);k(this,"_focal",null);for(let c in ec)Object.defineProperty(this,c,ec[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Cm.bind(this),this._renderer.flagFocal=Sm.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new on().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<on.Properties.length;r++){const s=on.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new on(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Qe.Properties.concat(on.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(on.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};k(on,"Stop",Qn),k(on,"Properties",["center","radius","focal"]);let vt=on;const ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(G.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Cm(){this._flagCenter=!0}function Sm(){this._flagFocal=!0}function tc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ur(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function nc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),hm(r,l,s,c,o,d,a,h,n)}function ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),ql(r,l,s,c,o,d,a,h,n)}function ei(e){switch(e.renderer.type){case"texture":return rt.fromObject(e);case"gradient":return Qe.fromObject(e);case"linear-gradient":return wt.fromObject(e);case"radial-gradient":return vt.fromObject(e)}return e}const Bm=Math.cos,Tm=Math.sin,rc=Math.tan,qs=[],xt=class xt extends G{constructor(n,r,s,o,a,l){super();k(this,"elements",new Wl(9));k(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const v=n;let N,F,P;const q=r[0]||0,U=r[1]||0,M=r[2]||0;return N=v[0]*q+v[1]*U+v[2]*M,F=v[3]*q+v[4]*U+v[5]*M,P=v[6]*q+v[7]*U+v[8]*M,[N,F,P]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],p=n[7],f=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],C=r[7],B=r[8];return s=s||new Wl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*C,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*C,s[5]=c*_+d*S+h*B,s[6]=u*g+p*y+f*x,s[7]=u*m+p*b+f*C,s[8]=u*_+p*S+f*B,s}static fromObject(n){return new xt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(G.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(G.Types.change)}identity(){return this.elements[0]=xt.Identity[0],this.elements[1]=xt.Identity[1],this.elements[2]=xt.Identity[2],this.elements[3]=xt.Identity[3],this.elements[4]=xt.Identity[4],this.elements[5]=xt.Identity[5],this.elements[6]=xt.Identity[6],this.elements[7]=xt.Identity[7],this.elements[8]=xt.Identity[8],this.trigger(G.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(G.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const A=a[0]*n+a[1]*r+a[2]*s,K=a[3]*n+a[4]*r+a[5]*s,R=a[6]*n+a[7]*r+a[8]*s;return[A,K,R]}const u=this.elements,p=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],C=u[8],B=p[0],v=p[1],N=p[2],F=p[3],P=p[4],q=p[5],U=p[6],M=p[7],E=p[8];return this.elements[0]=f*B+g*F+m*U,this.elements[1]=f*v+g*P+m*M,this.elements[2]=f*N+g*q+m*E,this.elements[3]=_*B+y*F+b*U,this.elements[4]=_*v+y*P+b*M,this.elements[5]=_*N+y*q+b*E,this.elements[6]=S*B+x*F+C*U,this.elements[7]=S*v+x*P+C*M,this.elements[8]=S*N+x*q+C*E,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new xt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],p=r[8],f=p*c-d*u,g=-p*l+d*h,m=u*l-c*h;let _=s*f+o*g+a*m;return _?(_=1/_,n.elements[0]=f*_,n.elements[1]=(-p*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(p*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Bm(n),s=Tm(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=rc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=rc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return qs.length=0,this.toTransformArray(n,qs),qs.map(en).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,p,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=p,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,p,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new xt().copy(this)}};k(xt,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=xt;am(rr);const br=class br extends ir{constructor(){super();k(this,"_flagMatrix",!0);k(this,"_flagScale",!1);k(this,"_matrix",null);k(this,"_worldMatrix",null);k(this,"_position",null);k(this,"_rotation",0);k(this,"_scale",1);k(this,"_skewX",0);k(this,"_skewY",0);for(let n in Gr)Object.defineProperty(this,n,Gr[n]);this._renderer.flagMatrix=sc.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new br().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return Gr.position.get.apply(this,arguments)}set translation(n){Gr.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof we?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new br;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof we?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof we?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};k(br,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let un=br;const Gr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(G.Types.change,this._renderer.flagMatrix),sc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(G.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return lm(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function sc(){this._flagMatrix=!0}const $i=Math.min,Ni=Math.max,Em=Math.ceil,$m=Math.floor,Nm=new we,qt=class qt extends un{constructor(n,r,s,o){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagCap",!0);k(this,"_flagJoin",!0);k(this,"_flagMiter",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="path",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new qt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<qt.Properties.length;r++){const s=qt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new qt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<qt.Properties.length;s++){const o=qt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(qt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,p=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:g}=om(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[f,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,x]=r.multiply(y,b),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[v,N]=r.multiply(C,B);const F=um(f,g,S,x,v,N,m,_);u=$i(F.min.y-s,u),d=$i(F.min.x-s,d),h=Ni(F.max.x+s,h),p=Ni(F.max.y+s,p)}else a<=1&&(u=$i(g-s,u),d=$i(f-s,d),h=Ni(f+s,h),p=Ni(g+s,p)),u=$i(_-s,u),d=$i(m-s,d),h=Ni(m+s,h),p=Ni(_+s,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let B=null,v=null;for(let $=0,j=this._lengths.length,z=0;$<j;$++){if(z+this._lengths[$]>=S){this._closed?(s=Ti($,x),o=Ti($-1,x),$===0&&(s=o,o=$)):(s=$,o=Math.min(Math.max($-1,0),C)),B=this.vertices[s],v=this.vertices[o],S-=z,this._lengths[$]!==0?n=S/this._lengths[$]:n=0;break}z+=this._lengths[$]}if(B===null||v===null)return null;if(B){if(!v)return B}else return v;b=v.controls&&v.controls.right,y=B.controls&&B.controls.left,c=v.x,f=v.y,d=(b||v).x,g=(b||v).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&v.relative&&(d+=v.x,g+=v.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Xr(n,c,d,h,u),p=Xr(n,f,g,m,_);const N=Qt(c,d,n),F=Qt(f,g,n),P=Qt(d,h,n),q=Qt(g,m,n),U=Qt(h,u,n),M=Qt(m,_,n),E=Qt(N,P,n),A=Qt(F,q,n),K=Qt(P,U,n),R=Qt(q,M,n);return Ae.isObject(r)?(r.x=l,r.y=p,r instanceof $e&&(r.controls.left.x=E,r.controls.left.y=A,r.controls.right.x=K,r.controls.right.y=R,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new $e(l,p,E-l,A-p,K-l,R-p,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return pm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.close;let o=this.vertices[r],a=[],l;return Ae.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ae.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=nc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=Ur(this,s*this._length),l=Ur(this,o*this._length),c=Em(a),d=$m(l);let h,u,p,f,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&tc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&tc(this,s)&&(h=g,h.command=fe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=fe.move,this._renderer.vertices.unshift(g),f=this._collection[m+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(we.zero,g.t):(Nm.copy(f),this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return un.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,un.prototype.flagReset.call(this),this}};k(qt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),k(qt,"Utils",{getCurveLength:nc});let Ne=qt;const oc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function lc(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function cc(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(){this._flagFill=!0}function hc(){this._flagStroke=!0}const Rm=Math.ceil,Pm=Math.floor,an=class an extends un{constructor(n){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagSize",!0);k(this,"_flagSizeAttenuation",!0);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_size",1);k(this,"_sizeAttenuation",!1);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_dashes",null);k(this,"noFill",Ne.prototype.noFill);k(this,"noStroke",Ne.prototype.noStroke);k(this,"corner",Ne.prototype.corner);k(this,"center",Ne.prototype.center);k(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);k(this,"_updateLength",Ne.prototype._updateLength);for(let r in uc)Object.defineProperty(this,r,uc[r]);this._renderer.type="points",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new an().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<an.Properties.length;r++){const s=an.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new an;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<an.Properties.length;s++){const o=an.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(an.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=ql(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Ur(this,n*this._length),o=Ur(this,r*this._length),a=Rm(s),l=Pm(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};k(an,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Kr=an;const uc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class fc extends Ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ha(this,vs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Ct(this,vs)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}vs=new WeakMap;const _n=class _n extends Ne{constructor(n,r,s,o,a,l,c){const d=c||Xs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);k(this,"_flagStartAngle",!1);k(this,"_flagEndAngle",!1);k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_startAngle",0);k(this,"_endAngle",Jn);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in pc)Object.defineProperty(this,u,pc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ti(n,Jn)===Ti(r,Jn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,p,f,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),p=0,f=d-1;p<d;p++){switch(g=p/f,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),p){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-it),m.controls.left.y=x*Math.sin(_-it),m.controls.right.x=x*Math.cos(_+it),m.controls.right.y=x*Math.sin(_+it),p===1&&m.controls.left.multiplyScalar(2),p===f&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,f=d-1),p=0;p<d;p++)g=p/f,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,p<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+it),m.controls.left.y=x*Math.sin(_+it),m.controls.right.x=x*Math.cos(_-it),m.controls.right.y=x*Math.sin(_-it),p===1&&m.controls.left.multiplyScalar(2),p===f&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new _n(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};k(_n,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ys=_n;const pc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Us=Math.cos,Gs=Math.sin,yn=class yn extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);k(this,"_flagRadius",!1);k(this,"_radius",0);this._renderer.type="circle";for(let c in gc)Object.defineProperty(this,c,gc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*Jn,d=s*Us(c),h=s*Gs(c),u=o*Us(c-it),p=o*Gs(c-it),f=o*Us(c+it),g=o*Gs(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new yn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};k(yn,"Properties",["radius"]);let Ks=yn;const gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Zs=Math.cos,Js=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new $e);super(c,!0,!0,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);this._renderer.type="ellipse";for(let d in mc)Object.defineProperty(this,d,mc[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*Jn,d=s*Zs(c),h=o*Js(c),u=s*r*Zs(c-it),p=o*r*Js(c-it),f=s*r*Zs(c+it),g=o*r*Js(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new bn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};k(bn,"Properties",["width","height"]);let Qs=bn;const mc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Fm=Math.cos,Mm=Math.sin,wn=class wn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagSides",!1);k(this,"_radius",0);k(this,"_width",0);k(this,"_height",0);k(this,"_sides",0);this._renderer.type="polygon";for(let a in _c)Object.defineProperty(this,a,_c[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new wn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Jn*a+Math.PI/2,c=this._width*Fm(l)/2,d=this._height*Mm(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new wn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n}};k(wn,"Properties",["width","height","sides"]);let eo=wn;const _c={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},gi=class gi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);k(this,"_flagWidth",0);k(this,"_flagHeight",0);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in yc)Object.defineProperty(this,l,yc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new gi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gi.Properties.length;r++){const s=gi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new gi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};k(gi,"Properties",["width","height"]);let to=gi;const yc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(G.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},vn=class vn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagRadius",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in bc)Object.defineProperty(this,c,bc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Am.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof we?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};k(vn,"Properties",["width","height","radius"]);let no=vn;const bc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Am(){this._flagRadius=!0}const Om=Math.cos,Im=Math.sin,kn=class kn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_flagSides",!1);k(this,"_innerRadius",0);k(this,"_outerRadius",0);k(this,"_sides",0);this._renderer.type="star";for(let l in wc)Object.defineProperty(this,l,wc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Jn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Om(l),h=c*Im(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new kn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};k(kn,"Properties",["innerRadius","outerRadius","sides"]);let io=kn;const wc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let ro;const vc=Math.min,kc=Math.max;Jt.document&&(ro=document.createElement("canvas"));const mt=class mt extends un{constructor(n,r,s,o){super();k(this,"_flagValue",!0);k(this,"_flagFamily",!0);k(this,"_flagSize",!0);k(this,"_flagLeading",!0);k(this,"_flagAlignment",!0);k(this,"_flagBaseline",!0);k(this,"_flagStyle",!0);k(this,"_flagWeight",!0);k(this,"_flagDecoration",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_flagDirection",!0);k(this,"_value","");k(this,"_family","sans-serif");k(this,"_size",13);k(this,"_leading",17);k(this,"_alignment","center");k(this,"_baseline","middle");k(this,"_style","normal");k(this,"_weight",500);k(this,"_decoration","none");k(this,"_direction","ltr");k(this,"_fill","#000");k(this,"_stroke","none");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in xc)Object.defineProperty(this,a,xc[a]);if(this._renderer.type="text",this._renderer.flagFill=Vm.bind(this),this._renderer.flagStroke=zm.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Ae.isObject(o))return this;for(let a=0;a<mt.Properties.length;a++){const l=mt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ro){const r=ro.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*mt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new mt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<mt.Properties.length;r++){const s=mt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<mt.Properties.length;s++){const o=mt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<mt.Properties.length;r++){const s=mt.Properties[r];n[s]=this[s]}return n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=mt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,p]=r.multiply(s,a),[f,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=vc(p,g,_,b),s=vc(u,f,m,y),o=kc(u,f,m,y),l=kc(p,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};k(mt,"Ratio",.6),k(mt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Ri=mt;const xc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Vm(){this._flagFill=!0}function zm(){this._flagStroke=!0}const Zr=Math.min,Jr=Math.max,xn=class xn extends un{constructor(n){super();k(this,"_flagAdditions",!1);k(this,"_flagSubtractions",!1);k(this,"_flagOrder",!1);k(this,"_flagOpacity",!0);k(this,"_flagBeginning",!1);k(this,"_flagEnding",!1);k(this,"_flagLength",!1);k(this,"_flagMask",!1);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_length",0);k(this,"_mask",null);for(let r in Cc)Object.defineProperty(this,r,Cc[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)Sc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Sc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new xn;for(let o=0;o<xn.Properties.length;o++){const a=xn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ei(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Ys.fromObject(o);case"circle":return Ks.fromObject(o);case"ellipse":return Qs.fromObject(o);case"points":return Kr.fromObject(o);case"polygon":return eo.fromObject(o);case"rectangle":return to.fromObject(o);case"rounded-rectangle":return no.fromObject(o);case"star":return io.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Ri.fromObject(o);case"group":return xn.fromObject(o);case"shape":return un.fromObject(o);case"element":return ir.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new xn,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Ae.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,p=-1/0;const f=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||f.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Ae.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ae.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ae.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ae.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,C]=s.multiply(r.left,r.bottom),[B,v]=s.multiply(r.right,r.bottom);u=Zr(y,S,C,v,u),d=Zr(_,b,x,B,d),h=Jr(_,b,x,B,h),p=Jr(y,S,C,v,p)}else u=Zr(r.top,u),d=Zr(r.left,d),h=Jr(r.right,h),p=Jr(r.bottom,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(xn,"Children",fc),k(xn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let fn=xn;const Cc={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=fn.InsertChildren.bind(this),n=fn.RemoveChildren.bind(this),r=fn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new fc(e),this._children.bind(G.Types.insert,t),this._children.bind(G.Types.remove,n),this._children.bind(G.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Sc(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class so extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Bc)Object.defineProperty(this,a,Bc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Bc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new qr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new qr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class oo{constructor(t=0,n=0){this.x=t,this.y=n}}class ti{constructor(t=10,n=0,r="A"){k(this,"start",new oo);k(this,"end",new oo);this.width=t,this.angle=n,this.label=r}}const Ve={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},Lm={class:"flex gap-3"},Dm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Hm={ref:"drawing-container",class:"size-full"},Wm={},Tc=i.defineComponent({...Wm,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((R,$)=>new ti(n.value.configuratorParams.linesWidths[$],R,`A-${$+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var R,$;return n.value.configuratorParams.startTailType&&((R=n.settings.startTailConfigs)!=null&&R[n.value.configuratorParams.startTailType])?($=n.settings.startTailConfigs)==null?void 0:$[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var R,$;return n.value.configuratorParams.endTailType&&((R=n.settings.endTailConfigs)!=null&&R[n.value.configuratorParams.endTailType])?($=n.settings.endTailConfigs)==null?void 0:$[n.value.configuratorParams.endTailType].points:[]}),g=(R,$=!1)=>{R[0].start.x=0,R[0].start.y=0;let j=0;for(let z=0;z<R.length;z++){const Y=R[z],I=R[z-1]??new ti(0,j);j+=!$||z>1?I.angle:0;const V=(!$||z>0?Y.angle:0)+j;if(R[z].end.x=Y.width*Math.cos(V*Math.PI/180)+R[z].start.x,R[z].end.y=Y.width*Math.sin(V*Math.PI/180)+R[z].start.y,z<R.length-1){const J=z+1;R[J].start.x=R[z].end.x,R[J].start.y=R[z].end.y}}return R},m=(R,$,j,z,Y=!1)=>{let I=g([...j,...z]);$.length>0&&(I=[...g($),...I]);let V=0,J=0,pe=0,ie=0;I.forEach(Fe=>{V=Math.min(V,Fe.start.x,Fe.end.x),J=Math.min(J,Fe.start.y,Fe.end.y),pe=Math.max(pe,Fe.start.x,Fe.end.x),ie=Math.max(ie,Fe.start.y,Fe.end.y)});let ge,re;V===0&&J===0&&pe===0&&ie===0?(ge=1,re=1):(ge=R.width/Math.abs(pe-V),re=(Y?R.height:R.height-Ve.colorSideLabel.size)/Math.abs(ie-J));const Me=Math.min(ge,re);return V=V<0?-V*Me:0,J=J<0?-J*Me:0,[Me,V,J]},_=R=>{const $=new Kr([R]);return $._size=Ve.anchorPoint.size,$.fill=Ve.anchorPoint.color,$.stroke="transparent",$._linewidth=Ve.anchorPoint.strokeSize,l.push($),$},y=(R,$)=>{if(l=[],n.settings.allowChangeFirstPoint){const j=R[0],z=new we(j.vertices[0].x,j.vertices[0].y);z.bind(G.Types.change,()=>{j.vertices[0].copy(z)});const Y=_(z);$.add(Y)}R.forEach((j,z)=>{const Y=R[z+1],I=new we(j.vertices[1].x,j.vertices[1].y);I.bind(G.Types.change,()=>{j.vertices[1].copy(I),Y!==void 0&&Y.vertices[0].copy(I)});const V=_(I);$.add(V)})},b=R=>R*(Math.PI/180),S=(R,$,j)=>{const z=$.vertices.length-1;R.position.x=$.vertices[z].x,R.position.y=$.vertices[z].y;const Y=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);R.rotation=b(j)+Y},x=(R,$,j)=>{if($.vertices[0]===void 0)return;R.position.x=$.vertices[0].x,R.position.y=$.vertices[0].y;const z=$.vertices.length-1,Y=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);R.rotation=b(j)+Y},C=(R,$,j)=>{const z=new fn;if(R.length===0)return z;const Y=[];return[...R].reverse().forEach((I,V)=>{V!==0&&I.angle>0&&(I.angle*=-1),Y.push(I)}),R=g(Y,!0),x(z,$,R[0].angle),[$.vertices[0],$.vertices[1]].forEach(I=>{I.bind(G.Types.change,()=>{x(z,$,R[0].angle)})}),R.forEach(I=>{const V=I.start.x*j,J=I.end.x*j,pe=I.start.y*j,ie=I.end.y*j,ge=new so(V,pe,J,ie);ge.linewidth=Ve.line.size,ge.stroke=Ve.line.color,z.add(ge)}),z},B=(R,$,j)=>{const z=new fn;return R.length===0||(R=g(R,!0),S(z,$,R[0].angle),[$.vertices[0],$.vertices[1]].forEach(Y=>{Y.bind(G.Types.change,()=>{S(z,$,R[0].angle)})}),R.forEach(Y=>{const I=Y.start.x*j,V=Y.end.x*j,J=Y.start.y*j,pe=Y.end.y*j,ie=new so(I,J,V,pe);ie.linewidth=Ve.line.size,ie.stroke=Ve.line.color,z.add(ie)})),z},v=(R,$,j,z)=>{const Y=$.vertices[0].x+($.vertices[1].x-$.vertices[0].x)/2-8*Math.sin(R.angle*Math.PI/180),I=$.vertices[0].y+($.vertices[1].y-$.vertices[0].y)/2-8*Math.cos(R.angle*Math.PI/180),V=new Ri(R.label,Y+10,I-10);let J;V.size=Ve.lineLabel.size,V.weight=600,V.fill=Ve.lineLabel.color,V.id+=1,V.rotation=Ve.lineLabel.rotation,z>0&&(J=new Ri(`${R.angle}°`,$.vertices[0].x+25,$.vertices[0].y-25),J.size=Ve.angleLabel.size,J.weight=600,J.fill=Ve.angleLabel.color,J.rotation=Ve.angleLabel.rotation,J.id+=z,o.push(J),j.add(J)),j.add(V),F(V,$,0,J),F(V,$,1)},N=()=>{const{size:R}=Ve.colorSideLabel,$=0,j=0,z=u.value?R/2:R/2-R,Y=u.value?R/2-R:R/2,I=new fn;if(!c)return I;const V=5,J=Math.atan2(Y-z,j-$),pe=[new $e($,z,0,0,0,0,he.Commands.move),new $e(j,Y,0,0,0,0,he.Commands.line),new $e(j-V*Math.cos(J-Math.PI/4),Y-V*Math.sin(J-Math.PI/4),0,0,0,0,he.Commands.line),new $e(j,Y,0,0,0,0,he.Commands.move),new $e(j-V*Math.cos(J+Math.PI/4),Y-V*Math.sin(J+Math.PI/4),0,0,0,0,he.Commands.line)],ie=new Ne(pe,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=R/7,ie.stroke=Ve.colorSideLabel.color,I.add(ie);const ge=new Ri(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=R,ge.weight=600,ge.fill=Ve.colorSideLabel.color,ge.alignment="left",I.add(ge);const re=I.getBoundingClientRect();return I.position.x=(c.width-re.width)*d+10,I.position.y=u.value?c.height+re.height*2:re.height/2,I},F=(R,$,j,z)=>{$.vertices[j].bind(G.Types.change,()=>{const Y=$.vertices.length-1,I=Math.atan2($.vertices[0].y-$.vertices[Y].y,$.vertices[0].x-$.vertices[Y].x)*180/Math.PI,V=$.vertices[0].x+($.vertices[Y].x-$.vertices[0].x)/2-8*Math.sin(I*Math.PI/180),J=$.vertices[0].y+($.vertices[Y].y-$.vertices[0].y)/2-8*Math.cos(I*Math.PI/180);R.position.x=V+10,R.position.y=J-10,R.rotation=-.5,z&&(z.position.x=$.vertices[0].x+25,z.position.y=$.vertices[0].y-25)})},P=(R,$,j,z,Y=!1)=>{var Ge;if(R.clear(),j.length===0){R.update();return}const I=g(j),[V,J,pe]=m(R,$,I,z,Y),ie=new fn,ge=new Array,re=new Array;Y||(o=[],a=[]),I.forEach((xe,Se)=>{const st=xe.start.x*V+J,Ke=xe.end.x*V+J,nt=xe.start.y*V+pe,Yt=xe.end.y*V+pe,$t=new so(st,nt,Ke,Yt);$t.linewidth=Y?Ve.previewLine.size:Ve.line.size,$t.stroke=Y?Ve.previewLine.color:Ve.line.color,a.push($t),ge.push($t),ie.add($t),!Y&&xe.label!==""&&v(xe,$t,ie,Se)});const Me=ge.at(-1);let Fe=ie.getBoundingClientRect();if(!Y){const xe=N();re.push(xe)}if($.length>0){const xe=C($,ge[0],V);ie.add(xe)}if(z.length>0&&Me){const xe=B(z,Me,V);ie.add(xe)}if(re.push(ie),R.makeGroup(re),Fe=ie.getBoundingClientRect(),ie.position.x=0-Fe.left+(R.width-Fe.width)/(2*(Y?1:d)),ie.position.y=0-Fe.top+(R.height-Fe.height)/(2*(Y?1:d)),R.update(),!Y){const xe=((Ge=n.value.configuratorParams)==null?void 0:Ge.colorSide)==="top";ie.position.y=ie.position.y+Ve.colorSideLabel.size*Number(xe),y(ge,ie),R.update()}},q=(R,$)=>{if(R&&!$.isNewRec()){const j=new he({width:R.scrollWidth,height:R.scrollHeight});j.appendTo(R),P(j,[],$.points,[],!0)}},U=()=>{c&&P(c,p.value,h.value,f.value,!1)},M=R=>R*(180/Math.PI),E=(R,$)=>{const j=R[1].x-R[0].x,z=R[1].y-R[0].y,Y=$[1].x-$[0].x,I=$[1].y-$[0].y;let V=Math.atan2(j*I-z*Y,j*Y+z*I);return V=M(V),Math.round(V)*-1},A=R=>{const $=a.map((j,z,Y)=>{const I=Y[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let V=Math.ceil(j._length/R/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[z-1];V<(Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(V=Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),V>n.settings.maxLineWidth&&(V=n.settings.maxLineWidth);const pe=E(j.vertices,I.vertices);return J&&(J.value=`${pe}°`),new ti(V,pe,`A-${z+1}`)});r("pointer:move",$)},K=R=>{let $=null,j;const z=J=>{$=l.find(pe=>{const ie=pe.renderer;return(ie==null?void 0:ie.elem)===J.target}),[j]=m(R,p.value,h.value.map(pe=>pe),f.value)},Y=J=>{if($){const pe=$.renderer,ie=pe==null?void 0:pe.elem;if(!ie)return;const ge=ie.getBoundingClientRect();$.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Ve.anchorPoint.size/2,$.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Ve.anchorPoint.size/2,A(j),R.update()}},I=()=>{$&&r("pointer:up",h.value),$=null},V=s.value;V&&(V.addEventListener("touchstart",z),V.addEventListener("touchend",I),V.addEventListener("mousedown",z),V.addEventListener("mouseup",I),V.addEventListener("mousemove",Y),V.addEventListener("touchmove",Y))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{U()},{deep:!0,immediate:!0}),K(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(R,$)=>(i.openBlock(),i.createElementBlock("div",Lm,[i.createVNode(Ta,{"select-template-index":R.selectTemplateIndex,settings:R.settings,"onTemplate:select":$[0]||($[0]=j=>r("template:select",j)),onInitDrawTemplate:q},null,8,["select-template-index","settings"]),i.createElementVNode("div",Dm,[i.createElementVNode("div",Hm,null,512)])]))}}),jm={class:"flex max-w-[50rem] flex-col gap-3"},Xm={},qm=i.defineComponent({...Xm,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),p=(C=0)=>{const B=c.value.allTemplates.at(C);B!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=B.points.map(v=>H.isArray(v)?v[0]:v.width),l.value.configuratorParams.linesAngles=B.points.map(v=>H.isArray(v)?v[1]:v.angle),y()),m(l.value.configuratorParams)},f=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const B={label:C,points:l.value.configuratorParams.linesWidths.map((v,N)=>[v,l.value.configuratorParams.linesAngles[N]])};await W.HttpRequester.getInstance(W.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async C=>{y(),s.value=!0,await W.HttpRequester.getInstance(W.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?W.HttpRequester.getInstance(W.CartProvider).addCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1}):W.HttpRequester.getInstance(W.CartProvider).patchCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,v)=>{C[`lines_widths[${v+1}]`]={},C[`lines_angles[${v+1}]`]={}}),h.value=C},b=C=>{d.value.linesWidths=C.map(B=>B.width),d.value.linesAngles=C.map(B=>B.angle)},S=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(C,B)=>{d.value.linesWidths=C,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(C,B)=>(i.openBlock(),i.createElementBlock("div",jm,[i.createVNode(Tc,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Na,{value:l.value,"onUpdate:value":B[0]||(B[0]=v=>l.value=v),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=v=>m(v)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":f},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Pi extends W.Identity{constructor(n,r){super();k(this,"label","");k(this,"points",[]);k(this,"isCustom",!1);k(this,"id",-1);k(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>H.isArray(s)?new ti(s[0],s[1],`A-${o+1}`):new ti(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ti(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ao extends Pi{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class Ym{constructor(t){k(this,"minLineWidth");k(this,"maxLineWidth");k(this,"lineWidthStep");k(this,"minLineAngle");k(this,"maxLineAngle");k(this,"lineAngleStep");k(this,"stripMinWidth");k(this,"stripMaxWidth");k(this,"stripMinLength");k(this,"stripMaxLength");k(this,"allowShowTable");k(this,"showOnlyTemplates");k(this,"templates");k(this,"customTemplates",[]);k(this,"startTailConfigs");k(this,"endTailConfigs");k(this,"bendCountForExtended");k(this,"extendedProductCatalog");k(this,"allowChangeFirstPoint");k(this,"allowSaveTemplates");k(this,"userTemplatesPrefix");k(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Pi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new ao(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new ao(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Pi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Pi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Pi(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const Um={},Fi=i.defineComponent({...Um,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=H.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(O.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:f.clearable,placeholder:f.placeholder,min:f.min,max:f.max,step:f.step,validator:f.validator},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Gm={class:"flex flex-col gap-3"},Km={},Ec=i.defineComponent({...Km,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(H.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new W.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=O.NInput;return i.openBlock(),i.createBlock(i.unref(O.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(O.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Gm,[i.createVNode(i.unref(O.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),Zm={class:"w-104 px-5"},Jm={},Qm=i.defineComponent({...Jm,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await W.HttpRequester.getInstance(W.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?W.HttpRequester.getInstance(W.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):W.HttpRequester.getInstance(W.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",Zm,[i.createVNode(Ec,{value:s.value,"onUpdate:value":u[0]||(u[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=p=>c(p)),onSubmit:u[2]||(u[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),e0={key:0,class:"flex items-baseline gap-1"},t0={key:0,class:"flex items-baseline gap-1"},n0={class:"flex gap-3"},i0={},$c=i.defineComponent({...i0,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(H.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,f)=>{p&&p in o.value&&(o.value[p]=f??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(p,f)=>{const g=new W.CartItemBase(n.value);g[p]=f,r("update:value",g)};return(p,f)=>{const g=O.NInput;return i.openBlock(),i.createBlock(i.unref(O.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:o.value.netType,"onUpdate:value":[f[0]||(f[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:o.value.color,"onUpdate:value":f[1]||(f[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:o.value.mountType,"onUpdate:value":[f[2]||(f[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",e0,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[4]||(f[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>f[11]||(f[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",t0,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[6]||(f[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>f[12]||(f[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":f[5]||(f[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:p.value.quantity,"onUpdate:value":f[7]||(f[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(O.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":f[8]||(f[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",n0,[i.createVNode(i.unref(O.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:f[9]||(f[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,type:"default",onClick:f[10]||(f[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>f[13]||(f[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),r0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",s0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",o0="/img/configurators/mosquitto/measurement-instructions/mount.png",a0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",l0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",c0={class:"flex flex-col gap-6"},d0={class:"flex gap-4"},h0={class:"flex flex-col gap-2"},u0={class:"flex gap-4"},f0={class:"flex flex-col gap-2"},p0={class:"flex gap-4"},g0={class:"flex flex-col gap-2"},m0={},Nc=i.defineComponent({...m0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=_t.initRefDependingOnDeviceResolution("small","small","medium"),r=_t.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=O.NText;return i.openBlock(),i.createBlock(i.unref(O.NModal),{show:a.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",c0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:r0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:s0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",d0,[l[9]||(l[9]=i.createElementVNode("img",{src:o0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",h0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",u0,[l[15]||(l[15]=i.createElementVNode("img",{src:a0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",f0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",p0,[l[21]||(l[21]=i.createElementVNode("img",{src:l0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",g0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),_0={class:"flex flex-col items-center justify-between rounded-xl"},y0={class:"img-preview relative flex justify-center"},b0={},w0=i.defineComponent({...b0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>H.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=O.NButton;return i.openBlock(),i.createElementBlock("div",_0,[i.createElementVNode("div",y0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ")])),_:1,__:[2]})])}}}),lo=Ln(w0,[["__scopeId","data-v-8b43aa68"]]),v0={class:"grid md:grid-cols-2"},k0={},x0=i.defineComponent({...k0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0&&(d.value=!0,await W.HttpRequester.getInstance(W.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?W.HttpRequester.getInstance(W.CartProvider).addCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1}):W.HttpRequester.getInstance(W.CartProvider).patchCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1})),h.value=!1};return(f,g)=>{const m=Br;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Nc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":f.settings.heightOverlaps,"width-overlaps":f.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",v0,[s.value?(i.openBlock(),i.createBlock(i.unref(O.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(O.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(lo,{"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(lo,{key:0,"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode($c,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:f.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>p()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),C0={},Rc=i.defineComponent({...C0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return t({focusWidthInput:c}),(d,h)=>{const u=$a,p=Ea;return i.openBlock(),i.createBlock(i.unref(O.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(qi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(O.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:f=>!!f&&f>=d.settings.minLineWidth&&f%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(O.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=f=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(O.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=f=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),S0={class:"my-2 flex w-full flex-col"},B0={class:"flex gap-3"},T0={},Pc=i.defineComponent({...T0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,u)=>h+u,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,u,p)=>{const f=n.value.at(u);if(f)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:f.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,p),d("configuratorParams",g)}else f.product.id=-1},d=(h,u)=>{const p=n.value.map(f=>new W.CartItemBase(f));p.forEach(f=>{f[h]=u}),r("update:value",p)};return(h,u)=>{const p=O.NText,f=O.NInput;return i.openBlock(),i.createBlock(i.unref(O.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Rc,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",S0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(O.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(O.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",B0,[i.createVNode(i.unref(O.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:u[6]||(u[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(O.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),E0={class:"flex grow flex-col"},$0=["src"],N0={class:"w-full"},R0={},Fc=i.defineComponent({...R0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",E0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,$0),i.createElementVNode("div",N0,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),P0={class:"w-104 flex grow flex-col px-5"},F0={},M0=i.defineComponent({...F0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,f)=>p+f,0)),c=p=>{p===void 0&&(p=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new W.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,f,g)=>{g.value=!0,await W.HttpRequester.getInstance(W.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:p.linesWidths.at(f)},o.value).then(m=>{s.value[f].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new W.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?W.HttpRequester.getInstance(W.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):W.HttpRequester.getInstance(W.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,f)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Fc,{value:s.value,"onUpdate:value":f[0]||(f[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Pc,{value:s.value,"onUpdate:value":f[1]||(f[1]=g=>s.value=g),validation:o.value,settings:p.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),A0={class:"flex flex-row gap-2.5"},O0={class:"flex flex-col"},I0={class:"flex flex-col"},V0={},z0=i.defineComponent({...V0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>W.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return H.forOwn(W.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Sn.startOfDay(new Date(a)):void 0,to:l?Sn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,p,f;const c=O.NButton,d=O.NDatePicker;return i.openBlock(),i.createElementBlock("div",A0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.to)&&g>((_=a.dateRange)==null?void 0:_.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,_;return o(g,(_=(m=a.dateRange)==null?void 0:m.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",O0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(f=(p=a.dateRange)==null?void 0:p.to)==null?void 0:f.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.from)&&g<((_=a.dateRange)==null?void 0:_.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,_;return o((_=(m=a.dateRange)==null?void 0:m.from)==null?void 0:_.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",I0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),L0={class:"sc-lbl-date text-nowrap"},D0={},co=i.defineComponent({...D0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Sn.format(t.date,W.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Sn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",L0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),H0={class:"flex flex-row gap-2.5"},W0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},j0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},X0={class:"mb-0.5 sm:mb-0 sm:ml-3"},q0={},Y0=i.defineComponent({...q0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Br,s=O.NButton,o=O.NPopover;return i.openBlock(),i.createElementBlock("div",H0,[i.createElementVNode("div",W0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",j0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",X0,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),U0={key:0,class:"flex flex-row gap-2.5"},G0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},K0={},Z0=i.defineComponent({...K0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=_t.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=_t.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),t({open:h,close:u}),(f,g)=>{const m=O.NButton,_=O.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:f.title,"action-class":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||f.acceptButton.show||f.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",U0,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||f.acceptButton.show||f.cancelButton.show?(i.openBlock(),i.createElementBlock("div",G0,[i.renderSlot(f.$slots,"action",{disabled:a.value}),f.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),f.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),J0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Q0(e,t){return i.openBlock(),i.createElementBlock("svg",J0,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)]))}const e_=i.markRaw({name:"ion-download-outline",render:Q0}),t_={},n_=i.defineComponent({...t_,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=e_,c=O.NUploadDragger,d=O.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),i_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r_(e,t){return i.openBlock(),i.createElementBlock("svg",i_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)]))}const s_=i.markRaw({name:"ion-checkmark-done-sharp",render:r_}),o_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function a_(e,t){return i.openBlock(),i.createElementBlock("svg",o_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}const l_=i.markRaw({name:"ion-options-outline",render:a_}),c_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},d_={class:"flex-auto"},h_={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},u_={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},f_={},ho=i.defineComponent({...f_,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(e,{emit:t}){const n=t,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=l_,u=O.NButton,p=O.NPopover,f=s_,g=Br;return i.openBlock(),i.createElementBlock("div",c_,[i.createElementVNode("div",d_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",h_,[i.createElementVNode("div",u_,[c.showEditButton?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные "))]),_:1,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения "))]),_:1,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),p_={},Mc=i.defineComponent({...p_,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(ho,{key:1,disabled:l.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(ho,{key:0,disabled:l.disabled,"show-edit-button":l.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),g_={},m_=i.defineComponent({...g_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=H.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(O.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),__={},y_=i.defineComponent({...__,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=H.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(H.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(H.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Wi.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Wi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Wi.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(zh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),b_=Ln(y_,[["__scopeId","data-v-751dbb0e"]]),w_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v_(e,t){return i.openBlock(),i.createElementBlock("svg",w_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)]))}const k_=i.markRaw({name:"tabler-external-link",render:v_}),x_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},C_=["href"],S_={},B_=i.defineComponent({...S_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=k_,s=O.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(H.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",x_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,C_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),T_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function E_(e,t){return i.openBlock(),i.createElementBlock("svg",T_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)]))}const $_=i.markRaw({name:"ion-remove-circle-outline",render:E_});let Qr=[];const Ac=new WeakMap;function N_(){Qr.forEach(e=>e(...Ac.get(e))),Qr=[]}function Oc(e,...t){Ac.set(e,t),!Qr.includes(e)&&Qr.push(e)===1&&requestAnimationFrame(N_)}function sr(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function or(e){return e.composedPath()[0]||null}function ar(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function lr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function jt(e,t){const n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Ic={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",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:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",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:"#F00",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:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function R_(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function P_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const tn="^\\s*",nn="\\s*$",Rn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",At="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ni="([0-9A-Fa-f])",ii="([0-9A-Fa-f]{2})",Vc=new RegExp(`${tn}hsl\\s*\\(${At},${Rn},${Rn}\\)${nn}`),zc=new RegExp(`${tn}hsv\\s*\\(${At},${Rn},${Rn}\\)${nn}`),Lc=new RegExp(`${tn}hsla\\s*\\(${At},${Rn},${Rn},${At}\\)${nn}`),Dc=new RegExp(`${tn}hsva\\s*\\(${At},${Rn},${Rn},${At}\\)${nn}`),F_=new RegExp(`${tn}rgb\\s*\\(${At},${At},${At}\\)${nn}`),M_=new RegExp(`${tn}rgba\\s*\\(${At},${At},${At},${At}\\)${nn}`),A_=new RegExp(`${tn}#${ni}${ni}${ni}${nn}`),O_=new RegExp(`${tn}#${ii}${ii}${ii}${nn}`),I_=new RegExp(`${tn}#${ni}${ni}${ni}${ni}${nn}`),V_=new RegExp(`${tn}#${ii}${ii}${ii}${ii}${nn}`);function Tt(e){return parseInt(e,16)}function z_(e){try{let t;if(t=Lc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),si(t[13])];if(t=Vc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function L_(e){try{let t;if(t=Dc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),si(t[13])];if(t=zc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ri(e){try{let t;if(t=O_.exec(e))return[Tt(t[1]),Tt(t[2]),Tt(t[3]),1];if(t=F_.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),1];if(t=M_.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),si(t[13])];if(t=A_.exec(e))return[Tt(t[1]+t[1]),Tt(t[2]+t[2]),Tt(t[3]+t[3]),1];if(t=V_.exec(e))return[Tt(t[1]),Tt(t[2]),Tt(t[3]),si(Tt(t[4])/255)];if(t=I_.exec(e))return[Tt(t[1]+t[1]),Tt(t[2]+t[2]),Tt(t[3]+t[3]),si(Tt(t[4]+t[4])/255)];if(e in Ic)return ri(Ic[e]);if(Vc.test(e)||Lc.test(e)){const[n,r,s,o]=z_(e);return[...P_(n,r,s),o]}else if(zc.test(e)||Dc.test(e)){const[n,r,s,o]=L_(e);return[...R_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function D_(e){return e>1?1:e<0?0:e}function uo(e,t,n,r){return`rgba(${ut(e)}, ${ut(t)}, ${ut(n)}, ${D_(r)})`}function fo(e,t,n,r,s){return ut((e*t*(1-r)+n*r)/s)}function H_(e,t){Array.isArray(e)||(e=ri(e)),Array.isArray(t)||(t=ri(t));const n=e[3],r=t[3],s=si(n+r-n*r);return uo(fo(e[0],n,t[0],r,s),fo(e[1],n,t[1],r,s),fo(e[2],n,t[2],r,s),s)}function Pe(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e);return typeof t.alpha=="number"?uo(n,r,s,t.alpha):uo(n,r,s,o)}function es(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e),{lightness:a=1,alpha:l=1}=t;return W_([n*a,r*a,s*a,o*l])}function si(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ts(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ut(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Pn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function W_(e){const[t,n,r]=e;return 3 in e?`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, ${si(e[3])})`:`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, 1)`}function j_(e=8){return Math.random().toString(16).slice(2,2+e)}function Hc(e){return Array.isArray(e)?e:[e]}const po={STOP:"STOP"};function Wc(e,t){const n=t(e);e.children!==void 0&&n!==po.STOP&&e.children.forEach(r=>Wc(r,t))}function X_(e,t={}){const{preserveGroup:n=!1}=t,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(e),r}function q_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function Y_(e){return e.children}function U_(e){return e.key}function G_(){return!1}function K_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function Z_(e){return e.disabled===!0}function J_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function Q_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function go(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function mo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function ey(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ty(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function ny(e){return(e==null?void 0:e.type)==="group"}function iy(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class ry extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function sy(e,t,n,r){return ns(t.concat(e),n,r,!1)}function oy(e,t){const n=new Set;return e.forEach(r=>{const s=t.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function ay(e,t,n,r){const s=ns(t,n,r,!1),o=ns(e,n,r,!0),a=oy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function _o(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:ey(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ty(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=ay(s,n,t,d):r!==void 0?u=sy(r,n,t,d):u=ns(n,t,d,!1);const p=c==="parent",f=c==="child"||l,g=u,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const x of S){if(x.isLeaf)continue;const{key:C,shallowLoaded:B}=x;if(f&&B&&x.children.forEach(P=>{!P.disabled&&!P.isLeaf&&P.shallowLoaded&&g.has(P.key)&&g.delete(P.key)}),x.disabled||!B)continue;let v=!0,N=!1,F=!0;for(const P of x.children){const q=P.key;if(!P.disabled){if(F&&(F=!1),g.has(q))N=!0;else if(m.has(q)){N=!0,v=!1;break}else if(v=!1,N)break}}v&&!F?(p&&x.children.forEach(P=>{!P.disabled&&g.has(P.key)&&g.delete(P.key)}),g.add(C)):N&&m.add(C),b&&f&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function ns(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Wc(d,h=>{if(h.disabled)return po.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),J_(h.rawNode,o))){if(r)return po.STOP;if(!n)throw new ry}})}),l}function ly(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(t||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function cy(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function dy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function jc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?hy:dy,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=yo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=uy(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function hy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function uy(e){return e.parent}function yo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=yo(d,t);if(h!==null)return h}else return d}}return null}const fy={getChild(){return this.ignored?null:yo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return jc(this,"next",e)},getPrev(e={}){return jc(this,"prev",e)}};function py(e,t){const n=t?new Set(t):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(e),r}function gy(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var my={};function Xc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;my.NODE_ENV!=="production"&&Q_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const p=s(c);Array.isArray(p)&&(u.children=Xc(p,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function _y(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=Z_,getIgnored:a=G_,getIsGroup:l=ny,getKey:c=U_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:Y_,h=t.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return q_(this.rawNode,h)},get shallowLoaded(){return K_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return gy(this,x)}},fy),p=Xc(e,r,s,u,h);function f(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function g(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function m(x,C){const B=g(x);return B?B.getPrev(C):null}function _(x,C){const B=g(x);return B?B.getNext(C):null}function y(x){const C=g(x);return C?C.getParent():null}function b(x){const C=g(x);return C?C.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return py(p,x)},getNode:f,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return cy(p)},getPath(x,C={}){return ly(x,C,S)},getCheckedKeys(x,C={}){const{cascade:B=!0,leafOnly:v=!1,checkStrategy:N="all",allowNotLoaded:F=!1}=C;return _o({checkedKeys:go(x),indeterminateKeys:mo(x),cascade:B,leafOnly:v,checkStrategy:N,allowNotLoaded:F},S)},check(x,C,B={}){const{cascade:v=!0,leafOnly:N=!1,checkStrategy:F="all",allowNotLoaded:P=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToCheck:x==null?[]:Hc(x),cascade:v,leafOnly:N,checkStrategy:F,allowNotLoaded:P},S)},uncheck(x,C,B={}){const{cascade:v=!0,leafOnly:N=!1,checkStrategy:F="all",allowNotLoaded:P=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToUncheck:x==null?[]:Hc(x),cascade:v,leafOnly:N,checkStrategy:F,allowNotLoaded:P},S)},getNonLeafKeys(x={}){return X_(p,x)}};return S}function is(e){return e.composedPath()[0]}const yy={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function by(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(is(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(is(a))},o=a=>{r&&(t.contains(is(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function qc(e,t,n){const r=yy[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=by(e,t,n)),o}function wy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{kt(o,document,s[o],r)}),!0}return!1}function vy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function ky(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(v,N,F){const P=v[N];return v[N]=function(){return F.apply(v,arguments),P.apply(v,arguments)},v}function o(v,N){v[N]=Event.prototype[N]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var v;return(v=a.get(this))!==null&&v!==void 0?v:null}function d(v,N){l!==void 0&&Object.defineProperty(v,"currentTarget",{configurable:!0,enumerable:!0,get:N??l.get})}const h={bubble:{},capture:{}},u={};function p(){const v=function(N){const{type:F,eventPhase:P,bubbles:q}=N,U=is(N);if(P===2)return;const M=P===1?"capture":"bubble";let E=U;const A=[];for(;E===null&&(E=window),A.push(E),E!==window;)E=E.parentNode||null;const K=h.capture[F],R=h.bubble[F];if(s(N,"stopPropagation",n),s(N,"stopImmediatePropagation",r),d(N,c),M==="capture"){if(K===void 0)return;for(let $=A.length-1;$>=0&&!e.has(N);--$){const j=A[$],z=K.get(j);if(z!==void 0){a.set(N,j);for(const Y of z){if(t.has(N))break;Y(N)}}if($===0&&!q&&R!==void 0){const Y=R.get(j);if(Y!==void 0)for(const I of Y){if(t.has(N))break;I(N)}}}}else if(M==="bubble"){if(R===void 0)return;for(let $=0;$<A.length&&!e.has(N);++$){const j=A[$],z=R.get(j);if(z!==void 0){a.set(N,j);for(const Y of z){if(t.has(N))break;Y(N)}}}}o(N,"stopPropagation"),o(N,"stopImmediatePropagation"),d(N)};return v.displayName="evtdUnifiedHandler",v}function f(){const v=function(N){const{type:F,eventPhase:P}=N;if(P!==2)return;const q=u[F];q!==void 0&&q.forEach(U=>U(N))};return v.displayName="evtdUnifiedWindowEventHandler",v}const g=p(),m=f();function _(v,N){const F=h[v];return F[N]===void 0&&(F[N]=new Map,window.addEventListener(N,g,v==="capture")),F[N]}function y(v){return u[v]===void 0&&(u[v]=new Set,window.addEventListener(v,m)),u[v]}function b(v,N){let F=v.get(N);return F===void 0&&v.set(N,F=new Set),F}function S(v,N,F,P){const q=h[N][F];if(q!==void 0){const U=q.get(v);if(U!==void 0&&U.has(P))return!0}return!1}function x(v,N){const F=u[v];return!!(F!==void 0&&F.has(N))}function C(v,N,F,P){let q;if(typeof P=="object"&&P.once===!0?q=K=>{B(v,N,q,P),F(K)}:q=F,wy(v,N,q,P))return;const M=P===!0||typeof P=="object"&&P.capture===!0?"capture":"bubble",E=_(M,v),A=b(E,N);if(A.has(q)||A.add(q),N===window){const K=y(v);K.has(q)||K.add(q)}}function B(v,N,F,P){if(vy(v,N,F,P))return;const U=P===!0||typeof P=="object"&&P.capture===!0,M=U?"capture":"bubble",E=_(M,v),A=b(E,N);if(N===window&&!S(N,U?"bubble":"capture",v,F)&&x(v,F)){const R=u[v];R.delete(F),R.size===0&&(window.removeEventListener(v,m),u[v]=void 0)}A.has(F)&&A.delete(F),A.size===0&&E.delete(N),E.size===0&&(window.removeEventListener(v,g,M==="capture"),h[M][v]=void 0)}return{on:C,off:B}}const{on:kt,off:et}=ky(),Mi="@@mmoContext",xy={mounted(e,{value:t}){e[Mi]={handler:void 0},typeof t=="function"&&(e[Mi].handler=t,kt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Mi];typeof t=="function"?n.handler?n.handler!==t&&(et("mousemoveoutside",e,n.handler),n.handler=t,kt("mousemoveoutside",e,t)):(e[Mi].handler=t,kt("mousemoveoutside",e,t)):n.handler&&(et("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Mi];t&&et("mousemoveoutside",e,t),e[Mi].handler=void 0}},Ai="@@coContext",rs={mounted(e,{value:t,modifiers:n}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,kt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ai];typeof t=="function"?r.handler?r.handler!==t&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,kt("clickoutside",e,t,{capture:n.capture})):(e[Ai].handler=t,kt("clickoutside",e,t,{capture:n.capture})):r.handler&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ai];n&&et("clickoutside",e,n,{capture:t.capture}),e[Ai].handler=void 0}};function Cy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Sy{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&Cy("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const bo=new Sy,Oi="@@ziContext",Yc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;bo.unregister(e,r)}};function By(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function Lt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const Ty=typeof window<"u";let Ii,cr;(()=>{var e,t;Ii=Ty?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,cr=!1,Ii!==void 0?Ii.then(()=>{cr=!0}):cr=!0})();function Ey(e){if(cr)return;let t=!1;i.onMounted(()=>{cr||Ii==null||Ii.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function wo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function ss(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Uc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const $y=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Ny(){return $y}function vo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function ko(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ko(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ko(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Gc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Fn=null;function Kc(){if(Fn===null&&(Fn=document.getElementById("v-binder-view-measurer"),Fn===null)){Fn=document.createElement("div"),Fn.id="v-binder-view-measurer";const{style:e}=Fn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Fn)}return Fn.getBoundingClientRect()}function Ry(e,t){const n=Kc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function xo(e){const t=e.getBoundingClientRect(),n=Kc();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Py(e){return e.nodeType===9?null:e.parentNode}function Zc(e){if(e===null)return null;const t=Py(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return Zc(t)}const Jc=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=Zc(y),y!==null;)o.push(y);for(const b of o)kt("scroll",b,u,!0)},l=()=>{for(const y of o)et("scroll",y,u,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},u=()=>{Oc(p)},p=()=>{c.forEach(y=>y())},f=new Set,g=y=>{f.size===0&&kt("resize",window,_),f.has(y)||f.add(y)},m=y=>{f.has(y)&&f.delete(y),f.size===0&&et("resize",window,_)},_=()=>{f.forEach(y=>y())};return i.onBeforeUnmount(()=>{et("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return vo("binder",this.$slots)}}),Qc=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Gc("follower",this.$slots),[[t]]):Gc("follower",this.$slots)}}),Fy="@css-render/vue3-ssr";function My(e,t){return`<style cssr-id="${e}">
103
+ `}},Wr=Xn.Multiply,rm=[1,0,0,0,1,0,0,0,1],Nn=new Gt(9),sm=ht.Utils,Ll=new Z,js=new Gt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Xn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)ye.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=ht.Utils.getRendererType(this._mask._renderer.type);ye[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)ye.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Ll.copy(t._renderer.scale).multiply(S),v=t._stroke,B=t._linewidth,k=t._fill,$=t._renderer.opacity||t._opacity,P=t._cap,R=t._join,j=t._miter,Y=t._closed,A=t.dashes,E=_.length,M=E-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const K=t._renderer.rect.centroid,F=K.x,N=K.y;if(b.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")b.fillStyle=k;else{const ge=ht.Utils.getRendererType(k._renderer.type);ye[ge].render.call(k,b,t),b.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")b.strokeStyle=v;else{const ge=ht.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.strokeStyle=v._renderer.effect}B&&(b.lineWidth=B),j&&(b.miterLimit=j),R&&(b.lineJoin=R),!Y&&P&&(b.lineCap=P)}typeof $=="number"&&(b.globalAlpha=$),A&&A.length>0&&(b.lineDashOffset=A.offset||0,b.setLineDash(A));let X,z,U,O,I,J,pe,ie;b.save(),b.scale(x.x,x.y),b.translate(F,N),b.beginPath();for(let ge=0;ge<_.length;ge++){const re=_[ge];switch(f=re.x,g=re.y,re.command){case ee.close:b.closePath();break;case ee.arc:z=re.rx,U=re.ry,O=re.xAxisRotation,I=re.largeArcFlag,J=re.sweepFlag,n=Y?Rt(ge-1,E):Math.max(ge-1,0),r=_[n],pe=r.x,ie=r.y,sm.renderSvgArcCommand(b,pe,ie,z,U,I,J,O,f,g);break;case ee.curve:n=Y?Rt(ge-1,E):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=re.controls&&re.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=h.x+re.x,a=h.y+re.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,f,g),ge>=M&&Y&&(s=X,u=re.controls&&re.controls.right||Z.zero,p=s.controls&&s.controls.left||Z.zero,re._relative?(l=u.x+re.x,c=u.y+re.y):(l=u.x,c=u.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),f=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,f,g));break;case ee.line:b.lineTo(f,g);break;case ee.move:X=re,b.moveTo(f,g);break}}Y&&b.closePath(),ye.isHidden.test(k)||(m=k._renderer&&k._renderer.offset,m&&(b.save(),b.translate(-k._renderer.offset.x,-k._renderer.offset.y),b.scale(k._renderer.scale.x,k._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y),b.lineWidth=B/v._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,u=d.y,p=d.controls;let f,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=p.left,b=p.right,!(!y||!b)&&(f=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!f||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(f,m,r),s=Math.max(f,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=t[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,p;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const u=ht.Utils.getRendererType(this._mask._renderer.type);ye[u].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._size*o;let p=u;ye.isHidden.test(a)||(p+=l),r.width=Ha(p),r.height=r.width;const f=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=ht.Utils.getRendererType(c._renderer.type);ye[_].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const _=ht.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,ct),s.restore(),closed&&s.closePath(),ye.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),ye.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,p=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let _,y;this._scale instanceof Z?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,u&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,f),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Ll.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const f=t._renderer.rect.centroid,g=f.x,m=f.y;let _,y,b,S,x,v,B,k,$,P,R;const j=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),j||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const Y=ht.Utils.getRendererType(c._renderer.type);ye[Y].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const Y=ht.Utils.getRendererType(a._renderer.type);ye[Y].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(u)){const Y=r.measureText(t.value);switch(u){case"underline":$=Y.actualBoundingBoxDescent,R=Y.actualBoundingBoxDescent;break;case"strikethrough":$=0,R=0;break}k=-Y.width/2,P=Y.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,$),r.lineTo(P,R),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=ye.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!ye.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(ye.alignments[e._alignment]||e._alignment){case ye.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case ye.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new Gt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=ht.Utils.getRendererType(this._mask._renderer.type);ye[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.text.getBoundingClientRect(this,this._renderer.rect),ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return this.flagReset()}},updateTexture:function(e,t){const n=ht.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(ye,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Bt("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Tr};ye.ctx=ye.canvas.getContext("2d");var Dl=class extends q{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(ye.canvas=e.offscreenElement,ye.ctx=ye.canvas.getContext("2d")),this.scene=new Ue,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Gt(rm),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Bt("unable to create a webgl context. Try using another renderer.");r=zt.create(t,zt.path.vertex,zt.types.vertex),s=zt.create(t,zt.path.fragment,zt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=ye.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=ye.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,js,t.STATIC_DRAW),r=zt.create(t,zt.points.vertex,zt.types.vertex),s=zt.create(t,zt.points.fragment,zt.types.fragment),n=this.programs.points=ye.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ps(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(q.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Dl,"Utils",ye);var om=ae.extend({Error:Bt,getRatio:Ps,read:ze,xhr:Ml},ae,yt,Oa,Ia),tr=class{constructor(e){w(this,"_events",new q),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:tr.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=tr.Types[n])}this.renderer=new tr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=am.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Pt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=lm.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(q.Types.resize,cm.bind(this)),this.scene=this.renderer.scene,tr.Instances.push(this),t.autostart&&nr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,nr.init(),this.trigger(q.Types.play)}pause(){return this.playing=!1,this.trigger(q.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Pt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(q.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(q.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,t,n,r){const s=new Ds(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new Ce(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new En(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Zi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Ji(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ar(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new Ce(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Mr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Pr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Z(o,a))}}const r=new Fr(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new Ce(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new Ot(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Ve(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Oe(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Rr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Ir(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ue;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in ze))return null;const s=ze[r].call(this,e);return n?this.add(t&&s instanceof Ue?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ue;let r,s,o;const a=(function(l){for(Pt.temp.innerHTML=l,s=0;s<Pt.temp.children.length;s++)r=Pt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Pt.temp.children.length<=1?Pt.temp.children[0]:Pt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Ml(e,a),n):(a(e),n)}},he=tr;w(he,"NextFrameId",bt.NextFrameId),w(he,"Types",bt.Types),w(he,"Version",bt.Version),w(he,"PublishDate",bt.PublishDate),w(he,"Identifier",bt.Identifier),w(he,"Resolution",bt.Resolution),w(he,"AutoCalculateImportedMatrices",bt.AutoCalculateImportedMatrices),w(he,"Instances",bt.Instances),w(he,"uniqueId",bt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Bn),w(he,"Events",q),w(he,"Group",Ue),w(he,"Matrix",Xn),w(he,"Path",Ce),w(he,"Registry",Tr),w(he,"Element",Dn),w(he,"Shape",hn),w(he,"Text",Ot),w(he,"Vector",Z),w(he,"Gradient",qe),w(he,"ImageSequence",Ir),w(he,"LinearGradient",Ve),w(he,"RadialGradient",Oe),w(he,"Sprite",Rr),w(he,"Stop",Kt),w(he,"Texture",Ee),w(he,"ArcSegment",Pr),w(he,"Circle",Zi),w(he,"Ellipse",Ji),w(he,"Line",Ds),w(he,"Points",Fr),w(he,"Polygon",Mr),w(he,"Rectangle",En),w(he,"RoundedRectangle",Qi),w(he,"Star",Ar),w(he,"CanvasRenderer",ht),w(he,"SVGRenderer",zl),w(he,"WebGLRenderer",Dl),w(he,"Commands",ee),w(he,"Utils",om);function am(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function lm(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function cm(e,t){this.width=e,this.height=t,this.trigger(q.Types.resize,e,t)}var nr=Pt.getRequestAnimationFrame();function Hl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=nr(Hl)}nr.init=function(){Hl(),nr.init=function(){}};let Jt;typeof window<"u"?Jt=window:typeof global<"u"?Jt=global:typeof self<"u"&&(Jt=self);let Wl;const Jn=Math.PI*2,it=Math.PI*.5;function dm(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function hm(e){Wl=e}function um(e,t){t=t&&t.identity()||new Wl;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Qt(e,t,n){return n*(t-e)+e}function Ti(e,t){for(;e<0;)e+=t;return e%t}const jl=Jt.Float32Array||Array,fm=Math.floor;function en(e){return fm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}C(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Xl={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(G.Types.change))}}},ot=class ot extends G{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Xl)Object.defineProperty(this,s,Xl[s]);this.x=n,this.y=r}static add(n,r){return new ot(n.x+r.x,n.y+r.y)}static sub(n,r){return new ot(n.x-r.x,n.y-r.y)}static subtract(n,r){return ot.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(ot.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ot(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:en(this.x),y:en(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(ot,"zero",new ot),C(ot,"left",new ot(-1,0)),C(ot,"right",new ot(1,0)),C(ot,"up",new ot(0,-1)),C(ot,"down",new ot(0,1));let we=ot;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);C(this,"controls",{left:new we,right:new we});C(this,"_command",fe.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let h in ql)Object.defineProperty(this,h,ql[h]);this.command=c,this.relative=!0;const d=$e.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(G.Types.change,d),this.controls.right.set(a,l).addEventListener(G.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(G.Types.change)}}static fromObject(n){return new $e().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new $e().copy(this)}toObject(){return{x:en(this.x),y:en(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:en(this.rx),ry:en(this.ry),xAxisRotation:en(this.xAxisRotation),largeArcFlag:en(this.largeArcFlag),sweepFlag:en(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const ql={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}}};let pm=0;const Xs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return pm++}},jr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Xr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Yl(e,t,n,r,s,o,a,l,c){c=c||jr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Xr(p,e,n,s,a),g=Xr(p,t,r,o,l);h.push(new $e(f,g))}return h}function gm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return _m(m,0,1,c||jr.RecursionLimit)}function mm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function _m(e,t,n,r){let s=jr.abscissas[r-2],o=jr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function ym(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ti(s-1,n):Math.max(s-1,0),l=t?Ti(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];bm(c,d,h),d.command=s===0?fe.move:fe.curve}}function bm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=it:l-=it,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let ir=(pi=class extends G{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",Xs.Identifier+Xs.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Ul)Object.defineProperty(this,n,Ul[n])}static fromObject(n){const r=new pi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},C(pi,"Properties",["renderer","id","className"]),pi);const Ul={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class qr extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class wm{constructor(){C(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Yr;const Gl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Jt.document&&(Yr=document.createElement("a"));const He=class He extends ir{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in Kl)Object.defineProperty(this,s,Kl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=vm.bind(this),this._renderer.flagScale=km.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,typeof r=="function"){const s=(function(){this.unbind(G.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(G.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new He().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Yr?(Yr.href=n,Yr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=He.getAbsoluteURL(n);if(He.ImageRegistry.contains(r))return He.ImageRegistry.get(r);let s;return Jt.document?Gl.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=He.getTag(s);n._flagImage&&(/canvas/i.test(o)?He.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,He.Register[o](n,r))),n._flagSrc&&(s||(s=He.getImage(n.src),n.image=s),o=He.getTag(s),He.Register[o](n,r))}clone(){const n=new He(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(G.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,He.load(this,(function(){this.loaded=!0,this.trigger(G.Types.change).trigger(G.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(He,"Properties",["src","loaded","repeat","scale","offset","image"]),C(He,"RegularExpressions",Gl),C(He,"ImageRegistry",new wm),C(He,"Register",{canvas:function(n,r){n._src="#"+n.id,He.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new qr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=He.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new qr("unable to load "+n.src)};n._src=He.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let rt=He;const Kl={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=rt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}rt.ImageRegistry.contains(n)?this._image=rt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(G.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function vm(){this._flagOffset=!0}function km(){this._flagScale=!0}class Ei extends Array{constructor(){super();ha(this,at,new G);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Ct(this,at)}set _events(n){zh(this,at,n)}get _bound(){return Ct(this,at)._bound}set _bound(n){Ct(this,at)._bound=n}addEventListener(){return Ct(this,at).addEventListener.apply(this,arguments)}on(){return Ct(this,at).on.apply(this,arguments)}bind(){return Ct(this,at).bind.apply(this,arguments)}removeEventListener(){return Ct(this,at).removeEventListener.apply(this,arguments)}off(){return Ct(this,at).off.apply(this,arguments)}unbind(){return Ct(this,at).unbind.apply(this,arguments)}dispatchEvent(){return Ct(this,at).dispatchEvent.apply(this,arguments)}trigger(){return Ct(this,at).trigger.apply(this,arguments)}listen(){return Ct(this,at).listen.apply(this,arguments)}ignore(){return Ct(this,at).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(G.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(G.Types.insert,r),this.trigger(G.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(G.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(G.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}at=new WeakMap;const Zl=Array.prototype.slice;function xm(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Zl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Zl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!xm(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:Jt.performance&&Jt.performance.now?Jt.performance:Date},Et=class Et extends ir{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in Jl)Object.defineProperty(this,o,Jl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Et.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Et.Index<=0?"#fff":"#000",Et.Index=(Et.Index+1)%2}static fromObject(n){const r=new Et().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Et.Properties.length;r++){const s=Et.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Et;return Ae.each(Et.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Ae.each(Et.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(Et,"Index",0),C(Et,"Properties",["offset","opacity","color"]);let Qn=Et;const Jl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},sn=class sn extends ir{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in Ql)Object.defineProperty(this,r,Ql[r]);this._renderer.type="gradient",this._renderer.flagStops=Cm.bind(this),this._renderer.bindStops=Sm.bind(this),this._renderer.unbindStops=Bm.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof Qn?o:new Qn().copy(o)));const s=new sn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new sn(r);return Ae.each(sn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<sn.Properties.length;r++){const s=sn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(sn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(sn,"Stop",Qn),C(sn,"Properties",["spread","stops","units"]);let Qe=sn;const Ql={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(G.Types.insert,t).unbind(G.Types.remove,n),this._stops=new Ei((e||[]).slice(0)),this._stops.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._stops)}}};function Cm(){this._flagStops=!0}function Sm(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Bm(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const Vn=class Vn extends Qe{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in ec)Object.defineProperty(this,l,ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Tm.bind(this),this.left=new we,this.right=new we,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Vn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(Qe.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(Vn,"Stop",Qn),C(Vn,"Properties",["left","right"]);let wt=Vn;const ec={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Tm(){this._flagEndPoints=!0}const on=class on extends Qe{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in tc)Object.defineProperty(this,c,tc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Em.bind(this),this._renderer.flagFocal=$m.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new on().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<on.Properties.length;r++){const s=on.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new on(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Qe.Properties.concat(on.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(on.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};C(on,"Stop",Qn),C(on,"Properties",["center","radius","focal"]);let vt=on;const tc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(G.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Em(){this._flagCenter=!0}function $m(){this._flagFocal=!0}function nc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ur(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),gm(r,l,s,c,o,d,a,h,n)}function rc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Yl(r,l,s,c,o,d,a,h,n)}function ei(e){switch(e.renderer.type){case"texture":return rt.fromObject(e);case"gradient":return Qe.fromObject(e);case"linear-gradient":return wt.fromObject(e);case"radial-gradient":return vt.fromObject(e)}return e}const Nm=Math.cos,Rm=Math.sin,sc=Math.tan,qs=[],xt=class xt extends G{constructor(n,r,s,o,a,l){super();C(this,"elements",new jl(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let $,P,R;const j=r[0]||0,Y=r[1]||0,A=r[2]||0;return $=k[0]*j+k[1]*Y+k[2]*A,P=k[3]*j+k[4]*Y+k[5]*A,R=k[6]*j+k[7]*Y+k[8]*A,[$,P,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],p=n[7],f=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],v=r[7],B=r[8];return s=s||new jl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*v,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*v,s[5]=c*_+d*S+h*B,s[6]=u*g+p*y+f*x,s[7]=u*m+p*b+f*v,s[8]=u*_+p*S+f*B,s}static fromObject(n){return new xt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(G.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(G.Types.change)}identity(){return this.elements[0]=xt.Identity[0],this.elements[1]=xt.Identity[1],this.elements[2]=xt.Identity[2],this.elements[3]=xt.Identity[3],this.elements[4]=xt.Identity[4],this.elements[5]=xt.Identity[5],this.elements[6]=xt.Identity[6],this.elements[7]=xt.Identity[7],this.elements[8]=xt.Identity[8],this.trigger(G.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(G.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const M=a[0]*n+a[1]*r+a[2]*s,K=a[3]*n+a[4]*r+a[5]*s,F=a[6]*n+a[7]*r+a[8]*s;return[M,K,F]}const u=this.elements,p=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],v=u[8],B=p[0],k=p[1],$=p[2],P=p[3],R=p[4],j=p[5],Y=p[6],A=p[7],E=p[8];return this.elements[0]=f*B+g*P+m*Y,this.elements[1]=f*k+g*R+m*A,this.elements[2]=f*$+g*j+m*E,this.elements[3]=_*B+y*P+b*Y,this.elements[4]=_*k+y*R+b*A,this.elements[5]=_*$+y*j+b*E,this.elements[6]=S*B+x*P+v*Y,this.elements[7]=S*k+x*R+v*A,this.elements[8]=S*$+x*j+v*E,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new xt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],p=r[8],f=p*c-d*u,g=-p*l+d*h,m=u*l-c*h;let _=s*f+o*g+a*m;return _?(_=1/_,n.elements[0]=f*_,n.elements[1]=(-p*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(p*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Nm(n),s=Rm(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=sc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=sc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return qs.length=0,this.toTransformArray(n,qs),qs.map(en).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,p,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=p,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,p,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new xt().copy(this)}};C(xt,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=xt;hm(rr);const br=class br extends ir{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in Gr)Object.defineProperty(this,n,Gr[n]);this._renderer.flagMatrix=oc.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new br().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return Gr.position.get.apply(this,arguments)}set translation(n){Gr.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof we?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new br;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof we?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof we?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(br,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let un=br;const Gr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(G.Types.change,this._renderer.flagMatrix),oc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(G.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return um(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function oc(){this._flagMatrix=!0}const $i=Math.min,Ni=Math.max,Pm=Math.ceil,Fm=Math.floor,Mm=new we,qt=class qt extends un{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in ac)Object.defineProperty(this,a,ac[a]);this._renderer.type="path",this._renderer.flagVertices=lc.bind(this),this._renderer.bindVertices=cc.bind(this),this._renderer.unbindVertices=dc.bind(this),this._renderer.flagFill=hc.bind(this),this._renderer.flagStroke=uc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new qt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<qt.Properties.length;r++){const s=qt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new qt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<qt.Properties.length;s++){const o=qt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(qt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,p=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:g}=dm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[f,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,x]=r.multiply(y,b),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,$]=r.multiply(v,B);const P=mm(f,g,S,x,k,$,m,_);u=$i(P.min.y-s,u),d=$i(P.min.x-s,d),h=Ni(P.max.x+s,h),p=Ni(P.max.y+s,p)}else a<=1&&(u=$i(g-s,u),d=$i(f-s,d),h=Ni(f+s,h),p=Ni(g+s,p)),u=$i(_-s,u),d=$i(m-s,d),h=Ni(m+s,h),p=Ni(_+s,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,v=x-1;let B=null,k=null;for(let N=0,X=this._lengths.length,z=0;N<X;N++){if(z+this._lengths[N]>=S){this._closed?(s=Ti(N,x),o=Ti(N-1,x),N===0&&(s=o,o=N)):(s=N,o=Math.min(Math.max(N-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=z,this._lengths[N]!==0?n=S/this._lengths[N]:n=0;break}z+=this._lengths[N]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;b=k.controls&&k.controls.right,y=B.controls&&B.controls.left,c=k.x,f=k.y,d=(b||k).x,g=(b||k).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&k.relative&&(d+=k.x,g+=k.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Xr(n,c,d,h,u),p=Xr(n,f,g,m,_);const $=Qt(c,d,n),P=Qt(f,g,n),R=Qt(d,h,n),j=Qt(g,m,n),Y=Qt(h,u,n),A=Qt(m,_,n),E=Qt($,R,n),M=Qt(P,j,n),K=Qt(R,Y,n),F=Qt(j,A,n);return Ae.isObject(r)?(r.x=l,r.y=p,r instanceof $e&&(r.controls.left.x=E,r.controls.left.y=M,r.controls.right.x=K,r.controls.right.y=F,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new $e(l,p,E-l,M-p,K-l,F-p,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return ym(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.close;let o=this.vertices[r],a=[],l;return Ae.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=rc(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=rc(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ae.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=ic(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=Ur(this,s*this._length),l=Ur(this,o*this._length),c=Pm(a),d=Fm(l);let h,u,p,f,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&nc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&nc(this,s)&&(h=g,h.command=fe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=fe.move,this._renderer.vertices.unshift(g),f=this._collection[m+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(we.zero,g.t):(Mm.copy(f),this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return un.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,un.prototype.flagReset.call(this),this}};C(qt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),C(qt,"Utils",{getCurveLength:ic});let Ne=qt;const ac={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function lc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function cc(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function hc(){this._flagFill=!0}function uc(){this._flagStroke=!0}const Am=Math.ceil,Vm=Math.floor,an=class an extends un{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"noFill",Ne.prototype.noFill);C(this,"noStroke",Ne.prototype.noStroke);C(this,"corner",Ne.prototype.corner);C(this,"center",Ne.prototype.center);C(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);C(this,"_updateLength",Ne.prototype._updateLength);for(let r in fc)Object.defineProperty(this,r,fc[r]);this._renderer.type="points",this._renderer.flagVertices=lc.bind(this),this._renderer.bindVertices=cc.bind(this),this._renderer.unbindVertices=dc.bind(this),this._renderer.flagFill=hc.bind(this),this._renderer.flagStroke=uc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new an().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<an.Properties.length;r++){const s=an.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new an;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<an.Properties.length;s++){const o=an.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(an.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=Yl(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Ur(this,n*this._length),o=Ur(this,r*this._length),a=Am(s),l=Vm(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};C(an,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Kr=an;const fc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class pc extends Ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ha(this,vs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Ct(this,vs)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}vs=new WeakMap;const _n=class _n extends Ne{constructor(n,r,s,o,a,l,c){const d=c||Xs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",Jn);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in gc)Object.defineProperty(this,u,gc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ti(n,Jn)===Ti(r,Jn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,p,f,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),p=0,f=d-1;p<d;p++){switch(g=p/f,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),p){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-it),m.controls.left.y=x*Math.sin(_-it),m.controls.right.x=x*Math.cos(_+it),m.controls.right.y=x*Math.sin(_+it),p===1&&m.controls.left.multiplyScalar(2),p===f&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,f=d-1),p=0;p<d;p++)g=p/f,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,p<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+it),m.controls.left.y=x*Math.sin(_+it),m.controls.right.x=x*Math.cos(_-it),m.controls.right.y=x*Math.sin(_-it),p===1&&m.controls.left.multiplyScalar(2),p===f&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new _n(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};C(_n,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ys=_n;const gc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Us=Math.cos,Gs=Math.sin,yn=class yn extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in mc)Object.defineProperty(this,c,mc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*Jn,d=s*Us(c),h=s*Gs(c),u=o*Us(c-it),p=o*Gs(c-it),f=o*Us(c+it),g=o*Gs(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new yn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};C(yn,"Properties",["radius"]);let Ks=yn;const mc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Zs=Math.cos,Js=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new $e);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in _c)Object.defineProperty(this,d,_c[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*Jn,d=s*Zs(c),h=o*Js(c),u=s*r*Zs(c-it),p=o*r*Js(c-it),f=s*r*Zs(c+it),g=o*r*Js(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new bn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};C(bn,"Properties",["width","height"]);let Qs=bn;const _c={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Om=Math.cos,Im=Math.sin,wn=class wn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in yc)Object.defineProperty(this,a,yc[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new wn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Jn*a+Math.PI/2,c=this._width*Om(l)/2,d=this._height*Im(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new wn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n}};C(wn,"Properties",["width","height","sides"]);let eo=wn;const yc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},gi=class gi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);C(this,"_flagWidth",0);C(this,"_flagHeight",0);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in bc)Object.defineProperty(this,l,bc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new gi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gi.Properties.length;r++){const s=gi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new gi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(gi,"Properties",["width","height"]);let to=gi;const bc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(G.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},vn=class vn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in wc)Object.defineProperty(this,c,wc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=zm.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof we?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(vn,"Properties",["width","height","radius"]);let no=vn;const wc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function zm(){this._flagRadius=!0}const Lm=Math.cos,Dm=Math.sin,kn=class kn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in vc)Object.defineProperty(this,l,vc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Jn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Lm(l),h=c*Dm(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new kn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};C(kn,"Properties",["innerRadius","outerRadius","sides"]);let io=kn;const vc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let ro;const kc=Math.min,xc=Math.max;Jt.document&&(ro=document.createElement("canvas"));const mt=class mt extends un{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in Cc)Object.defineProperty(this,a,Cc[a]);if(this._renderer.type="text",this._renderer.flagFill=Hm.bind(this),this._renderer.flagStroke=Wm.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Ae.isObject(o))return this;for(let a=0;a<mt.Properties.length;a++){const l=mt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ro){const r=ro.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*mt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new mt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<mt.Properties.length;r++){const s=mt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<mt.Properties.length;s++){const o=mt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<mt.Properties.length;r++){const s=mt.Properties[r];n[s]=this[s]}return n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=mt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,p]=r.multiply(s,a),[f,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=kc(p,g,_,b),s=kc(u,f,m,y),o=xc(u,f,m,y),l=xc(p,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(mt,"Ratio",.6),C(mt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Ri=mt;const Cc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof wt||this._fill instanceof vt||this._fill instanceof rt)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof wt||this._stroke instanceof vt||this._stroke instanceof rt)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Hm(){this._flagFill=!0}function Wm(){this._flagStroke=!0}const Zr=Math.min,Jr=Math.max,xn=class xn extends un{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);for(let r in Sc)Object.defineProperty(this,r,Sc[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)Bc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Bc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new xn;for(let o=0;o<xn.Properties.length;o++){const a=xn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ei(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Ys.fromObject(o);case"circle":return Ks.fromObject(o);case"ellipse":return Qs.fromObject(o);case"points":return Kr.fromObject(o);case"polygon":return eo.fromObject(o);case"rectangle":return to.fromObject(o);case"rounded-rectangle":return no.fromObject(o);case"star":return io.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Ri.fromObject(o);case"group":return xn.fromObject(o);case"shape":return un.fromObject(o);case"element":return ir.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new xn,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Ae.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,p=-1/0;const f=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||f.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Ae.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ae.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ae.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ae.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);u=Zr(y,S,v,k,u),d=Zr(_,b,x,B,d),h=Jr(_,b,x,B,h),p=Jr(y,S,v,k,p)}else u=Zr(r.top,u),d=Zr(r.left,d),h=Jr(r.right,h),p=Jr(r.bottom,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};C(xn,"Children",pc),C(xn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let fn=xn;const Sc={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=fn.InsertChildren.bind(this),n=fn.RemoveChildren.bind(this),r=fn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new pc(e),this._children.bind(G.Types.insert,t),this._children.bind(G.Types.remove,n),this._children.bind(G.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Bc(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class so extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Tc)Object.defineProperty(this,a,Tc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Tc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new qr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new qr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class oo{constructor(t=0,n=0){this.x=t,this.y=n}}class ti{constructor(t=10,n=0,r="A"){C(this,"start",new oo);C(this,"end",new oo);this.width=t,this.angle=n,this.label=r}}const Ie={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},jm={class:"flex gap-3"},Xm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},qm={ref:"drawing-container",class:"size-full"},Ym={},Ec=i.defineComponent({...Ym,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((F,N)=>new ti(n.value.configuratorParams.linesWidths[N],F,`A-${N+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var F,N;return n.value.configuratorParams.startTailType&&((F=n.settings.startTailConfigs)!=null&&F[n.value.configuratorParams.startTailType])?(N=n.settings.startTailConfigs)==null?void 0:N[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var F,N;return n.value.configuratorParams.endTailType&&((F=n.settings.endTailConfigs)!=null&&F[n.value.configuratorParams.endTailType])?(N=n.settings.endTailConfigs)==null?void 0:N[n.value.configuratorParams.endTailType].points:[]}),g=(F,N=!1)=>{F[0].start.x=0,F[0].start.y=0;let X=0;for(let z=0;z<F.length;z++){const U=F[z],O=F[z-1]??new ti(0,X);X+=!N||z>1?O.angle:0;const I=(!N||z>0?U.angle:0)+X;if(F[z].end.x=U.width*Math.cos(I*Math.PI/180)+F[z].start.x,F[z].end.y=U.width*Math.sin(I*Math.PI/180)+F[z].start.y,z<F.length-1){const J=z+1;F[J].start.x=F[z].end.x,F[J].start.y=F[z].end.y}}return F},m=(F,N,X,z,U=!1)=>{let O=g([...X,...z]);N.length>0&&(O=[...g(N),...O]);let I=0,J=0,pe=0,ie=0;O.forEach(Fe=>{I=Math.min(I,Fe.start.x,Fe.end.x),J=Math.min(J,Fe.start.y,Fe.end.y),pe=Math.max(pe,Fe.start.x,Fe.end.x),ie=Math.max(ie,Fe.start.y,Fe.end.y)});let ge,re;I===0&&J===0&&pe===0&&ie===0?(ge=1,re=1):(ge=F.width/Math.abs(pe-I),re=(U?F.height:F.height-Ie.colorSideLabel.size)/Math.abs(ie-J));const Me=Math.min(ge,re);return I=I<0?-I*Me:0,J=J<0?-J*Me:0,[Me,I,J]},_=F=>{const N=new Kr([F]);return N._size=Ie.anchorPoint.size,N.fill=Ie.anchorPoint.color,N.stroke="transparent",N._linewidth=Ie.anchorPoint.strokeSize,l.push(N),N},y=(F,N)=>{if(l=[],n.settings.allowChangeFirstPoint){const X=F[0],z=new we(X.vertices[0].x,X.vertices[0].y);z.bind(G.Types.change,()=>{X.vertices[0].copy(z)});const U=_(z);N.add(U)}F.forEach((X,z)=>{const U=F[z+1],O=new we(X.vertices[1].x,X.vertices[1].y);O.bind(G.Types.change,()=>{X.vertices[1].copy(O),U!==void 0&&U.vertices[0].copy(O)});const I=_(O);N.add(I)})},b=F=>F*(Math.PI/180),S=(F,N,X)=>{const z=N.vertices.length-1;F.position.x=N.vertices[z].x,F.position.y=N.vertices[z].y;const U=Math.atan2(N.vertices[z].y-N.vertices[0].y,N.vertices[z].x-N.vertices[0].x);F.rotation=b(X)+U},x=(F,N,X)=>{if(N.vertices[0]===void 0)return;F.position.x=N.vertices[0].x,F.position.y=N.vertices[0].y;const z=N.vertices.length-1,U=Math.atan2(N.vertices[z].y-N.vertices[0].y,N.vertices[z].x-N.vertices[0].x);F.rotation=b(X)+U},v=(F,N,X)=>{const z=new fn;if(F.length===0)return z;const U=[];return[...F].reverse().forEach((O,I)=>{I!==0&&O.angle>0&&(O.angle*=-1),U.push(O)}),F=g(U,!0),x(z,N,F[0].angle),[N.vertices[0],N.vertices[1]].forEach(O=>{O.bind(G.Types.change,()=>{x(z,N,F[0].angle)})}),F.forEach(O=>{const I=O.start.x*X,J=O.end.x*X,pe=O.start.y*X,ie=O.end.y*X,ge=new so(I,pe,J,ie);ge.linewidth=Ie.line.size,ge.stroke=Ie.line.color,z.add(ge)}),z},B=(F,N,X)=>{const z=new fn;return F.length===0||(F=g(F,!0),S(z,N,F[0].angle),[N.vertices[0],N.vertices[1]].forEach(U=>{U.bind(G.Types.change,()=>{S(z,N,F[0].angle)})}),F.forEach(U=>{const O=U.start.x*X,I=U.end.x*X,J=U.start.y*X,pe=U.end.y*X,ie=new so(O,J,I,pe);ie.linewidth=Ie.line.size,ie.stroke=Ie.line.color,z.add(ie)})),z},k=(F,N,X,z)=>{const U=N.vertices[0].x+(N.vertices[1].x-N.vertices[0].x)/2-8*Math.sin(F.angle*Math.PI/180),O=N.vertices[0].y+(N.vertices[1].y-N.vertices[0].y)/2-8*Math.cos(F.angle*Math.PI/180),I=new Ri(F.label,U+10,O-10);let J;I.size=Ie.lineLabel.size,I.weight=600,I.fill=Ie.lineLabel.color,I.id+=1,I.rotation=Ie.lineLabel.rotation,z>0&&(J=new Ri(`${F.angle}°`,N.vertices[0].x+25,N.vertices[0].y-25),J.size=Ie.angleLabel.size,J.weight=600,J.fill=Ie.angleLabel.color,J.rotation=Ie.angleLabel.rotation,J.id+=z,o.push(J),X.add(J)),X.add(I),P(I,N,0,J),P(I,N,1)},$=()=>{const{size:F}=Ie.colorSideLabel,N=0,X=0,z=u.value?F/2:F/2-F,U=u.value?F/2-F:F/2,O=new fn;if(!c)return O;const I=5,J=Math.atan2(U-z,X-N),pe=[new $e(N,z,0,0,0,0,he.Commands.move),new $e(X,U,0,0,0,0,he.Commands.line),new $e(X-I*Math.cos(J-Math.PI/4),U-I*Math.sin(J-Math.PI/4),0,0,0,0,he.Commands.line),new $e(X,U,0,0,0,0,he.Commands.move),new $e(X-I*Math.cos(J+Math.PI/4),U-I*Math.sin(J+Math.PI/4),0,0,0,0,he.Commands.line)],ie=new Ne(pe,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=F/7,ie.stroke=Ie.colorSideLabel.color,O.add(ie);const ge=new Ri(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=F,ge.weight=600,ge.fill=Ie.colorSideLabel.color,ge.alignment="left",O.add(ge);const re=O.getBoundingClientRect();return O.position.x=(c.width-re.width)*d+10,O.position.y=u.value?c.height+re.height*2:re.height/2,O},P=(F,N,X,z)=>{N.vertices[X].bind(G.Types.change,()=>{const U=N.vertices.length-1,O=Math.atan2(N.vertices[0].y-N.vertices[U].y,N.vertices[0].x-N.vertices[U].x)*180/Math.PI,I=N.vertices[0].x+(N.vertices[U].x-N.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),J=N.vertices[0].y+(N.vertices[U].y-N.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);F.position.x=I+10,F.position.y=J-10,F.rotation=-.5,z&&(z.position.x=N.vertices[0].x+25,z.position.y=N.vertices[0].y-25)})},R=(F,N,X,z,U=!1)=>{var Ge;if(F.clear(),X.length===0){F.update();return}const O=g(X),[I,J,pe]=m(F,N,O,z,U),ie=new fn,ge=new Array,re=new Array;U||(o=[],a=[]),O.forEach((xe,Se)=>{const st=xe.start.x*I+J,Ke=xe.end.x*I+J,nt=xe.start.y*I+pe,Yt=xe.end.y*I+pe,$t=new so(st,nt,Ke,Yt);$t.linewidth=U?Ie.previewLine.size:Ie.line.size,$t.stroke=U?Ie.previewLine.color:Ie.line.color,a.push($t),ge.push($t),ie.add($t),!U&&xe.label!==""&&k(xe,$t,ie,Se)});const Me=ge.at(-1);let Fe=ie.getBoundingClientRect();if(!U){const xe=$();re.push(xe)}if(N.length>0){const xe=v(N,ge[0],I);ie.add(xe)}if(z.length>0&&Me){const xe=B(z,Me,I);ie.add(xe)}if(re.push(ie),F.makeGroup(re),Fe=ie.getBoundingClientRect(),ie.position.x=0-Fe.left+(F.width-Fe.width)/(2*(U?1:d)),ie.position.y=0-Fe.top+(F.height-Fe.height)/(2*(U?1:d)),F.update(),!U){const xe=((Ge=n.value.configuratorParams)==null?void 0:Ge.colorSide)==="top";ie.position.y=ie.position.y+Ie.colorSideLabel.size*Number(xe),y(ge,ie),F.update()}},j=(F,N)=>{if(F&&!N.isNewRec()){const X=new he({width:F.scrollWidth,height:F.scrollHeight});X.appendTo(F),R(X,[],N.points,[],!0)}},Y=()=>{c&&R(c,p.value,h.value,f.value,!1)},A=F=>F*(180/Math.PI),E=(F,N)=>{const X=F[1].x-F[0].x,z=F[1].y-F[0].y,U=N[1].x-N[0].x,O=N[1].y-N[0].y;let I=Math.atan2(X*O-z*U,X*U+z*O);return I=A(I),Math.round(I)*-1},M=F=>{const N=a.map((X,z,U)=>{const O=U[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let I=Math.ceil(X._length/F/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[z-1];I<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(I=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),I>n.settings.maxLineWidth&&(I=n.settings.maxLineWidth);const pe=E(X.vertices,O.vertices);return J&&(J.value=`${pe}°`),new ti(I,pe,`A-${z+1}`)});r("pointer:move",N)},K=F=>{let N=null,X;const z=J=>{N=l.find(pe=>{const ie=pe.renderer;return(ie==null?void 0:ie.elem)===J.target}),[X]=m(F,p.value,h.value.map(pe=>pe),f.value)},U=J=>{if(N){const pe=N.renderer,ie=pe==null?void 0:pe.elem;if(!ie)return;const ge=ie.getBoundingClientRect();N.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Ie.anchorPoint.size/2,N.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Ie.anchorPoint.size/2,M(X),F.update()}},O=()=>{N&&r("pointer:up",h.value),N=null},I=s.value;I&&(I.addEventListener("touchstart",z),I.addEventListener("touchend",O),I.addEventListener("mousedown",z),I.addEventListener("mouseup",O),I.addEventListener("mousemove",U),I.addEventListener("touchmove",U))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{Y()},{deep:!0,immediate:!0}),K(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(F,N)=>(i.openBlock(),i.createElementBlock("div",jm,[i.createVNode(Ea,{"select-template-index":F.selectTemplateIndex,settings:F.settings,"onTemplate:select":N[0]||(N[0]=X=>r("template:select",X)),onInitDrawTemplate:j},null,8,["select-template-index","settings"]),i.createElementVNode("div",Xm,[i.createElementVNode("div",qm,null,512)])]))}}),Um={class:"flex max-w-[50rem] flex-col gap-3"},Gm={},Km=i.defineComponent({...Gm,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),p=(v=0)=>{const B=c.value.allTemplates.at(v);B!==void 0&&(u.value=v,l.value.configuratorParams.linesWidths=B.points.map(k=>W.isArray(k)?k[0]:k.width),l.value.configuratorParams.linesAngles=B.points.map(k=>W.isArray(k)?k[1]:k.angle),y()),m(l.value.configuratorParams)},f=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,$)=>[k,l.value.configuratorParams.linesAngles[$]])};await H.HttpRequester.getInstance(H.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async v=>{y(),s.value=!0,await H.HttpRequester.getInstance(H.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?H.HttpRequester.getInstance(H.CartProvider).addCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1}):H.HttpRequester.getInstance(H.CartProvider).patchCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},b=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",Um,[i.createVNode(Ec,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Ra,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=k=>m(k)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":f},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Pi extends H.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>W.isArray(s)?new ti(s[0],s[1],`A-${o+1}`):new ti(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ti(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ao extends Pi{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class Zm{constructor(t){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Pi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new ao(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new ao(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Pi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Pi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Pi(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const Jm={},Fi=i.defineComponent({...Jm,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=W.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:f.clearable,placeholder:f.placeholder,min:f.min,max:f.max,step:f.step,validator:f.validator},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Qm={class:"flex flex-col gap-3"},e0={},$c=i.defineComponent({...e0,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new H.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Qm,[i.createVNode(i.unref(V.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),t0={class:"w-104 px-5"},n0={},i0=i.defineComponent({...n0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await H.HttpRequester.getInstance(H.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?H.HttpRequester.getInstance(H.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):H.HttpRequester.getInstance(H.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",t0,[i.createVNode($c,{value:s.value,"onUpdate:value":u[0]||(u[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=p=>c(p)),onSubmit:u[2]||(u[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),r0={key:0,class:"flex items-baseline gap-1"},s0={key:0,class:"flex items-baseline gap-1"},o0={class:"flex gap-3"},a0={},Nc=i.defineComponent({...a0,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,f)=>{p&&p in o.value&&(o.value[p]=f??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(p,f)=>{const g=new H.CartItemBase(n.value);g[p]=f,r("update:value",g)};return(p,f)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[f[0]||(f[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":f[1]||(f[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[f[2]||(f[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",r0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[4]||(f[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>f[11]||(f[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",s0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[6]||(f[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>f[12]||(f[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":f[5]||(f[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:p.value.quantity,"onUpdate:value":f[7]||(f[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":f[8]||(f[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",o0,[i.createVNode(i.unref(V.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:f[9]||(f[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:f[10]||(f[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>f[13]||(f[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),l0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",c0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",d0="/img/configurators/mosquitto/measurement-instructions/mount.png",h0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",u0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",f0={class:"flex flex-col gap-6"},p0={class:"flex gap-4"},g0={class:"flex flex-col gap-2"},m0={class:"flex gap-4"},_0={class:"flex flex-col gap-2"},y0={class:"flex gap-4"},b0={class:"flex flex-col gap-2"},w0={},Rc=i.defineComponent({...w0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=_t.initRefDependingOnDeviceResolution("small","small","medium"),r=_t.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.NModal),{show:a.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",f0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:l0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:c0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",p0,[l[9]||(l[9]=i.createElementVNode("img",{src:d0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",g0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",m0,[l[15]||(l[15]=i.createElementVNode("img",{src:h0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",_0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",y0,[l[21]||(l[21]=i.createElementVNode("img",{src:u0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",b0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),v0={class:"flex flex-col items-center justify-between rounded-xl"},k0={class:"img-preview relative flex justify-center"},x0={},C0=i.defineComponent({...x0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>W.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=V.NButton;return i.openBlock(),i.createElementBlock("div",v0,[i.createElementVNode("div",k0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ")])),_:1,__:[2]})])}}}),lo=Ln(C0,[["__scopeId","data-v-8b43aa68"]]),S0={class:"grid md:grid-cols-2"},B0={},T0=i.defineComponent({...B0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0&&(d.value=!0,await H.HttpRequester.getInstance(H.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?H.HttpRequester.getInstance(H.CartProvider).addCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1}):H.HttpRequester.getInstance(H.CartProvider).patchCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1})),h.value=!1};return(f,g)=>{const m=Br;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Rc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":f.settings.heightOverlaps,"width-overlaps":f.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",S0,[s.value?(i.openBlock(),i.createBlock(i.unref(V.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(lo,{"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(lo,{key:0,"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Nc,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:f.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>p()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),E0={},Pc=i.defineComponent({...E0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return t({focusWidthInput:c}),(d,h)=>{const u=Na,p=$a;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(qi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:f=>!!f&&f>=d.settings.minLineWidth&&f%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=f=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=f=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),$0={class:"my-2 flex w-full flex-col"},N0={class:"flex gap-3"},R0={},Fc=i.defineComponent({...R0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,u)=>h+u,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,u,p)=>{const f=n.value.at(u);if(f)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:f.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,p),d("configuratorParams",g)}else f.product.id=-1},d=(h,u)=>{const p=n.value.map(f=>new H.CartItemBase(f));p.forEach(f=>{f[h]=u}),r("update:value",p)};return(h,u)=>{const p=V.NText,f=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Pc,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",$0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",N0,[i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:u[6]||(u[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),P0={class:"flex grow flex-col"},F0=["src"],M0={class:"w-full"},A0={},Mc=i.defineComponent({...A0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,F0),i.createElementVNode("div",M0,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),V0={class:"w-104 flex grow flex-col px-5"},O0={},I0=i.defineComponent({...O0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,f)=>p+f,0)),c=p=>{p===void 0&&(p=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new H.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,f,g)=>{g.value=!0,await H.HttpRequester.getInstance(H.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:p.linesWidths.at(f)},o.value).then(m=>{s.value[f].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new H.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?H.HttpRequester.getInstance(H.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):H.HttpRequester.getInstance(H.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,f)=>(i.openBlock(),i.createElementBlock("div",V0,[i.createVNode(Mc,{value:s.value,"onUpdate:value":f[0]||(f[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Fc,{value:s.value,"onUpdate:value":f[1]||(f[1]=g=>s.value=g),validation:o.value,settings:p.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),z0={class:"flex flex-row gap-2.5"},L0={class:"flex flex-col"},D0={class:"flex flex-col"},H0={},W0=i.defineComponent({...H0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>H.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return W.forOwn(H.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Sn.startOfDay(new Date(a)):void 0,to:l?Sn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,p,f;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",z0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.to)&&g>((_=a.dateRange)==null?void 0:_.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,_;return o(g,(_=(m=a.dateRange)==null?void 0:m.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",L0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(f=(p=a.dateRange)==null?void 0:p.to)==null?void 0:f.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.from)&&g<((_=a.dateRange)==null?void 0:_.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,_;return o((_=(m=a.dateRange)==null?void 0:m.from)==null?void 0:_.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",D0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),j0={class:"sc-lbl-date text-nowrap"},X0={},co=i.defineComponent({...X0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Sn.format(t.date,H.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Sn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",j0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),q0={class:"flex flex-row gap-2.5"},Y0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},U0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},G0={class:"mb-0.5 sm:mb-0 sm:ml-3"},K0={},Z0=i.defineComponent({...K0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Br,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",q0,[i.createElementVNode("div",Y0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",U0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",G0,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),J0={key:0,class:"flex flex-row gap-2.5"},Q0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},e_={},t_=i.defineComponent({...e_,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=_t.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=_t.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),t({open:h,close:u}),(f,g)=>{const m=V.NButton,_=V.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:f.title,"action-class":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||f.acceptButton.show||f.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",J0,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||f.acceptButton.show||f.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Q0,[i.renderSlot(f.$slots,"action",{disabled:a.value}),f.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),f.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(e,t){return i.openBlock(),i.createElementBlock("svg",n_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)]))}const r_=i.markRaw({name:"ion-download-outline",render:i_}),s_={},o_=i.defineComponent({...s_,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=r_,c=V.NUploadDragger,d=V.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),a_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function l_(e,t){return i.openBlock(),i.createElementBlock("svg",a_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)]))}const c_=i.markRaw({name:"ion-checkmark-done-sharp",render:l_}),d_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h_(e,t){return i.openBlock(),i.createElementBlock("svg",d_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)]))}const u_=i.markRaw({name:"ion-options-outline",render:h_}),f_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},p_={class:"flex-auto"},g_={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},m_={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},__={},ho=i.defineComponent({...__,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(e,{emit:t}){const n=t,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=u_,u=V.NButton,p=V.NPopover,f=c_,g=Br;return i.openBlock(),i.createElementBlock("div",f_,[i.createElementVNode("div",p_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",g_,[i.createElementVNode("div",m_,[c.showEditButton?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные "))]),_:1,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения "))]),_:1,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),y_={},Ac=i.defineComponent({...y_,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(ho,{key:1,disabled:l.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(ho,{key:0,disabled:l.disabled,"show-edit-button":l.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),b_={},w_=i.defineComponent({...b_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=W.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),v_={},k_=i.defineComponent({...v_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=W.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(W.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(W.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Wi.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Wi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Wi.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Lh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),x_=Ln(k_,[["__scopeId","data-v-751dbb0e"]]),C_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S_(e,t){return i.openBlock(),i.createElementBlock("svg",C_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)]))}const B_=i.markRaw({name:"tabler-external-link",render:S_}),T_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},E_=["href"],$_={},N_=i.defineComponent({...$_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=B_,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(W.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",T_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,E_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),R_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P_(e,t){return i.openBlock(),i.createElementBlock("svg",R_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)]))}const F_=i.markRaw({name:"ion-remove-circle-outline",render:P_});let Qr=[];const Vc=new WeakMap;function M_(){Qr.forEach(e=>e(...Vc.get(e))),Qr=[]}function Oc(e,...t){Vc.set(e,t),!Qr.includes(e)&&Qr.push(e)===1&&requestAnimationFrame(M_)}function sr(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function or(e){return e.composedPath()[0]||null}function ar(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function lr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function jt(e,t){const n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Ic={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",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:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",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:"#F00",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:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function A_(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function V_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const tn="^\\s*",nn="\\s*$",Rn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",At="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ni="([0-9A-Fa-f])",ii="([0-9A-Fa-f]{2})",zc=new RegExp(`${tn}hsl\\s*\\(${At},${Rn},${Rn}\\)${nn}`),Lc=new RegExp(`${tn}hsv\\s*\\(${At},${Rn},${Rn}\\)${nn}`),Dc=new RegExp(`${tn}hsla\\s*\\(${At},${Rn},${Rn},${At}\\)${nn}`),Hc=new RegExp(`${tn}hsva\\s*\\(${At},${Rn},${Rn},${At}\\)${nn}`),O_=new RegExp(`${tn}rgb\\s*\\(${At},${At},${At}\\)${nn}`),I_=new RegExp(`${tn}rgba\\s*\\(${At},${At},${At},${At}\\)${nn}`),z_=new RegExp(`${tn}#${ni}${ni}${ni}${nn}`),L_=new RegExp(`${tn}#${ii}${ii}${ii}${nn}`),D_=new RegExp(`${tn}#${ni}${ni}${ni}${ni}${nn}`),H_=new RegExp(`${tn}#${ii}${ii}${ii}${ii}${nn}`);function Tt(e){return parseInt(e,16)}function W_(e){try{let t;if(t=Dc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),si(t[13])];if(t=zc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function j_(e){try{let t;if(t=Hc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),si(t[13])];if(t=Lc.exec(e))return[ts(t[1]),Pn(t[5]),Pn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ri(e){try{let t;if(t=L_.exec(e))return[Tt(t[1]),Tt(t[2]),Tt(t[3]),1];if(t=O_.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),1];if(t=I_.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),si(t[13])];if(t=z_.exec(e))return[Tt(t[1]+t[1]),Tt(t[2]+t[2]),Tt(t[3]+t[3]),1];if(t=H_.exec(e))return[Tt(t[1]),Tt(t[2]),Tt(t[3]),si(Tt(t[4])/255)];if(t=D_.exec(e))return[Tt(t[1]+t[1]),Tt(t[2]+t[2]),Tt(t[3]+t[3]),si(Tt(t[4]+t[4])/255)];if(e in Ic)return ri(Ic[e]);if(zc.test(e)||Dc.test(e)){const[n,r,s,o]=W_(e);return[...V_(n,r,s),o]}else if(Lc.test(e)||Hc.test(e)){const[n,r,s,o]=j_(e);return[...A_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function X_(e){return e>1?1:e<0?0:e}function uo(e,t,n,r){return`rgba(${ut(e)}, ${ut(t)}, ${ut(n)}, ${X_(r)})`}function fo(e,t,n,r,s){return ut((e*t*(1-r)+n*r)/s)}function q_(e,t){Array.isArray(e)||(e=ri(e)),Array.isArray(t)||(t=ri(t));const n=e[3],r=t[3],s=si(n+r-n*r);return uo(fo(e[0],n,t[0],r,s),fo(e[1],n,t[1],r,s),fo(e[2],n,t[2],r,s),s)}function Pe(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e);return typeof t.alpha=="number"?uo(n,r,s,t.alpha):uo(n,r,s,o)}function es(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e),{lightness:a=1,alpha:l=1}=t;return Y_([n*a,r*a,s*a,o*l])}function si(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ts(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ut(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Pn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function Y_(e){const[t,n,r]=e;return 3 in e?`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, ${si(e[3])})`:`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, 1)`}function U_(e=8){return Math.random().toString(16).slice(2,2+e)}function Wc(e){return Array.isArray(e)?e:[e]}const po={STOP:"STOP"};function jc(e,t){const n=t(e);e.children!==void 0&&n!==po.STOP&&e.children.forEach(r=>jc(r,t))}function G_(e,t={}){const{preserveGroup:n=!1}=t,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(e),r}function K_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function Z_(e){return e.children}function J_(e){return e.key}function Q_(){return!1}function ey(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function ty(e){return e.disabled===!0}function ny(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function iy(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function go(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function mo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function ry(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function sy(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function oy(e){return(e==null?void 0:e.type)==="group"}function ay(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class ly extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function cy(e,t,n,r){return ns(t.concat(e),n,r,!1)}function dy(e,t){const n=new Set;return e.forEach(r=>{const s=t.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function hy(e,t,n,r){const s=ns(t,n,r,!1),o=ns(e,n,r,!0),a=dy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function _o(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:ry(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:sy(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=hy(s,n,t,d):r!==void 0?u=cy(r,n,t,d):u=ns(n,t,d,!1);const p=c==="parent",f=c==="child"||l,g=u,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const x of S){if(x.isLeaf)continue;const{key:v,shallowLoaded:B}=x;if(f&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let k=!0,$=!1,P=!0;for(const R of x.children){const j=R.key;if(!R.disabled){if(P&&(P=!1),g.has(j))$=!0;else if(m.has(j)){$=!0,k=!1;break}else if(k=!1,$)break}}k&&!P?(p&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(v)):$&&m.add(v),b&&f&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function ns(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&jc(d,h=>{if(h.disabled)return po.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),ny(h.rawNode,o))){if(r)return po.STOP;if(!n)throw new ly}})}),l}function uy(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(t||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function fy(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function py(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Xc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?gy:py,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=yo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=my(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function gy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function my(e){return e.parent}function yo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=yo(d,t);if(h!==null)return h}else return d}}return null}const _y={getChild(){return this.ignored?null:yo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Xc(this,"next",e)},getPrev(e={}){return Xc(this,"prev",e)}};function yy(e,t){const n=t?new Set(t):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(e),r}function by(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var wy={};function qc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;wy.NODE_ENV!=="production"&&iy(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const p=s(c);Array.isArray(p)&&(u.children=qc(p,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function vy(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=ty,getIgnored:a=Q_,getIsGroup:l=oy,getKey:c=J_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:Z_,h=t.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return K_(this.rawNode,h)},get shallowLoaded(){return ey(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return by(this,x)}},_y),p=qc(e,r,s,u,h);function f(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function g(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function m(x,v){const B=g(x);return B?B.getPrev(v):null}function _(x,v){const B=g(x);return B?B.getNext(v):null}function y(x){const v=g(x);return v?v.getParent():null}function b(x){const v=g(x);return v?v.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return yy(p,x)},getNode:f,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return fy(p)},getPath(x,v={}){return uy(x,v,S)},getCheckedKeys(x,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:$="all",allowNotLoaded:P=!1}=v;return _o({checkedKeys:go(x),indeterminateKeys:mo(x),cascade:B,leafOnly:k,checkStrategy:$,allowNotLoaded:P},S)},check(x,v,B={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(v),indeterminateKeys:mo(v),keysToCheck:x==null?[]:Wc(x),cascade:k,leafOnly:$,checkStrategy:P,allowNotLoaded:R},S)},uncheck(x,v,B={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(v),indeterminateKeys:mo(v),keysToUncheck:x==null?[]:Wc(x),cascade:k,leafOnly:$,checkStrategy:P,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return G_(p,x)}};return S}function is(e){return e.composedPath()[0]}const ky={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function xy(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(is(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(is(a))},o=a=>{r&&(t.contains(is(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Yc(e,t,n){const r=ky[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=xy(e,t,n)),o}function Cy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Yc(e,t,n);return Object.keys(s).forEach(o=>{kt(o,document,s[o],r)}),!0}return!1}function Sy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Yc(e,t,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function By(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(k,$,P){const R=k[$];return k[$]=function(){return P.apply(k,arguments),R.apply(k,arguments)},k}function o(k,$){k[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,$){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const h={bubble:{},capture:{}},u={};function p(){const k=function($){const{type:P,eventPhase:R,bubbles:j}=$,Y=is($);if(R===2)return;const A=R===1?"capture":"bubble";let E=Y;const M=[];for(;E===null&&(E=window),M.push(E),E!==window;)E=E.parentNode||null;const K=h.capture[P],F=h.bubble[P];if(s($,"stopPropagation",n),s($,"stopImmediatePropagation",r),d($,c),A==="capture"){if(K===void 0)return;for(let N=M.length-1;N>=0&&!e.has($);--N){const X=M[N],z=K.get(X);if(z!==void 0){a.set($,X);for(const U of z){if(t.has($))break;U($)}}if(N===0&&!j&&F!==void 0){const U=F.get(X);if(U!==void 0)for(const O of U){if(t.has($))break;O($)}}}}else if(A==="bubble"){if(F===void 0)return;for(let N=0;N<M.length&&!e.has($);++N){const X=M[N],z=F.get(X);if(z!==void 0){a.set($,X);for(const U of z){if(t.has($))break;U($)}}}}o($,"stopPropagation"),o($,"stopImmediatePropagation"),d($)};return k.displayName="evtdUnifiedHandler",k}function f(){const k=function($){const{type:P,eventPhase:R}=$;if(R!==2)return;const j=u[P];j!==void 0&&j.forEach(Y=>Y($))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=p(),m=f();function _(k,$){const P=h[k];return P[$]===void 0&&(P[$]=new Map,window.addEventListener($,g,k==="capture")),P[$]}function y(k){return u[k]===void 0&&(u[k]=new Set,window.addEventListener(k,m)),u[k]}function b(k,$){let P=k.get($);return P===void 0&&k.set($,P=new Set),P}function S(k,$,P,R){const j=h[$][P];if(j!==void 0){const Y=j.get(k);if(Y!==void 0&&Y.has(R))return!0}return!1}function x(k,$){const P=u[k];return!!(P!==void 0&&P.has($))}function v(k,$,P,R){let j;if(typeof R=="object"&&R.once===!0?j=K=>{B(k,$,j,R),P(K)}:j=P,Cy(k,$,j,R))return;const A=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",E=_(A,k),M=b(E,$);if(M.has(j)||M.add(j),$===window){const K=y(k);K.has(j)||K.add(j)}}function B(k,$,P,R){if(Sy(k,$,P,R))return;const Y=R===!0||typeof R=="object"&&R.capture===!0,A=Y?"capture":"bubble",E=_(A,k),M=b(E,$);if($===window&&!S($,Y?"bubble":"capture",k,P)&&x(k,P)){const F=u[k];F.delete(P),F.size===0&&(window.removeEventListener(k,m),u[k]=void 0)}M.has(P)&&M.delete(P),M.size===0&&E.delete($),E.size===0&&(window.removeEventListener(k,g,A==="capture"),h[A][k]=void 0)}return{on:v,off:B}}const{on:kt,off:et}=By(),Mi="@@mmoContext",Ty={mounted(e,{value:t}){e[Mi]={handler:void 0},typeof t=="function"&&(e[Mi].handler=t,kt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Mi];typeof t=="function"?n.handler?n.handler!==t&&(et("mousemoveoutside",e,n.handler),n.handler=t,kt("mousemoveoutside",e,t)):(e[Mi].handler=t,kt("mousemoveoutside",e,t)):n.handler&&(et("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Mi];t&&et("mousemoveoutside",e,t),e[Mi].handler=void 0}},Ai="@@coContext",rs={mounted(e,{value:t,modifiers:n}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,kt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ai];typeof t=="function"?r.handler?r.handler!==t&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,kt("clickoutside",e,t,{capture:n.capture})):(e[Ai].handler=t,kt("clickoutside",e,t,{capture:n.capture})):r.handler&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ai];n&&et("clickoutside",e,n,{capture:t.capture}),e[Ai].handler=void 0}};function Ey(e,t){console.error(`[vdirs/${e}]: ${t}`)}class $y{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&Ey("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const bo=new $y,Vi="@@ziContext",Uc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Vi]={enabled:!!s,initialized:!1},s&&(bo.ensureZIndex(e,r),e[Vi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Vi].enabled;s&&!o&&(bo.ensureZIndex(e,r),e[Vi].initialized=!0),e[Vi].enabled=!!s},unmounted(e,t){if(!e[Vi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;bo.unregister(e,r)}};function Ny(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function Lt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const Ry=typeof window<"u";let Oi,cr;(()=>{var e,t;Oi=Ry?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,cr=!1,Oi!==void 0?Oi.then(()=>{cr=!0}):cr=!0})();function Py(e){if(cr)return;let t=!1;i.onMounted(()=>{cr||Oi==null||Oi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function wo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function ss(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Gc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Fy=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function My(){return Fy}function vo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function ko(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ko(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ko(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Kc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Fn=null;function Zc(){if(Fn===null&&(Fn=document.getElementById("v-binder-view-measurer"),Fn===null)){Fn=document.createElement("div"),Fn.id="v-binder-view-measurer";const{style:e}=Fn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Fn)}return Fn.getBoundingClientRect()}function Ay(e,t){const n=Zc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function xo(e){const t=e.getBoundingClientRect(),n=Zc();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Vy(e){return e.nodeType===9?null:e.parentNode}function Jc(e){if(e===null)return null;const t=Vy(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return Jc(t)}const Qc=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=Jc(y),y!==null;)o.push(y);for(const b of o)kt("scroll",b,u,!0)},l=()=>{for(const y of o)et("scroll",y,u,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},u=()=>{Oc(p)},p=()=>{c.forEach(y=>y())},f=new Set,g=y=>{f.size===0&&kt("resize",window,_),f.has(y)||f.add(y)},m=y=>{f.has(y)&&f.delete(y),f.size===0&&et("resize",window,_)},_=()=>{f.forEach(y=>y())};return i.onBeforeUnmount(()=>{et("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return vo("binder",this.$slots)}}),ed=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Kc("follower",this.$slots),[[t]]):Kc("follower",this.$slots)}}),Oy="@css-render/vue3-ssr";function Iy(e,t){return`<style cssr-id="${e}">
104
104
  ${t}
105
- </style>`}function Ay(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(My(e,t)))}const Oy=typeof document<"u";function oi(){if(Oy)return;const e=i.inject(Fy,null);if(e!==null)return{adapter:(t,n)=>Ay(t,n,e),context:e}}function ed(e,t){console.error(`[vueuc/${e}]: ${t}`)}function Iy(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const td=/\s*,(?![^(]*\))\s*/g,Vy=/\s+/g;function zy(e,t){const n=[];return t.split(td).forEach(r=>{let s=Iy(r);if(s){if(s===1){e.forEach(a=>{n.push(r.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{e.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function Ly(e,t){const n=[];return t.split(td).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Dy(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=zy(t,n):t=Ly(t,n))}),t.join(", ").replace(Vy," ")}function nd(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function os(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Hy(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function as(e){return e?/^\s*@(s|m)/.test(e):!1}const Wy=/[A-Z]/g;function id(e){return e.replace(Wy,t=>"-"+t.toLowerCase())}function jy(e,t=" "){return typeof e=="object"&&e!==null?` {
106
- `+Object.entries(e).map(n=>t+` ${id(n[0])}: ${n[1]};`).join(`
105
+ </style>`}function zy(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(Iy(e,t)))}const Ly=typeof document<"u";function oi(){if(Ly)return;const e=i.inject(Oy,null);if(e!==null)return{adapter:(t,n)=>zy(t,n,e),context:e}}function td(e,t){console.error(`[vueuc/${e}]: ${t}`)}function Dy(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const nd=/\s*,(?![^(]*\))\s*/g,Hy=/\s+/g;function Wy(e,t){const n=[];return t.split(nd).forEach(r=>{let s=Dy(r);if(s){if(s===1){e.forEach(a=>{n.push(r.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{e.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function jy(e,t){const n=[];return t.split(nd).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Xy(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=Wy(t,n):t=jy(t,n))}),t.join(", ").replace(Hy," ")}function id(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function os(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function qy(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function as(e){return e?/^\s*@(s|m)/.test(e):!1}const Yy=/[A-Z]/g;function rd(e){return e.replace(Yy,t=>"-"+t.toLowerCase())}function Uy(e,t=" "){return typeof e=="object"&&e!==null?` {
106
+ `+Object.entries(e).map(n=>t+` ${rd(n[0])}: ${n[1]};`).join(`
107
107
  `)+`
108
- `+t+"}":`: ${e};`}function Xy(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function rd(e,t,n,r){if(!t)return"";const s=Xy(t,n,r);if(!s)return"";if(typeof s=="string")return`${e} {
108
+ `+t+"}":`: ${e};`}function Gy(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function sd(e,t,n,r){if(!t)return"";const s=Gy(t,n,r);if(!s)return"";if(typeof s=="string")return`${e} {
109
109
  ${s}
110
110
  }`;const o=Object.keys(s);if(o.length===0)return n.config.keepEmptyBlock?e+` {
111
111
  }`:"";const a=e?[e+" {"]:[];return o.forEach(l=>{const c=s[l];if(l==="raw"){a.push(`
112
112
  `+c+`
113
- `);return}l=id(l),c!=null&&a.push(` ${l}${jy(c)}`)}),e&&a.push("}"),a.join(`
114
- `)}function Co(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Co(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Co(s,t,n):s&&n(s)}else r&&n(r)})}function sd(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")as(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});as(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")as(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});as(d)?a=d:t.push(d)}const l=Dy(t),c=rd(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Co(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=rd(l,{raw:d},r,s);n.push(h)}else sd(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function qy(e,t,n){const r=[];return sd(e,[],r,t,n),r.join(`
113
+ `);return}l=rd(l),c!=null&&a.push(` ${l}${Uy(c)}`)}),e&&a.push("}"),a.join(`
114
+ `)}function Co(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Co(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Co(s,t,n):s&&n(s)}else r&&n(r)})}function od(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")as(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});as(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")as(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});as(d)?a=d:t.push(d)}const l=Xy(t),c=sd(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Co(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=sd(l,{raw:d},r,s);n.push(h)}else od(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function Ky(e,t,n){const r=[];return od(e,[],r,t,n),r.join(`
115
115
 
116
- `)}function So(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Yy(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(nd),t.els=[];else{const o=os(n,r);o&&s.includes(o)&&(nd(o),t.els=s.filter(a=>a!==o))}}function od(e,t){e.push(t)}function Uy(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=So(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=os(n,l);if(h!==null&&!o)return h;const u=h??Hy(n);if(d===void 0&&(d=t.render(r)),u.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(u,p),od(t.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),od(t.els,u),u}function Gy(e){return qy(this,this.instance,e)}function Ky(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return Uy(this.instance,this,t,r,s,o,a,l,n)}function Zy(e={}){const{id:t,parent:n}=e;Yy(this.instance,this,t,n)}const ls=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Gy,mount:Ky,unmount:Zy}},Jy=function(e,t,n,r){return Array.isArray(t)?ls(e,{$:null},null,t):Array.isArray(n)?ls(e,t,null,n):Array.isArray(r)?ls(e,t,n,r):ls(e,t,n,null)};function ad(e={}){const t={c:(...n)=>Jy(t,...n),use:(n,...r)=>n.install(t,...r),find:os,context:{},config:e};return t}function Qy(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return os(e)!==null}const{c:Mn}=ad(),Bo="vueuc-style";function ld(e){return e&-e}class cd{constructor(t,n){this.l=t,this.min=n;const r=new Array(t+1);for(let s=0;s<t+1;++s)r[s]=0;this.ft=r}add(t,n){if(n===0)return;const{l:r,ft:s}=this;for(t+=1;t<=r;)s[t]+=n,t+=ld(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:r,l:s}=this;if(t>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=t*r;for(;t>0;)o+=n[t],t-=ld(t);return o}getBound(t){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>t){r=s;continue}else if(o<t){if(n===s)return this.sum(n+1)<=t?n+1:s;n=s}else return s}return n}}function dd(e){return typeof e=="string"?document.querySelector(e):e()}const eb=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:By(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?vo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},vo("lazy-teleport",this.$slots)):null}}),cs={top:"bottom",bottom:"top",left:"right",right:"left"},hd={start:"end",center:"center",end:"start"},To={top:"height",bottom:"height",left:"width",right:"width"},tb={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},nb={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},ib={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ud={top:!0,bottom:!1,left:!0,right:!1},fd={top:"end",bottom:"start",left:"end",right:"start"};function rb(e,t,n,r,s,o){if(!s||o)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let c=l??"center",d={top:0,left:0};const h=(f,g,m)=>{let _=0,y=0;const b=n[f]-t[g]-t[f];return b>0&&r&&(m?y=ud[g]?b:-b:_=ud[g]?b:-b),{left:_,top:y}},u=a==="left"||a==="right";if(c!=="center"){const f=ib[e],g=cs[f],m=To[f];if(n[m]>t[m]){if(t[f]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[f]<_||t[g]<_?t[f]<t[g]?(c=hd[l],d=h(m,g,u)):d=h(m,f,u):c="center"}}else n[m]<t[m]&&t[g]<0&&t[f]>t[g]&&(c=hd[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=cs[f],m=To[f],_=(n[m]-t[m])/2;(t[f]<_||t[g]<_)&&(t[f]>t[g]?(c=fd[f],d=h(m,f,u)):(c=fd[g],d=h(m,g,u)))}let p=a;return t[a]<n[To[a]]&&t[a]<t[cs[a]]&&(p=cs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function sb(e,t){return t?nb[e]:tb[e]}function ob(e,t,n,r,s,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const ab=Mn([Mn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Mn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Mn("> *",{pointerEvents:"all"})])]),pd=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=i.inject("VBinder"),n=Lt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=oi();ab.mount({id:"vueuc/binder",head:!0,anchorMetaName:Bo,ssr:l}),i.onBeforeUnmount(()=>{a()}),Ey(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const f=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?Ry(g,m):xo(f);p.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:C,flip:B}=e;p.setAttribute("v-placement",x),_?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:v}=p;b==="target"?v.width=`${y.width}px`:b!==void 0?v.width=b:v.width="",S==="target"?v.minWidth=`${y.width}px`:S!==void 0?v.minWidth=S:v.minWidth="";const N=xo(p),F=xo(s.value),{left:P,top:q,placement:U}=rb(x,y,N,C,B,_),M=sb(U,_),{left:E,top:A,transform:K}=ob(U,F,y,q,P,_);p.setAttribute("v-placement",U),p.style.setProperty("--v-offset-left",`${Math.round(P)}px`),p.style.setProperty("--v-offset-top",`${Math.round(q)}px`),p.style.transform=`translateX(${E}) translateY(${A}) ${K}`,p.style.setProperty("--v-transform-origin",M),p.style.transformOrigin=M};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=ss(),u=Lt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(eb,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?i.withDirectives(n,[[Yc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var ai=[],lb=function(){return ai.some(function(e){return e.activeTargets.length>0})},cb=function(){return ai.some(function(e){return e.skippedTargets.length>0})},gd="ResizeObserver loop completed with undelivered notifications.",db=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:gd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=gd),window.dispatchEvent(e)},dr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(dr||(dr={}));var li=function(e){return Object.freeze(e)},hb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,li(this)}return e}(),md=function(){function e(t,n,r,s){return this.x=t,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,li(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Eo=function(e){return e instanceof SVGElement&&"getBBox"in e},_d=function(e){if(Eo(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var s=e,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||e.getClientRects().length)},yd=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},ub=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},hr=typeof window<"u"?window:{},ds=new WeakMap,bd=/auto|scroll/,fb=/^tb|vertical/,pb=/msie|trident/i.test(hr.navigator&&hr.navigator.userAgent),rn=function(e){return parseFloat(e||"0")},Vi=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new hb((n?t:e)||0,(n?e:t)||0)},wd=li({devicePixelContentBoxSize:Vi(),borderBoxSize:Vi(),contentBoxSize:Vi(),contentRect:new md(0,0,0,0)}),vd=function(e,t){if(t===void 0&&(t=!1),ds.has(e)&&!t)return ds.get(e);if(_d(e))return ds.set(e,wd),wd;var n=getComputedStyle(e),r=Eo(e)&&e.ownerSVGElement&&e.getBBox(),s=!pb&&n.boxSizing==="border-box",o=fb.test(n.writingMode||""),a=!r&&bd.test(n.overflowY||""),l=!r&&bd.test(n.overflowX||""),c=r?0:rn(n.paddingTop),d=r?0:rn(n.paddingRight),h=r?0:rn(n.paddingBottom),u=r?0:rn(n.paddingLeft),p=r?0:rn(n.borderTopWidth),f=r?0:rn(n.borderRightWidth),g=r?0:rn(n.borderBottomWidth),m=r?0:rn(n.borderLeftWidth),_=u+d,y=c+h,b=m+f,S=p+g,x=l?e.offsetHeight-S-e.clientHeight:0,C=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,v=s?y+S:0,N=r?r.width:rn(n.width)-B-C,F=r?r.height:rn(n.height)-v-x,P=N+_+C+b,q=F+y+x+S,U=li({devicePixelContentBoxSize:Vi(Math.round(N*devicePixelRatio),Math.round(F*devicePixelRatio),o),borderBoxSize:Vi(P,q,o),contentBoxSize:Vi(N,F,o),contentRect:new md(u,c,N,F)});return ds.set(e,U),U},kd=function(e,t,n){var r=vd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case dr.DEVICE_PIXEL_CONTENT_BOX:return a;case dr.BORDER_BOX:return s;default:return o}},gb=function(){function e(t){var n=vd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=li([n.borderBoxSize]),this.contentBoxSize=li([n.contentBoxSize]),this.devicePixelContentBoxSize=li([n.devicePixelContentBoxSize])}return e}(),xd=function(e){if(_d(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},mb=function(){var e=1/0,t=[];ai.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new gb(d.target),u=xd(d.target);l.push(h),d.lastReportedSize=kd(d.target,d.observedBox),u<e&&(e=u)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var s=r[n];s()}return e},Cd=function(e){ai.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(xd(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},_b=function(){var e=0;for(Cd(e);lb();)e=mb(),Cd(e);return cb()&&db(),e>0},$o,Sd=[],yb=function(){return Sd.splice(0).forEach(function(e){return e()})},bb=function(e){if(!$o){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return yb()}).observe(n,r),$o=function(){n.textContent="".concat(t?t--:t++)}}Sd.push(e),$o()},wb=function(e){bb(function(){requestAnimationFrame(e)})},hs=0,vb=function(){return!!hs},kb=250,xb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Td=function(e){return e===void 0&&(e=0),Date.now()+e},No=!1,Cb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=kb),!No){No=!0;var r=Td(t);wb(function(){var s=!1;try{s=_b()}finally{if(No=!1,t=r-Td(),!vb())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,xb)};document.body?n():hr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bd.forEach(function(n){return hr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Bd.forEach(function(n){return hr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new Cb,Ed=function(e){!hs&&e>0&&Ro.start(),hs+=e,!hs&&Ro.stop()},Sb=function(e){return!Eo(e)&&!ub(e)&&getComputedStyle(e).display==="inline"},Bb=function(){function e(t,n){this.target=t,this.observedBox=n||dr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=kd(this.target,this.observedBox,!0);return Sb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Tb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),us=new WeakMap,$d=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},fs=function(){function e(){}return e.connect=function(t,n){var r=new Tb(t,n);us.set(t,r)},e.observe=function(t,n,r){var s=us.get(t),o=s.observationTargets.length===0;$d(s.observationTargets,n)<0&&(o&&ai.push(s),s.observationTargets.push(new Bb(n,r&&r.box)),Ed(1),Ro.schedule())},e.unobserve=function(t,n){var r=us.get(t),s=$d(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&ai.splice(ai.indexOf(r),1),r.observationTargets.splice(s,1),Ed(-1))},e.disconnect=function(t){var n=this,r=us.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Eb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");fs.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!yd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!yd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.unobserve(this,t)},e.prototype.disconnect=function(){fs.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class $b{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Eb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const ur=new $b,ps=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=e;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){ed("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ed("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(ur.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&ur.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let gs;function Nb(){return typeof document>"u"?!1:(gs===void 0&&("matchMedia"in window?gs=window.matchMedia("(pointer:coarse)").matches:gs=!1),gs)}let Po;function Nd(){return typeof document>"u"?1:(Po===void 0&&(Po="chrome"in window?window.devicePixelRatio:1),Po)}const Rd="VVirtualListXScroll";function Rb({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=e.value;if(d.length===0)return null;const h=new cd(d.length,0);return d.forEach((u,p)=>{h.add(p,u.width)}),h}),a=Lt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=Lt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Rd,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Pd=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Rd);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=e;c<=t;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),Pb=Mn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Mn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Mn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Fb=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=oi();Pb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Bo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:M,defaultScrollKey:E}=e;M!=null?_({index:M}):E!=null&&_({key:E})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Lt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let M=0;return e.columns.forEach(E=>{M+=E.width}),M}),o=i.computed(()=>{const M=new Map,{keyField:E}=e;return e.items.forEach((A,K)=>{M.set(A[E],K)}),M}),{scrollLeftRef:a,listWidthRef:l}=Rb({columnsRef:i.toRef(e,"columns"),renderColRef:i.toRef(e,"renderCol"),renderItemWithColsRef:i.toRef(e,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:M,itemSize:E,keyField:A}=e,K=new cd(M.length,E);return M.forEach((R,$)=>{const j=R[A],z=h.get(j);z!==void 0&&K.add($,z)}),K}),p=i.ref(0),f=i.ref(0),g=Lt(()=>Math.max(u.value.getBound(f.value-ar(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:M}=d;if(M===void 0)return[];const{items:E,itemSize:A}=e,K=g.value,R=Math.min(K+Math.ceil(M/A+1),E.length-1),$=[];for(let j=K;j<=R;++j)$.push(E[j]);return $}),_=(M,E)=>{if(typeof M=="number"){x(M,E,"auto");return}const{left:A,top:K,index:R,key:$,position:j,behavior:z,debounce:Y=!0}=M;if(A!==void 0||K!==void 0)x(A,K,z);else if(R!==void 0)S(R,z,Y);else if($!==void 0){const I=o.value.get($);I!==void 0&&S(I,z,Y)}else j==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):j==="top"&&x(0,0,z)};let y,b=null;function S(M,E,A){const{value:K}=u,R=K.sum(M)+ar(e.paddingTop);if(!A)c.value.scrollTo({left:0,top:R,behavior:E});else{y=M,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:$,offsetHeight:j}=c.value;if(R>$){const z=K.get(M);R+z<=$+j||c.value.scrollTo({left:0,top:R+z-j,behavior:E})}else c.value.scrollTo({left:0,top:R,behavior:E})}}function x(M,E,A){c.value.scrollTo({left:M,top:E,behavior:A})}function C(M,E){var A,K,R;if(n||e.ignoreItemResize||U(E.target))return;const{value:$}=u,j=o.value.get(M),z=$.get(j),Y=(R=(K=(A=E.borderBoxSize)===null||A===void 0?void 0:A[0])===null||K===void 0?void 0:K.blockSize)!==null&&R!==void 0?R:E.contentRect.height;if(Y===z)return;Y-e.itemSize===0?h.delete(M):h.set(M,Y-e.itemSize);const V=Y-z;if(V===0)return;$.add(j,V);const J=c.value;if(J!=null){if(y===void 0){const pe=$.sum(j);J.scrollTop>pe&&J.scrollBy(0,V)}else if(j<y)J.scrollBy(0,V);else if(j===y){const pe=$.sum(j);Y+pe>J.scrollTop+J.offsetHeight&&J.scrollBy(0,V)}q()}p.value++}const B=!Nb();let v=!1;function N(M){var E;(E=e.onScroll)===null||E===void 0||E.call(e,M),(!B||!v)&&q()}function F(M){var E;if((E=e.onWheel)===null||E===void 0||E.call(e,M),B){const A=c.value;if(A!=null){if(M.deltaX===0&&(A.scrollTop===0&&M.deltaY<=0||A.scrollTop+A.offsetHeight>=A.scrollHeight&&M.deltaY>=0))return;M.preventDefault(),A.scrollTop+=M.deltaY/Nd(),A.scrollLeft+=M.deltaX/Nd(),q(),v=!0,Oc(()=>{v=!1})}}}function P(M){if(n||U(M.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(M.contentRect.height===d.value)return}else if(M.contentRect.height===d.value&&M.contentRect.width===l.value)return;d.value=M.contentRect.height,l.value=M.contentRect.width;const{onResize:E}=e;E!==void 0&&E(M)}function q(){const{value:M}=c;M!=null&&(f.value=M.scrollTop,a.value=M.scrollLeft)}function U(M){let E=M;for(;E!==null;){if(E.style.display==="none")return!0;E=E.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:M}=e,E=lr(u.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:lr(s.value),height:M?"":E,minHeight:M?E:"",paddingTop:lr(e.paddingTop),paddingBottom:lr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${lr(u.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:P,handleListScroll:N,handleListWheel:F,handleItemResize:C}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ps,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[t],h=n.get(d),u=a!=null?i.h(Pd,{index:h,item:c}):void 0,p=l!=null?i.h(Pd,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:p,index:h})[0];return e?i.h(ps,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),pn="v-hidden",Mb=Mn("[v-hidden]",{display:"none!important"}),Fd=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(pn)&&h.removeAttribute(pn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(pn)&&S.removeAttribute(pn);const p=l.offsetWidth,f=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,_=!1;const y=l.children.length-(t.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const x=u[S];if(_){x.hasAttribute(pn)||x.setAttribute(pn,"");continue}else x.hasAttribute(pn)&&x.removeAttribute(pn);const C=x.offsetWidth;if(m+=C,f[S]=C,m>p){const{updateCounter:B}=e;for(let v=S;v>=0;--v){const N=y-1-v;B!==void 0?B(N):h.textContent=`${N}`;const F=h.offsetWidth;if(m-=f[v],m+F<=p||v===0){_=!0,S=v-1,g&&(S===-1?(g.style.maxWidth=`${p-F}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:P}=e;P&&P(N);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(pn,""))}const o=oi();return Mb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Bo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Md(e){return e instanceof HTMLElement}function Ad(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Md(n)&&(Id(n)||Ad(n)))return!0}return!1}function Od(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Md(n)&&(Id(n)||Od(n)))return!0}return!1}function Id(e){if(!Ab(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Ab(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let fr=[];const Ob=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=j_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return fr[fr.length-1]===t}function c(_){var y;_.code==="Escape"&&l()&&((y=e.onEsc)===null||y===void 0||y.call(e,_))}i.onMounted(()=>{i.watch(()=>e.active,_=>{_?(u(),kt("keydown",document,c)):(et("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&p()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(or(_)))return;f("first")}}function h(){const _=n.value;if(_===null)return null;let y=_;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function u(){var _;if(!e.disabled){if(fr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?f("first"):(_=dd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),fr=fr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=dd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(_){if(l()&&e.active){const y=n.value,b=r.value;if(y!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const x=_==="first"?Ad(S):Od(S);o=!1,x||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(_){if(o)return;const y=h();y!==null&&(_.relatedTarget!==null&&y.contains(_.relatedTarget)?f("last"):f("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:m}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function Mk(e){return e}const Fo="n-internal-select-menu",Vd="n-internal-select-menu-body",zd="n-drawer-body",Ld="n-modal-body",Dd="n-popover-body",Hd="__disabled__";function gn(e){const t=i.inject(Ld,null),n=i.inject(zd,null),r=i.inject(Dd,null),s=i.inject(Vd,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{kt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return Lt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?Hd:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}gn.tdkey=Hd,gn.propTo={type:[String,Object,Boolean],default:void 0};function Ib(e){const t={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),i.onDeactivated(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function Wd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&ur.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&ur.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&ur.unregisterHandler(n)}))}function jd(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Vb=/^(\d|\.)+$/,Xd=/(\d|\.)+/;function Mo(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const s=(e+n)*t;return s===0?"0":`${s}px`}else if(typeof e=="string")if(Vb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Xd.exec(e);return s?e.replace(Xd,String((Number(s[0])+n)*t)):e}return e}function qd(e){const{left:t,right:n,top:r,bottom:s}=jt(e);return`${r} ${t} ${s} ${n}`}var Yd={};function zb(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,_;return{before(y){m=y.bem.b,_=y.bem.els,y.bem.els=null},after(y){y.bem.b=m,y.bem.els=_},$({context:y,props:b}){return g=typeof g=="string"?g:g({context:y,props:b}),y.bem.b=g,`${(b==null?void 0:b.bPrefix)||t}${y.bem.b}`}}}function l(g){let m;return{before(_){m=_.bem.els},after(_){_.bem.els=m},$({context:_,props:y}){return g=typeof g=="string"?g:g({context:_,props:y}),_.bem.els=g.split(",").map(b=>b.trim()),_.bem.els.map(b=>`${(y==null?void 0:y.bPrefix)||t}${_.bem.b}${n}${b}`).join(", ")}}}function c(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=g.split(",").map(x=>x.trim());function b(x){return y.map(C=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${C}`).join(", ")}const S=m.bem.els;if(S!==null){if(Yd.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=m.bem.els;if(Yd.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:(...g)=>s(a(g[0]),g[1],g[2]),cE:(...g)=>s(l(g[0]),g[1],g[2]),cM:(...g)=>s(c(g[0]),g[1],g[2]),cNotM:(...g)=>s(d(g[0]),g[1],g[2])}),o}const Lb=".n-",Db="__",Hb="--",Ud=ad(),Gd=zb({blockPrefix:Lb,elementPrefix:Db,modifierPrefix:Hb});Ud.use(Gd);const{c:oe,find:Ok}=Ud,{cB:ue,cE:_e,cM:Be,cNotM:Xt}=Gd,Wb=(...e)=>oe(">",[ue(...e)]);function Xe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Ao;function jb(){return Ao===void 0&&(Ao=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ao}const Xb=new WeakSet;function qb(e){Xb.add(e)}function Kd(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const Zd=new Set;function An(e,t){const n=`[naive/${e}]: ${t}`;Zd.has(n)||(Zd.add(n),console.error(n))}function Jd(e,t){console.error(`[naive/${e}]: ${t}`)}function Qd(e,t){throw new Error(`[naive/${e}]: ${t}`)}function ft(e,...t){if(Array.isArray(e))e.forEach(n=>ft(n,...t));else return e(...t)}function Oo(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Oo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Oo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function Yb(e,t="default",n=void 0){const r=e[t];if(!r)return Jd("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(Jd("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Ub(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function Io(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function zi(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ms(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ms(t.children)):!0)?e:null}function Vo(e,t){return e&&ms(e())||t()}function ci(e,t){const n=e&&ms(e());return t(n||null)}function eh(e){return!(e&&ms(e()))}const zo=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),di="n-config-provider",Gb="n";function hi(e={},t={defaultBordered:!0}){const n=i.inject(di,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Gb),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function ui(e,t,n,r){n||Qd("useThemeClass","cssVarsRef is not passed");const s=i.inject(di,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=oi();let d;const h=`__${e}`,u=()=>{let p=h;const f=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),f&&(p+=`-${f}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(p+=`-${So(JSON.stringify(m))}`),_&&(p+=`-${So(JSON.stringify(_))}`),l.value=p,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;oe(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const th="n-form-item";function Kb(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(th,null);i.provide(th,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=e;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return t}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=e;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=e;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const Zb={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};function Lo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function pr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function gr(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Qb(l,u=>u.test(a)):Jb(l,u=>u.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function Jb(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Qb(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function e1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const t1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},n1=(e,t,n)=>{let r;const s=t1[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},i1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r1=(e,t,n,r)=>i1[e],s1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},o1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},a1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},l1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},c1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},d1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},h1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:pr({values:s1,defaultWidth:"wide"}),quarter:pr({values:o1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:pr({values:a1,defaultWidth:"wide"}),day:pr({values:l1,defaultWidth:"wide"}),dayPeriod:pr({values:c1,defaultWidth:"wide",formattingValues:d1,defaultFormattingWidth:"wide"})},u1=/^(\d+)(th|st|nd|rd)?/i,f1=/\d+/i,p1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},g1={any:[/^b/i,/^(a|c)/i]},m1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_1={any:[/1/i,/2/i,/3/i,/4/i]},y1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},b1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},w1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},v1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},k1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},x1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},C1={ordinalNumber:e1({matchPattern:u1,parsePattern:f1,valueCallback:e=>parseInt(e,10)}),era:gr({matchPatterns:p1,defaultMatchWidth:"wide",parsePatterns:g1,defaultParseWidth:"any"}),quarter:gr({matchPatterns:m1,defaultMatchWidth:"wide",parsePatterns:_1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gr({matchPatterns:y1,defaultMatchWidth:"wide",parsePatterns:b1,defaultParseWidth:"any"}),day:gr({matchPatterns:w1,defaultMatchWidth:"wide",parsePatterns:v1,defaultParseWidth:"any"}),dayPeriod:gr({matchPatterns:k1,defaultMatchWidth:"any",parsePatterns:x1,defaultParseWidth:"any"})},S1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E1={date:Lo({formats:S1,defaultWidth:"full"}),time:Lo({formats:B1,defaultWidth:"full"}),dateTime:Lo({formats:T1,defaultWidth:"full"})},$1={name:"en-US",locale:{code:"en-US",formatDistance:n1,formatLong:E1,formatRelative:r1,localize:h1,match:C1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function nh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(di,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:Zb[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:$1}),localeRef:r}}const mr="naive-ui-style";function _s(e,t,n){if(!t)return;const r=oi(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(di,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(Qy(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:mr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const _r={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:N1,fontFamily:R1,lineHeight:P1}=_r,ih=oe("body",`
116
+ `)}function So(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Zy(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(id),t.els=[];else{const o=os(n,r);o&&s.includes(o)&&(id(o),t.els=s.filter(a=>a!==o))}}function ad(e,t){e.push(t)}function Jy(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=So(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=os(n,l);if(h!==null&&!o)return h;const u=h??qy(n);if(d===void 0&&(d=t.render(r)),u.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(u,p),ad(t.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),ad(t.els,u),u}function Qy(e){return Ky(this,this.instance,e)}function eb(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return Jy(this.instance,this,t,r,s,o,a,l,n)}function tb(e={}){const{id:t,parent:n}=e;Zy(this.instance,this,t,n)}const ls=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Qy,mount:eb,unmount:tb}},nb=function(e,t,n,r){return Array.isArray(t)?ls(e,{$:null},null,t):Array.isArray(n)?ls(e,t,null,n):Array.isArray(r)?ls(e,t,n,r):ls(e,t,n,null)};function ld(e={}){const t={c:(...n)=>nb(t,...n),use:(n,...r)=>n.install(t,...r),find:os,context:{},config:e};return t}function ib(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return os(e)!==null}const{c:Mn}=ld(),Bo="vueuc-style";function cd(e){return e&-e}class dd{constructor(t,n){this.l=t,this.min=n;const r=new Array(t+1);for(let s=0;s<t+1;++s)r[s]=0;this.ft=r}add(t,n){if(n===0)return;const{l:r,ft:s}=this;for(t+=1;t<=r;)s[t]+=n,t+=cd(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:r,l:s}=this;if(t>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=t*r;for(;t>0;)o+=n[t],t-=cd(t);return o}getBound(t){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>t){r=s;continue}else if(o<t){if(n===s)return this.sum(n+1)<=t?n+1:s;n=s}else return s}return n}}function hd(e){return typeof e=="string"?document.querySelector(e):e()}const rb=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Ny(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?vo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},vo("lazy-teleport",this.$slots)):null}}),cs={top:"bottom",bottom:"top",left:"right",right:"left"},ud={start:"end",center:"center",end:"start"},To={top:"height",bottom:"height",left:"width",right:"width"},sb={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},ob={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},ab={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},fd={top:!0,bottom:!1,left:!0,right:!1},pd={top:"end",bottom:"start",left:"end",right:"start"};function lb(e,t,n,r,s,o){if(!s||o)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let c=l??"center",d={top:0,left:0};const h=(f,g,m)=>{let _=0,y=0;const b=n[f]-t[g]-t[f];return b>0&&r&&(m?y=fd[g]?b:-b:_=fd[g]?b:-b),{left:_,top:y}},u=a==="left"||a==="right";if(c!=="center"){const f=ab[e],g=cs[f],m=To[f];if(n[m]>t[m]){if(t[f]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[f]<_||t[g]<_?t[f]<t[g]?(c=ud[l],d=h(m,g,u)):d=h(m,f,u):c="center"}}else n[m]<t[m]&&t[g]<0&&t[f]>t[g]&&(c=ud[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=cs[f],m=To[f],_=(n[m]-t[m])/2;(t[f]<_||t[g]<_)&&(t[f]>t[g]?(c=pd[f],d=h(m,f,u)):(c=pd[g],d=h(m,g,u)))}let p=a;return t[a]<n[To[a]]&&t[a]<t[cs[a]]&&(p=cs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function cb(e,t){return t?ob[e]:sb[e]}function db(e,t,n,r,s,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const hb=Mn([Mn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Mn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Mn("> *",{pointerEvents:"all"})])]),gd=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=i.inject("VBinder"),n=Lt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=oi();hb.mount({id:"vueuc/binder",head:!0,anchorMetaName:Bo,ssr:l}),i.onBeforeUnmount(()=>{a()}),Py(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const f=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?Ay(g,m):xo(f);p.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:v,flip:B}=e;p.setAttribute("v-placement",x),_?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:k}=p;b==="target"?k.width=`${y.width}px`:b!==void 0?k.width=b:k.width="",S==="target"?k.minWidth=`${y.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const $=xo(p),P=xo(s.value),{left:R,top:j,placement:Y}=lb(x,y,$,v,B,_),A=cb(Y,_),{left:E,top:M,transform:K}=db(Y,P,y,j,R,_);p.setAttribute("v-placement",Y),p.style.setProperty("--v-offset-left",`${Math.round(R)}px`),p.style.setProperty("--v-offset-top",`${Math.round(j)}px`),p.style.transform=`translateX(${E}) translateY(${M}) ${K}`,p.style.setProperty("--v-transform-origin",A),p.style.transformOrigin=A};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=ss(),u=Lt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(rb,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?i.withDirectives(n,[[Uc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var ai=[],ub=function(){return ai.some(function(e){return e.activeTargets.length>0})},fb=function(){return ai.some(function(e){return e.skippedTargets.length>0})},md="ResizeObserver loop completed with undelivered notifications.",pb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:md}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=md),window.dispatchEvent(e)},dr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(dr||(dr={}));var li=function(e){return Object.freeze(e)},gb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,li(this)}return e}(),_d=function(){function e(t,n,r,s){return this.x=t,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,li(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Eo=function(e){return e instanceof SVGElement&&"getBBox"in e},yd=function(e){if(Eo(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var s=e,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||e.getClientRects().length)},bd=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},mb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},hr=typeof window<"u"?window:{},ds=new WeakMap,wd=/auto|scroll/,_b=/^tb|vertical/,yb=/msie|trident/i.test(hr.navigator&&hr.navigator.userAgent),rn=function(e){return parseFloat(e||"0")},Ii=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new gb((n?t:e)||0,(n?e:t)||0)},vd=li({devicePixelContentBoxSize:Ii(),borderBoxSize:Ii(),contentBoxSize:Ii(),contentRect:new _d(0,0,0,0)}),kd=function(e,t){if(t===void 0&&(t=!1),ds.has(e)&&!t)return ds.get(e);if(yd(e))return ds.set(e,vd),vd;var n=getComputedStyle(e),r=Eo(e)&&e.ownerSVGElement&&e.getBBox(),s=!yb&&n.boxSizing==="border-box",o=_b.test(n.writingMode||""),a=!r&&wd.test(n.overflowY||""),l=!r&&wd.test(n.overflowX||""),c=r?0:rn(n.paddingTop),d=r?0:rn(n.paddingRight),h=r?0:rn(n.paddingBottom),u=r?0:rn(n.paddingLeft),p=r?0:rn(n.borderTopWidth),f=r?0:rn(n.borderRightWidth),g=r?0:rn(n.borderBottomWidth),m=r?0:rn(n.borderLeftWidth),_=u+d,y=c+h,b=m+f,S=p+g,x=l?e.offsetHeight-S-e.clientHeight:0,v=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,k=s?y+S:0,$=r?r.width:rn(n.width)-B-v,P=r?r.height:rn(n.height)-k-x,R=$+_+v+b,j=P+y+x+S,Y=li({devicePixelContentBoxSize:Ii(Math.round($*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Ii(R,j,o),contentBoxSize:Ii($,P,o),contentRect:new _d(u,c,$,P)});return ds.set(e,Y),Y},xd=function(e,t,n){var r=kd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case dr.DEVICE_PIXEL_CONTENT_BOX:return a;case dr.BORDER_BOX:return s;default:return o}},bb=function(){function e(t){var n=kd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=li([n.borderBoxSize]),this.contentBoxSize=li([n.contentBoxSize]),this.devicePixelContentBoxSize=li([n.devicePixelContentBoxSize])}return e}(),Cd=function(e){if(yd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},wb=function(){var e=1/0,t=[];ai.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new bb(d.target),u=Cd(d.target);l.push(h),d.lastReportedSize=xd(d.target,d.observedBox),u<e&&(e=u)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var s=r[n];s()}return e},Sd=function(e){ai.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Cd(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},vb=function(){var e=0;for(Sd(e);ub();)e=wb(),Sd(e);return fb()&&pb(),e>0},$o,Bd=[],kb=function(){return Bd.splice(0).forEach(function(e){return e()})},xb=function(e){if(!$o){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return kb()}).observe(n,r),$o=function(){n.textContent="".concat(t?t--:t++)}}Bd.push(e),$o()},Cb=function(e){xb(function(){requestAnimationFrame(e)})},hs=0,Sb=function(){return!!hs},Bb=250,Tb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Td=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ed=function(e){return e===void 0&&(e=0),Date.now()+e},No=!1,Eb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Bb),!No){No=!0;var r=Ed(t);Cb(function(){var s=!1;try{s=vb()}finally{if(No=!1,t=r-Ed(),!Sb())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Tb)};document.body?n():hr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Td.forEach(function(n){return hr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Td.forEach(function(n){return hr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new Eb,$d=function(e){!hs&&e>0&&Ro.start(),hs+=e,!hs&&Ro.stop()},$b=function(e){return!Eo(e)&&!mb(e)&&getComputedStyle(e).display==="inline"},Nb=function(){function e(t,n){this.target=t,this.observedBox=n||dr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=xd(this.target,this.observedBox,!0);return $b(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Rb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),us=new WeakMap,Nd=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},fs=function(){function e(){}return e.connect=function(t,n){var r=new Rb(t,n);us.set(t,r)},e.observe=function(t,n,r){var s=us.get(t),o=s.observationTargets.length===0;Nd(s.observationTargets,n)<0&&(o&&ai.push(s),s.observationTargets.push(new Nb(n,r&&r.box)),$d(1),Ro.schedule())},e.unobserve=function(t,n){var r=us.get(t),s=Nd(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&ai.splice(ai.indexOf(r),1),r.observationTargets.splice(s,1),$d(-1))},e.disconnect=function(t){var n=this,r=us.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Pb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");fs.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!bd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!bd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.unobserve(this,t)},e.prototype.disconnect=function(){fs.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Fb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Pb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const ur=new Fb,ps=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=e;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){td("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){td("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(ur.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&ur.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let gs;function Mb(){return typeof document>"u"?!1:(gs===void 0&&("matchMedia"in window?gs=window.matchMedia("(pointer:coarse)").matches:gs=!1),gs)}let Po;function Rd(){return typeof document>"u"?1:(Po===void 0&&(Po="chrome"in window?window.devicePixelRatio:1),Po)}const Pd="VVirtualListXScroll";function Ab({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=e.value;if(d.length===0)return null;const h=new dd(d.length,0);return d.forEach((u,p)=>{h.add(p,u.width)}),h}),a=Lt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=Lt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Pd,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Fd=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Pd);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=e;c<=t;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),Vb=Mn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Mn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Mn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Ob=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=oi();Vb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Bo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:A,defaultScrollKey:E}=e;A!=null?_({index:A}):E!=null&&_({key:E})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Lt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let A=0;return e.columns.forEach(E=>{A+=E.width}),A}),o=i.computed(()=>{const A=new Map,{keyField:E}=e;return e.items.forEach((M,K)=>{A.set(M[E],K)}),A}),{scrollLeftRef:a,listWidthRef:l}=Ab({columnsRef:i.toRef(e,"columns"),renderColRef:i.toRef(e,"renderCol"),renderItemWithColsRef:i.toRef(e,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:A,itemSize:E,keyField:M}=e,K=new dd(A.length,E);return A.forEach((F,N)=>{const X=F[M],z=h.get(X);z!==void 0&&K.add(N,z)}),K}),p=i.ref(0),f=i.ref(0),g=Lt(()=>Math.max(u.value.getBound(f.value-ar(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:A}=d;if(A===void 0)return[];const{items:E,itemSize:M}=e,K=g.value,F=Math.min(K+Math.ceil(A/M+1),E.length-1),N=[];for(let X=K;X<=F;++X)N.push(E[X]);return N}),_=(A,E)=>{if(typeof A=="number"){x(A,E,"auto");return}const{left:M,top:K,index:F,key:N,position:X,behavior:z,debounce:U=!0}=A;if(M!==void 0||K!==void 0)x(M,K,z);else if(F!==void 0)S(F,z,U);else if(N!==void 0){const O=o.value.get(N);O!==void 0&&S(O,z,U)}else X==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):X==="top"&&x(0,0,z)};let y,b=null;function S(A,E,M){const{value:K}=u,F=K.sum(A)+ar(e.paddingTop);if(!M)c.value.scrollTo({left:0,top:F,behavior:E});else{y=A,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:N,offsetHeight:X}=c.value;if(F>N){const z=K.get(A);F+z<=N+X||c.value.scrollTo({left:0,top:F+z-X,behavior:E})}else c.value.scrollTo({left:0,top:F,behavior:E})}}function x(A,E,M){c.value.scrollTo({left:A,top:E,behavior:M})}function v(A,E){var M,K,F;if(n||e.ignoreItemResize||Y(E.target))return;const{value:N}=u,X=o.value.get(A),z=N.get(X),U=(F=(K=(M=E.borderBoxSize)===null||M===void 0?void 0:M[0])===null||K===void 0?void 0:K.blockSize)!==null&&F!==void 0?F:E.contentRect.height;if(U===z)return;U-e.itemSize===0?h.delete(A):h.set(A,U-e.itemSize);const I=U-z;if(I===0)return;N.add(X,I);const J=c.value;if(J!=null){if(y===void 0){const pe=N.sum(X);J.scrollTop>pe&&J.scrollBy(0,I)}else if(X<y)J.scrollBy(0,I);else if(X===y){const pe=N.sum(X);U+pe>J.scrollTop+J.offsetHeight&&J.scrollBy(0,I)}j()}p.value++}const B=!Mb();let k=!1;function $(A){var E;(E=e.onScroll)===null||E===void 0||E.call(e,A),(!B||!k)&&j()}function P(A){var E;if((E=e.onWheel)===null||E===void 0||E.call(e,A),B){const M=c.value;if(M!=null){if(A.deltaX===0&&(M.scrollTop===0&&A.deltaY<=0||M.scrollTop+M.offsetHeight>=M.scrollHeight&&A.deltaY>=0))return;A.preventDefault(),M.scrollTop+=A.deltaY/Rd(),M.scrollLeft+=A.deltaX/Rd(),j(),k=!0,Oc(()=>{k=!1})}}}function R(A){if(n||Y(A.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(A.contentRect.height===d.value)return}else if(A.contentRect.height===d.value&&A.contentRect.width===l.value)return;d.value=A.contentRect.height,l.value=A.contentRect.width;const{onResize:E}=e;E!==void 0&&E(A)}function j(){const{value:A}=c;A!=null&&(f.value=A.scrollTop,a.value=A.scrollLeft)}function Y(A){let E=A;for(;E!==null;){if(E.style.display==="none")return!0;E=E.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:A}=e,E=lr(u.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:lr(s.value),height:A?"":E,minHeight:A?E:"",paddingTop:lr(e.paddingTop),paddingBottom:lr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${lr(u.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:R,handleListScroll:$,handleListWheel:P,handleItemResize:v}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ps,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[t],h=n.get(d),u=a!=null?i.h(Fd,{index:h,item:c}):void 0,p=l!=null?i.h(Fd,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:p,index:h})[0];return e?i.h(ps,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),pn="v-hidden",Ib=Mn("[v-hidden]",{display:"none!important"}),Md=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(pn)&&h.removeAttribute(pn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(pn)&&S.removeAttribute(pn);const p=l.offsetWidth,f=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,_=!1;const y=l.children.length-(t.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const x=u[S];if(_){x.hasAttribute(pn)||x.setAttribute(pn,"");continue}else x.hasAttribute(pn)&&x.removeAttribute(pn);const v=x.offsetWidth;if(m+=v,f[S]=v,m>p){const{updateCounter:B}=e;for(let k=S;k>=0;--k){const $=y-1-k;B!==void 0?B($):h.textContent=`${$}`;const P=h.offsetWidth;if(m-=f[k],m+P<=p||k===0){_=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${p-P}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:R}=e;R&&R($);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(pn,""))}const o=oi();return Ib.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Bo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Ad(e){return e instanceof HTMLElement}function Vd(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Ad(n)&&(Id(n)||Vd(n)))return!0}return!1}function Od(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Ad(n)&&(Id(n)||Od(n)))return!0}return!1}function Id(e){if(!zb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function zb(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let fr=[];const Lb=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=U_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return fr[fr.length-1]===t}function c(_){var y;_.code==="Escape"&&l()&&((y=e.onEsc)===null||y===void 0||y.call(e,_))}i.onMounted(()=>{i.watch(()=>e.active,_=>{_?(u(),kt("keydown",document,c)):(et("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&p()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(or(_)))return;f("first")}}function h(){const _=n.value;if(_===null)return null;let y=_;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function u(){var _;if(!e.disabled){if(fr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?f("first"):(_=hd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),fr=fr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=hd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(_){if(l()&&e.active){const y=n.value,b=r.value;if(y!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const x=_==="first"?Vd(S):Od(S);o=!1,x||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(_){if(o)return;const y=h();y!==null&&(_.relatedTarget!==null&&y.contains(_.relatedTarget)?f("last"):f("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:m}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function Vk(e){return e}const Fo="n-internal-select-menu",zd="n-internal-select-menu-body",Ld="n-drawer-body",Dd="n-modal-body",Hd="n-popover-body",Wd="__disabled__";function gn(e){const t=i.inject(Dd,null),n=i.inject(Ld,null),r=i.inject(Hd,null),s=i.inject(zd,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{kt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return Lt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?Wd:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}gn.tdkey=Wd,gn.propTo={type:[String,Object,Boolean],default:void 0};function Db(e){const t={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),i.onDeactivated(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function jd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&ur.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&ur.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&ur.unregisterHandler(n)}))}function Xd(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Hb=/^(\d|\.)+$/,qd=/(\d|\.)+/;function Mo(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const s=(e+n)*t;return s===0?"0":`${s}px`}else if(typeof e=="string")if(Hb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=qd.exec(e);return s?e.replace(qd,String((Number(s[0])+n)*t)):e}return e}function Yd(e){const{left:t,right:n,top:r,bottom:s}=jt(e);return`${r} ${t} ${s} ${n}`}var Ud={};function Wb(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,_;return{before(y){m=y.bem.b,_=y.bem.els,y.bem.els=null},after(y){y.bem.b=m,y.bem.els=_},$({context:y,props:b}){return g=typeof g=="string"?g:g({context:y,props:b}),y.bem.b=g,`${(b==null?void 0:b.bPrefix)||t}${y.bem.b}`}}}function l(g){let m;return{before(_){m=_.bem.els},after(_){_.bem.els=m},$({context:_,props:y}){return g=typeof g=="string"?g:g({context:_,props:y}),_.bem.els=g.split(",").map(b=>b.trim()),_.bem.els.map(b=>`${(y==null?void 0:y.bPrefix)||t}${_.bem.b}${n}${b}`).join(", ")}}}function c(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=g.split(",").map(x=>x.trim());function b(x){return y.map(v=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${v}`).join(", ")}const S=m.bem.els;if(S!==null){if(Ud.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=m.bem.els;if(Ud.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:(...g)=>s(a(g[0]),g[1],g[2]),cE:(...g)=>s(l(g[0]),g[1],g[2]),cM:(...g)=>s(c(g[0]),g[1],g[2]),cNotM:(...g)=>s(d(g[0]),g[1],g[2])}),o}const jb=".n-",Xb="__",qb="--",Gd=ld(),Kd=Wb({blockPrefix:jb,elementPrefix:Xb,modifierPrefix:qb});Gd.use(Kd);const{c:oe,find:Ik}=Gd,{cB:ue,cE:_e,cM:Be,cNotM:Xt}=Kd,Yb=(...e)=>oe(">",[ue(...e)]);function Xe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Ao;function Ub(){return Ao===void 0&&(Ao=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ao}const Gb=new WeakSet;function Kb(e){Gb.add(e)}function Zd(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const Jd=new Set;function An(e,t){const n=`[naive/${e}]: ${t}`;Jd.has(n)||(Jd.add(n),console.error(n))}function Qd(e,t){console.error(`[naive/${e}]: ${t}`)}function eh(e,t){throw new Error(`[naive/${e}]: ${t}`)}function ft(e,...t){if(Array.isArray(e))e.forEach(n=>ft(n,...t));else return e(...t)}function Vo(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Vo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Vo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function Zb(e,t="default",n=void 0){const r=e[t];if(!r)return Qd("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Vo(r(n));return s.length===1?s[0]:(Qd("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Jb(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function Oo(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function zi(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ms(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ms(t.children)):!0)?e:null}function Io(e,t){return e&&ms(e())||t()}function ci(e,t){const n=e&&ms(e());return t(n||null)}function th(e){return!(e&&ms(e()))}const zo=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),di="n-config-provider",Qb="n";function hi(e={},t={defaultBordered:!0}){const n=i.inject(di,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Qb),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function ui(e,t,n,r){n||eh("useThemeClass","cssVarsRef is not passed");const s=i.inject(di,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=oi();let d;const h=`__${e}`,u=()=>{let p=h;const f=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),f&&(p+=`-${f}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(p+=`-${So(JSON.stringify(m))}`),_&&(p+=`-${So(JSON.stringify(_))}`),l.value=p,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;oe(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const nh="n-form-item";function e1(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(nh,null);i.provide(nh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=e;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return t}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=e;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=e;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const t1={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};function Lo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function pr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function gr(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?i1(l,u=>u.test(a)):n1(l,u=>u.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function n1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function i1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function r1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const s1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},o1=(e,t,n)=>{let r;const s=s1[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},a1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l1=(e,t,n,r)=>a1[e],c1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},d1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},h1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},u1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},p1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},g1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:pr({values:c1,defaultWidth:"wide"}),quarter:pr({values:d1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:pr({values:h1,defaultWidth:"wide"}),day:pr({values:u1,defaultWidth:"wide"}),dayPeriod:pr({values:f1,defaultWidth:"wide",formattingValues:p1,defaultFormattingWidth:"wide"})},m1=/^(\d+)(th|st|nd|rd)?/i,_1=/\d+/i,y1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},b1={any:[/^b/i,/^(a|c)/i]},w1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v1={any:[/1/i,/2/i,/3/i,/4/i]},k1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},x1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},C1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},S1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},B1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},T1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},E1={ordinalNumber:r1({matchPattern:m1,parsePattern:_1,valueCallback:e=>parseInt(e,10)}),era:gr({matchPatterns:y1,defaultMatchWidth:"wide",parsePatterns:b1,defaultParseWidth:"any"}),quarter:gr({matchPatterns:w1,defaultMatchWidth:"wide",parsePatterns:v1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gr({matchPatterns:k1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),day:gr({matchPatterns:C1,defaultMatchWidth:"wide",parsePatterns:S1,defaultParseWidth:"any"}),dayPeriod:gr({matchPatterns:B1,defaultMatchWidth:"any",parsePatterns:T1,defaultParseWidth:"any"})},$1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P1={date:Lo({formats:$1,defaultWidth:"full"}),time:Lo({formats:N1,defaultWidth:"full"}),dateTime:Lo({formats:R1,defaultWidth:"full"})},F1={name:"en-US",locale:{code:"en-US",formatDistance:o1,formatLong:P1,formatRelative:l1,localize:g1,match:E1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ih(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(di,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:t1[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:F1}),localeRef:r}}const mr="naive-ui-style";function _s(e,t,n){if(!t)return;const r=oi(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(di,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(ib(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:mr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const _r={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:M1,fontFamily:A1,lineHeight:V1}=_r,rh=oe("body",`
117
117
  margin: 0;
118
- font-size: ${N1};
119
- font-family: ${R1};
120
- line-height: ${P1};
118
+ font-size: ${M1};
119
+ font-family: ${A1};
120
+ line-height: ${V1};
121
121
  -webkit-text-size-adjust: 100%;
122
122
  -webkit-tap-highlight-color: transparent;
123
123
  `,[oe("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var F1={};function ys(e,t,n){if(!t){F1.NODE_ENV!=="production"&&Qd("use-style","No style is specified.");return}const r=oi(),s=i.inject(di,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:mr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function zk(e){return e}function pt(e,t,n,r,s,o){const a=oi(),l=i.inject(di,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?t:h+t,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:p={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:m,peers:_}=f,{common:y=void 0,[e]:{common:b=void 0,self:S=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:C=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:v,peers:N={}}=B,F=H.merge({},h||b||y||r.common,C,v,m),P=H.merge((d=u||S||r.self)===null||d===void 0?void 0:d(F),g,B,f);return{common:F,self:P,peers:H.merge({},r.peers,x,p),peerOverrides:H.merge({},g.peers,N,_)}})}pt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const M1=ue("base-icon",`
126
+ `)]);var O1={};function ys(e,t,n){if(!t){O1.NODE_ENV!=="production"&&eh("use-style","No style is specified.");return}const r=oi(),s=i.inject(di,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:mr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||rh.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function Dk(e){return e}function pt(e,t,n,r,s,o){const a=oi(),l=i.inject(di,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?t:h+t,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||rh.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:p={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:m,peers:_}=f,{common:y=void 0,[e]:{common:b=void 0,self:S=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:$={}}=B,P=W.merge({},h||b||y||r.common,v,k,m),R=W.merge((d=u||S||r.self)===null||d===void 0?void 0:d(P),g,B,f);return{common:P,self:R,peers:W.merge({},r.peers,x,p),peerOverrides:W.merge({},g.peers,$,_)}})}pt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const I1=ue("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -135,7 +135,7 @@ ${s}
135
135
  `,[oe("svg",`
136
136
  height: 1em;
137
137
  width: 1em;
138
- `)]),yr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){ys("-base-icon",M1,i.toRef(e,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),rh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=ss();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function sh(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:H.upperFirst(e),setup(){var r;const s=(r=i.inject(di,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[e];return a?a():i.h(n,null)}}})}const A1=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),O1=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),I1=sh("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),V1=sh("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),z1=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:L1}=_r;function Do({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${L1} !important`}={}){return[oe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),oe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),oe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const D1=ue("base-clear",`
138
+ `)]),yr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){ys("-base-icon",I1,i.toRef(e,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),sh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=ss();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function oh(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:W.upperFirst(e),setup(){var r;const s=(r=i.inject(di,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[e];return a?a():i.h(n,null)}}})}const z1=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),L1=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),D1=oh("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),H1=oh("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),W1=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:j1}=_r;function Do({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${j1} !important`}={}){return[oe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),oe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),oe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const X1=ue("base-clear",`
139
139
  flex-shrink: 0;
140
140
  height: 1em;
141
141
  width: 1em;
@@ -159,7 +159,7 @@ ${s}
159
159
  left: 50%;
160
160
  top: 50%;
161
161
  transform: translateX(-50%) translateY(-50%);
162
- `,[Do({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),H1=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ys("-base-clear",D1,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(rh,null,{default:()=>{var t,n;return this.show?i.h("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Vo(this.$slots.icon,()=>[i.h(yr,{clsPrefix:e},{default:()=>i.h(I1,null)})])):i.h("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),W1=ue("base-close",`
162
+ `,[Do({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),q1=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ys("-base-clear",X1,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(sh,null,{default:()=>{var t,n;return this.show?i.h("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Io(this.$slots.icon,()=>[i.h(yr,{clsPrefix:e},{default:()=>i.h(D1,null)})])):i.h("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),Y1=ue("base-close",`
163
163
  display: flex;
164
164
  align-items: center;
165
165
  justify-content: center;
@@ -203,7 +203,7 @@ ${s}
203
203
  background-color: transparent;
204
204
  `),Be("round",[oe("&::before",`
205
205
  border-radius: 50%;
206
- `)])]),j1=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return ys("-base-close",W1,i.toRef(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:s,isButtonTag:o}=e,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,s&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},i.h(yr,{clsPrefix:t},{default:()=>i.h(V1,null)}))}}}),X1=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),q1=oe([oe("@keyframes rotator",`
206
+ `)])]),U1=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return ys("-base-close",Y1,i.toRef(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:s,isButtonTag:o}=e,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,s&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},i.h(yr,{clsPrefix:t},{default:()=>i.h(H1,null)}))}}}),G1=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),K1=oe([oe("@keyframes rotator",`
207
207
  0% {
208
208
  -webkit-transform: rotate(0deg);
209
209
  transform: rotate(0deg);
@@ -230,7 +230,7 @@ ${s}
230
230
  `,[_e("icon",`
231
231
  height: 1em;
232
232
  width: 1em;
233
- `)])])]),Ho="1.6s",Y1={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},oh=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Y1),setup(e){ys("-base-loading",q1,i.toRef(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:s}=this,o=t/s;return i.h("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i.h(rh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i.h("div",{class:`${e}-base-loading__container`},i.h("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:ah}=_r;function U1({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=ah,leaveCubicBezier:s=ah}={}){return[oe(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),oe(`&.${e}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),oe(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),oe(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const de={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},G1=ri(de.neutralBase),lh=ri(de.neutralInvertBase),K1=`rgba(${lh.slice(0,3).join(", ")}, `;function ch(e){return`${K1+String(e)})`}function gt(e){const t=Array.from(lh);return t[3]=Number(e),H_(G1,t)}const fi=Object.assign(Object.assign({name:"common"},_r),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:gt(de.alpha4),placeholderColor:gt(de.alpha4),placeholderColorDisabled:gt(de.alpha5),iconColor:gt(de.alpha4),iconColorHover:es(gt(de.alpha4),{lightness:.75}),iconColorPressed:es(gt(de.alpha4),{lightness:.9}),iconColorDisabled:gt(de.alpha5),opacity1:de.alpha1,opacity2:de.alpha2,opacity3:de.alpha3,opacity4:de.alpha4,opacity5:de.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:gt(Number(de.alphaClose)),closeIconColorHover:gt(Number(de.alphaClose)),closeIconColorPressed:gt(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:gt(de.alpha4),clearColorHover:es(gt(de.alpha4),{lightness:.75}),clearColorPressed:es(gt(de.alpha4),{lightness:.9}),scrollbarColor:ch(de.alphaScrollbar),scrollbarColorHover:ch(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:gt(de.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:de.neutralPopover,tableColor:de.neutralCard,cardColor:de.neutralCard,modalColor:de.neutralModal,bodyColor:de.neutralBody,tagColor:"#eee",avatarColor:gt(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:gt(de.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:de.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Z1={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function J1(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},Z1),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const dh={name:"Scrollbar",common:fi,self:J1},Q1=ue("scrollbar",`
233
+ `)])])]),Ho="1.6s",Z1={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},ah=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Z1),setup(e){ys("-base-loading",K1,i.toRef(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:s}=this,o=t/s;return i.h("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i.h(sh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i.h("div",{class:`${e}-base-loading__container`},i.h("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:lh}=_r;function J1({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=lh,leaveCubicBezier:s=lh}={}){return[oe(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),oe(`&.${e}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),oe(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),oe(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const de={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Q1=ri(de.neutralBase),ch=ri(de.neutralInvertBase),ew=`rgba(${ch.slice(0,3).join(", ")}, `;function dh(e){return`${ew+String(e)})`}function gt(e){const t=Array.from(ch);return t[3]=Number(e),q_(Q1,t)}const fi=Object.assign(Object.assign({name:"common"},_r),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:gt(de.alpha4),placeholderColor:gt(de.alpha4),placeholderColorDisabled:gt(de.alpha5),iconColor:gt(de.alpha4),iconColorHover:es(gt(de.alpha4),{lightness:.75}),iconColorPressed:es(gt(de.alpha4),{lightness:.9}),iconColorDisabled:gt(de.alpha5),opacity1:de.alpha1,opacity2:de.alpha2,opacity3:de.alpha3,opacity4:de.alpha4,opacity5:de.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:gt(Number(de.alphaClose)),closeIconColorHover:gt(Number(de.alphaClose)),closeIconColorPressed:gt(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:gt(de.alpha4),clearColorHover:es(gt(de.alpha4),{lightness:.75}),clearColorPressed:es(gt(de.alpha4),{lightness:.9}),scrollbarColor:dh(de.alphaScrollbar),scrollbarColorHover:dh(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:gt(de.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:de.neutralPopover,tableColor:de.neutralCard,cardColor:de.neutralCard,modalColor:de.neutralModal,bodyColor:de.neutralBody,tagColor:"#eee",avatarColor:gt(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:gt(de.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:de.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),tw={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function nw(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},tw),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const hh={name:"Scrollbar",common:fi,self:nw},iw=ue("scrollbar",`
234
234
  overflow: hidden;
235
235
  position: relative;
236
236
  z-index: auto;
@@ -295,7 +295,7 @@ ${s}
295
295
  pointer-events: all;
296
296
  background-color: var(--n-scrollbar-color);
297
297
  transition: background-color .2s var(--n-scrollbar-bezier);
298
- `,[U1(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),ew=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),hh=i.defineComponent({name:"Scrollbar",props:ew,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=hi(e),s=_s("Scrollbar",r,t),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),p=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),_=i.ref(0),y=i.ref(0),b=i.ref(!1),S=i.ref(!1);let x=!1,C=!1,B,v,N=0,F=0,P=0,q=0;const U=Ny(),M=pt("Scrollbar","-scrollbar",Q1,dh,e,t),E=i.computed(()=>{const{value:T}=p,{value:L}=h,{value:Q}=g;return T===null||L===null||Q===null?0:Math.min(T,Q*T/L+ar(M.value.self.width)*1.5)}),A=i.computed(()=>`${E.value}px`),K=i.computed(()=>{const{value:T}=f,{value:L}=u,{value:Q}=m;return T===null||L===null||Q===null?0:Q*T/L+ar(M.value.self.height)*1.5}),R=i.computed(()=>`${K.value}px`),$=i.computed(()=>{const{value:T}=p,{value:L}=_,{value:Q}=h,{value:le}=g;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?L/ce*(le-E.value):0}}),j=i.computed(()=>`${$.value}px`),z=i.computed(()=>{const{value:T}=f,{value:L}=y,{value:Q}=u,{value:le}=m;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?L/ce*(le-K.value):0}}),Y=i.computed(()=>`${z.value}px`),I=i.computed(()=>{const{value:T}=p,{value:L}=h;return T!==null&&L!==null&&L>T}),V=i.computed(()=>{const{value:T}=f,{value:L}=u;return T!==null&&L!==null&&L>T}),J=i.computed(()=>{const{trigger:T}=e;return T==="none"||b.value}),pe=i.computed(()=>{const{trigger:T}=e;return T==="none"||S.value}),ie=i.computed(()=>{const{container:T}=e;return T?T():a.value}),ge=i.computed(()=>{const{content:T}=e;return T?T():l.value}),re=(T,L)=>{if(!e.scrollable)return;if(typeof T=="number"){Se(T,L??0,0,!1,"auto");return}const{left:Q,top:le,index:ce,elSize:me,position:be,behavior:ke,el:je,debounce:cn=!0}=T;(Q!==void 0||le!==void 0)&&Se(Q??0,le??0,0,!1,ke),je!==void 0?Se(0,je.offsetTop,je.offsetHeight,cn,ke):ce!==void 0&&me!==void 0?Se(0,ce*me,me,cn,ke):be==="bottom"?Se(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&Se(0,0,0,!1,ke)},Me=Ib(()=>{e.container||re({top:_.value,left:y.value})}),Fe=()=>{Me.isDeactivated||ne()},Ge=T=>{if(Me.isDeactivated)return;const{onResize:L}=e;L&&L(T),ne()},xe=(T,L)=>{if(!e.scrollable)return;const{value:Q}=ie;Q&&(typeof T=="object"?Q.scrollBy(T):Q.scrollBy(T,L||0))};function Se(T,L,Q,le,ce){const{value:me}=ie;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(L>be){L+Q<=be+ke||me.scrollTo({left:T,top:L+Q-ke,behavior:ce});return}}me.scrollTo({left:T,top:L,behavior:ce})}}function st(){mi(),_i(),ne()}function Ke(){nt()}function nt(){Yt(),$t()}function Yt(){v!==void 0&&window.clearTimeout(v),v=window.setTimeout(()=>{S.value=!1},e.duration)}function $t(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function mi(){B!==void 0&&window.clearTimeout(B),b.value=!0}function _i(){v!==void 0&&window.clearTimeout(v),S.value=!0}function In(T){const{onScroll:L}=e;L&&L(T),ln()}function ln(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function lt(){const{value:T}=ge;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:L}=ie;L&&(p.value=L.offsetHeight,f.value=L.offsetWidth);const{value:Q}=d,{value:le}=c;Q&&(m.value=Q.offsetWidth),le&&(g.value=le.offsetHeight)}function te(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),p.value=T.offsetHeight,f.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:L}=d,{value:Q}=c;L&&(m.value=L.offsetWidth),Q&&(g.value=Q.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?te():(lt(),ln()))}function We(T){var L;return!(!((L=o.value)===null||L===void 0)&&L.contains(or(T)))}function wr(T){T.preventDefault(),T.stopPropagation(),C=!0,kt("mousemove",window,Li,!0),kt("mouseup",window,yi,!0),F=y.value,P=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Li(T){if(!C)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:L}=f,{value:Q}=u,{value:le}=K;if(L===null||Q===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-P:T.clientX-P)*(Q-L)/(L-le),be=Q-L;let ke=F+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;if(je){je.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:cn}=e;cn&&cn(ke)}}function yi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Li,!0),et("mouseup",window,yi,!0),C=!1,ne(),We(T)&&nt()}function Di(T){T.preventDefault(),T.stopPropagation(),x=!0,kt("mousemove",window,Vn,!0),kt("mouseup",window,bi,!0),N=_.value,q=T.clientY}function Vn(T){if(!x)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:L}=p,{value:Q}=h,{value:le}=E;if(L===null||Q===null)return;const me=(T.clientY-q)*(Q-L)/(L-le),be=Q-L;let ke=N+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;je&&(je.scrollTop=ke)}function bi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Vn,!0),et("mouseup",window,bi,!0),x=!1,ne(),We(T)&&nt()}i.watchEffect(()=>{const{value:T}=V,{value:L}=I,{value:Q}=t,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${Q}-scrollbar-rail--disabled`):le.classList.add(`${Q}-scrollbar-rail--disabled`)),ce&&(L?ce.classList.remove(`${Q}-scrollbar-rail--disabled`):ce.classList.add(`${Q}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ne()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v),et("mousemove",window,Vn,!0),et("mouseup",window,bi,!0)});const Hi=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:L,colorHover:Q,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:je,railInsetVerticalLeft:cn,railColor:Uo}}=M.value,{top:Go,right:Ko,bottom:Zo,left:Jo}=jt(be),{top:Qo,right:ea,bottom:ta,left:na}=jt(ke),{top:ia,right:ra,bottom:sa,left:oa}=jt(s!=null&&s.value?qd(je):je),{top:aa,right:la,bottom:ca,left:da}=jt(s!=null&&s.value?qd(cn):cn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":L,"--n-scrollbar-color-hover":Q,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Go,"--n-scrollbar-rail-right-horizontal-top":Ko,"--n-scrollbar-rail-bottom-horizontal-top":Zo,"--n-scrollbar-rail-left-horizontal-top":Jo,"--n-scrollbar-rail-top-horizontal-bottom":Qo,"--n-scrollbar-rail-right-horizontal-bottom":ea,"--n-scrollbar-rail-bottom-horizontal-bottom":ta,"--n-scrollbar-rail-left-horizontal-bottom":na,"--n-scrollbar-rail-top-vertical-right":ia,"--n-scrollbar-rail-right-vertical-right":ra,"--n-scrollbar-rail-bottom-vertical-right":sa,"--n-scrollbar-rail-left-vertical-right":oa,"--n-scrollbar-rail-top-vertical-left":aa,"--n-scrollbar-rail-right-vertical-left":la,"--n-scrollbar-rail-bottom-vertical-left":ca,"--n-scrollbar-rail-left-vertical-left":da,"--n-scrollbar-rail-color":Uo}}),Ut=n?ui("scrollbar",void 0,Hi,e):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:xe,sync:ne,syncUnifiedContainer:te,handleMouseEnterWrapper:st,handleMouseLeaveWrapper:Ke}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:I,needXBar:V,yBarSizePx:A,xBarSizePx:R,yBarTopPx:j,xBarLeftPx:Y,isShowXBar:J,isShowYBar:pe,isIos:U,handleScroll:In,handleContentResize:Fe,handleContainerResize:Ge,handleYScrollMouseDown:Di,handleXScrollMouseDown:wr,cssVars:n?void 0:Hi,themeClass:Ut==null?void 0:Ut.themeClass,onRender:Ut==null?void 0:Ut.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const d=this.trigger==="none",h=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?zo:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(g=t.default)===null||g===void 0?void 0:g.call(t):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(ps,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},t)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?zo:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():i.h(ps,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),tw=hh,nw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function iw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},nw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const uh={name:"Empty",common:fi,self:iw},rw=ue("empty",`
298
+ `,[J1(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),rw=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),uh=i.defineComponent({name:"Scrollbar",props:rw,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=hi(e),s=_s("Scrollbar",r,t),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),p=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),_=i.ref(0),y=i.ref(0),b=i.ref(!1),S=i.ref(!1);let x=!1,v=!1,B,k,$=0,P=0,R=0,j=0;const Y=My(),A=pt("Scrollbar","-scrollbar",iw,hh,e,t),E=i.computed(()=>{const{value:T}=p,{value:L}=h,{value:Q}=g;return T===null||L===null||Q===null?0:Math.min(T,Q*T/L+ar(A.value.self.width)*1.5)}),M=i.computed(()=>`${E.value}px`),K=i.computed(()=>{const{value:T}=f,{value:L}=u,{value:Q}=m;return T===null||L===null||Q===null?0:Q*T/L+ar(A.value.self.height)*1.5}),F=i.computed(()=>`${K.value}px`),N=i.computed(()=>{const{value:T}=p,{value:L}=_,{value:Q}=h,{value:le}=g;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?L/ce*(le-E.value):0}}),X=i.computed(()=>`${N.value}px`),z=i.computed(()=>{const{value:T}=f,{value:L}=y,{value:Q}=u,{value:le}=m;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?L/ce*(le-K.value):0}}),U=i.computed(()=>`${z.value}px`),O=i.computed(()=>{const{value:T}=p,{value:L}=h;return T!==null&&L!==null&&L>T}),I=i.computed(()=>{const{value:T}=f,{value:L}=u;return T!==null&&L!==null&&L>T}),J=i.computed(()=>{const{trigger:T}=e;return T==="none"||b.value}),pe=i.computed(()=>{const{trigger:T}=e;return T==="none"||S.value}),ie=i.computed(()=>{const{container:T}=e;return T?T():a.value}),ge=i.computed(()=>{const{content:T}=e;return T?T():l.value}),re=(T,L)=>{if(!e.scrollable)return;if(typeof T=="number"){Se(T,L??0,0,!1,"auto");return}const{left:Q,top:le,index:ce,elSize:me,position:be,behavior:ke,el:je,debounce:cn=!0}=T;(Q!==void 0||le!==void 0)&&Se(Q??0,le??0,0,!1,ke),je!==void 0?Se(0,je.offsetTop,je.offsetHeight,cn,ke):ce!==void 0&&me!==void 0?Se(0,ce*me,me,cn,ke):be==="bottom"?Se(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&Se(0,0,0,!1,ke)},Me=Db(()=>{e.container||re({top:_.value,left:y.value})}),Fe=()=>{Me.isDeactivated||ne()},Ge=T=>{if(Me.isDeactivated)return;const{onResize:L}=e;L&&L(T),ne()},xe=(T,L)=>{if(!e.scrollable)return;const{value:Q}=ie;Q&&(typeof T=="object"?Q.scrollBy(T):Q.scrollBy(T,L||0))};function Se(T,L,Q,le,ce){const{value:me}=ie;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(L>be){L+Q<=be+ke||me.scrollTo({left:T,top:L+Q-ke,behavior:ce});return}}me.scrollTo({left:T,top:L,behavior:ce})}}function st(){mi(),_i(),ne()}function Ke(){nt()}function nt(){Yt(),$t()}function Yt(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},e.duration)}function $t(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function mi(){B!==void 0&&window.clearTimeout(B),b.value=!0}function _i(){k!==void 0&&window.clearTimeout(k),S.value=!0}function On(T){const{onScroll:L}=e;L&&L(T),ln()}function ln(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function lt(){const{value:T}=ge;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:L}=ie;L&&(p.value=L.offsetHeight,f.value=L.offsetWidth);const{value:Q}=d,{value:le}=c;Q&&(m.value=Q.offsetWidth),le&&(g.value=le.offsetHeight)}function te(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),p.value=T.offsetHeight,f.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:L}=d,{value:Q}=c;L&&(m.value=L.offsetWidth),Q&&(g.value=Q.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?te():(lt(),ln()))}function We(T){var L;return!(!((L=o.value)===null||L===void 0)&&L.contains(or(T)))}function wr(T){T.preventDefault(),T.stopPropagation(),v=!0,kt("mousemove",window,Li,!0),kt("mouseup",window,yi,!0),P=y.value,R=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Li(T){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:L}=f,{value:Q}=u,{value:le}=K;if(L===null||Q===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-R:T.clientX-R)*(Q-L)/(L-le),be=Q-L;let ke=P+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;if(je){je.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:cn}=e;cn&&cn(ke)}}function yi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Li,!0),et("mouseup",window,yi,!0),v=!1,ne(),We(T)&&nt()}function Di(T){T.preventDefault(),T.stopPropagation(),x=!0,kt("mousemove",window,In,!0),kt("mouseup",window,bi,!0),$=_.value,j=T.clientY}function In(T){if(!x)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:L}=p,{value:Q}=h,{value:le}=E;if(L===null||Q===null)return;const me=(T.clientY-j)*(Q-L)/(L-le),be=Q-L;let ke=$+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;je&&(je.scrollTop=ke)}function bi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,In,!0),et("mouseup",window,bi,!0),x=!1,ne(),We(T)&&nt()}i.watchEffect(()=>{const{value:T}=I,{value:L}=O,{value:Q}=t,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${Q}-scrollbar-rail--disabled`):le.classList.add(`${Q}-scrollbar-rail--disabled`)),ce&&(L?ce.classList.remove(`${Q}-scrollbar-rail--disabled`):ce.classList.add(`${Q}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ne()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),et("mousemove",window,In,!0),et("mouseup",window,bi,!0)});const Hi=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:L,colorHover:Q,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:je,railInsetVerticalLeft:cn,railColor:Uo}}=A.value,{top:Go,right:Ko,bottom:Zo,left:Jo}=jt(be),{top:Qo,right:ea,bottom:ta,left:na}=jt(ke),{top:ia,right:ra,bottom:sa,left:oa}=jt(s!=null&&s.value?Yd(je):je),{top:aa,right:la,bottom:ca,left:da}=jt(s!=null&&s.value?Yd(cn):cn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":L,"--n-scrollbar-color-hover":Q,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Go,"--n-scrollbar-rail-right-horizontal-top":Ko,"--n-scrollbar-rail-bottom-horizontal-top":Zo,"--n-scrollbar-rail-left-horizontal-top":Jo,"--n-scrollbar-rail-top-horizontal-bottom":Qo,"--n-scrollbar-rail-right-horizontal-bottom":ea,"--n-scrollbar-rail-bottom-horizontal-bottom":ta,"--n-scrollbar-rail-left-horizontal-bottom":na,"--n-scrollbar-rail-top-vertical-right":ia,"--n-scrollbar-rail-right-vertical-right":ra,"--n-scrollbar-rail-bottom-vertical-right":sa,"--n-scrollbar-rail-left-vertical-right":oa,"--n-scrollbar-rail-top-vertical-left":aa,"--n-scrollbar-rail-right-vertical-left":la,"--n-scrollbar-rail-bottom-vertical-left":ca,"--n-scrollbar-rail-left-vertical-left":da,"--n-scrollbar-rail-color":Uo}}),Ut=n?ui("scrollbar",void 0,Hi,e):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:xe,sync:ne,syncUnifiedContainer:te,handleMouseEnterWrapper:st,handleMouseLeaveWrapper:Ke}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:I,yBarSizePx:M,xBarSizePx:F,yBarTopPx:X,xBarLeftPx:U,isShowXBar:J,isShowYBar:pe,isIos:Y,handleScroll:On,handleContentResize:Fe,handleContainerResize:Ge,handleYScrollMouseDown:Di,handleXScrollMouseDown:wr,cssVars:n?void 0:Hi,themeClass:Ut==null?void 0:Ut.themeClass,onRender:Ut==null?void 0:Ut.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const d=this.trigger==="none",h=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?zo:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(g=t.default)===null||g===void 0?void 0:g.call(t):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(ps,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},t)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?zo:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():i.h(ps,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),sw=uh,ow={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function aw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},ow),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const fh={name:"Empty",common:fi,self:aw},lw=ue("empty",`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  align-items: center;
@@ -318,7 +318,7 @@ ${s}
318
318
  transition: color .3s var(--n-bezier);
319
319
  margin-top: 12px;
320
320
  color: var(--n-extra-text-color);
321
- `)]),sw=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),ow=i.defineComponent({name:"Empty",props:sw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=hi(e),s=pt("Empty","-empty",rw,uh,e,t),{localeRef:o}=nh("Empty"),a=i.computed(()=>{var h,u,p;return(h=e.description)!==null&&h!==void 0?h:(p=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||p===void 0?void 0:p.description}),l=i.computed(()=>{var h,u;return((u=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>i.h(z1,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:u},self:{[Xe("iconSize",h)]:p,[Xe("fontSize",h)]:f,textColor:g,iconColor:m,extraTextColor:_}}=s.value;return{"--n-icon-size":p,"--n-font-size":f,"--n-bezier":u,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":_}}),d=n?ui("empty",i.computed(()=>{let h="";const{size:u}=e;return h+=u[0],h}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${t}-empty__icon`},e.icon?e.icon():i.h(yr,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i.h("div",{class:`${t}-empty__extra`},e.extra()):null)}}),aw={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function lw(e){const{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:f,fontSizeLarge:g,fontSizeHuge:m,heightTiny:_,heightSmall:y,heightMedium:b,heightLarge:S,heightHuge:x}=e;return Object.assign(Object.assign({},aw),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:f,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:_,optionHeightSmall:y,optionHeightMedium:b,optionHeightLarge:S,optionHeightHuge:x,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const fh={name:"InternalSelectMenu",common:fi,peers:{Scrollbar:dh,Empty:uh},self:lw},ph=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=i.inject(Fo);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=t?t(s,!1):zi(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${e}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function cw(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(yr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(A1)}):null})}const gh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:u,handleOptionMouseEnter:p}=i.inject(Fo),f=Lt(()=>{const{value:y}=n;return y?e.tmNode.key===y.key:!1});function g(y){const{tmNode:b}=e;b.disabled||u(y,b)}function m(y){const{tmNode:b}=e;b.disabled||p(y,b)}function _(y){const{tmNode:b}=e,{value:S}=f;b.disabled||S||p(y,b)}return{multiple:r,isGrouped:Lt(()=>{const{tmNode:y}=e,{parent:b}=y;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:f,isSelected:Lt(()=>{const{value:y}=t,{value:b}=r;if(y===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:x}=s;return x.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:_,handleMouseEnter:m,handleClick:g}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:u}=this,p=cw(n,e),f=c?[c(t,n),o&&p]:[zi(t[this.labelField],t,n),o&&p],g=a==null?void 0:a(t),m=i.h("div",Object.assign({},g,{class:[`${e}-base-select-option`,t.class,g==null?void 0:g.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",t.style||""],onClick:Io([d,g==null?void 0:g.onClick]),onMouseenter:Io([h,g==null?void 0:g.onMouseenter]),onMousemove:Io([u,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},f));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:mh,cubicBezierEaseOut:_h}=_r;function yh({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[oe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${mh}, transform ${t} ${mh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${_h}, transform ${t} ${_h} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),oe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const dw=ue("base-select-menu",`
321
+ `)]),cw=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),dw=i.defineComponent({name:"Empty",props:cw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=hi(e),s=pt("Empty","-empty",lw,fh,e,t),{localeRef:o}=ih("Empty"),a=i.computed(()=>{var h,u,p;return(h=e.description)!==null&&h!==void 0?h:(p=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||p===void 0?void 0:p.description}),l=i.computed(()=>{var h,u;return((u=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>i.h(W1,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:u},self:{[Xe("iconSize",h)]:p,[Xe("fontSize",h)]:f,textColor:g,iconColor:m,extraTextColor:_}}=s.value;return{"--n-icon-size":p,"--n-font-size":f,"--n-bezier":u,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":_}}),d=n?ui("empty",i.computed(()=>{let h="";const{size:u}=e;return h+=u[0],h}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${t}-empty__icon`},e.icon?e.icon():i.h(yr,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i.h("div",{class:`${t}-empty__extra`},e.extra()):null)}}),hw={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function uw(e){const{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:f,fontSizeLarge:g,fontSizeHuge:m,heightTiny:_,heightSmall:y,heightMedium:b,heightLarge:S,heightHuge:x}=e;return Object.assign(Object.assign({},hw),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:f,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:_,optionHeightSmall:y,optionHeightMedium:b,optionHeightLarge:S,optionHeightHuge:x,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const ph={name:"InternalSelectMenu",common:fi,peers:{Scrollbar:hh,Empty:fh},self:uw},gh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=i.inject(Fo);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=t?t(s,!1):zi(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${e}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function fw(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(yr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(z1)}):null})}const mh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:u,handleOptionMouseEnter:p}=i.inject(Fo),f=Lt(()=>{const{value:y}=n;return y?e.tmNode.key===y.key:!1});function g(y){const{tmNode:b}=e;b.disabled||u(y,b)}function m(y){const{tmNode:b}=e;b.disabled||p(y,b)}function _(y){const{tmNode:b}=e,{value:S}=f;b.disabled||S||p(y,b)}return{multiple:r,isGrouped:Lt(()=>{const{tmNode:y}=e,{parent:b}=y;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:f,isSelected:Lt(()=>{const{value:y}=t,{value:b}=r;if(y===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:x}=s;return x.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:_,handleMouseEnter:m,handleClick:g}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:u}=this,p=fw(n,e),f=c?[c(t,n),o&&p]:[zi(t[this.labelField],t,n),o&&p],g=a==null?void 0:a(t),m=i.h("div",Object.assign({},g,{class:[`${e}-base-select-option`,t.class,g==null?void 0:g.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",t.style||""],onClick:Oo([d,g==null?void 0:g.onClick]),onMouseenter:Oo([h,g==null?void 0:g.onMouseenter]),onMousemove:Oo([u,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},f));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:_h,cubicBezierEaseOut:yh}=_r;function bh({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[oe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${_h}, transform ${t} ${_h} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${yh}, transform ${t} ${yh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),oe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const pw=ue("base-select-menu",`
322
322
  line-height: 1.5;
323
323
  outline: none;
324
324
  z-index: 0;
@@ -425,7 +425,7 @@ ${s}
425
425
  top: calc(50% - 7px);
426
426
  color: var(--n-option-check-color);
427
427
  transition: color .3s var(--n-bezier);
428
- `,[yh({enterScale:"0.5"})])])]),hw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=hi(e),r=_s("InternalSelectMenu",n,t),s=pt("InternalSelectMenu","-internal-select-menu",dw,fh,e,i.toRef(e,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>e.treeMate.getFlattenedNodes()),d=i.computed(()=>iy(c.value)),h=i.ref(null);function u(){const{treeMate:I}=e;let V=null;const{value:J}=e;J===null?V=I.getFirstAvailableNode():(e.multiple?V=I.getNode((J||[])[(J||[]).length-1]):V=I.getNode(J),(!V||V.disabled)&&(V=I.getFirstAvailableNode())),E(V||null)}function p(){const{value:I}=h;I&&!e.treeMate.getNode(I.key)&&(h.value=null)}let f;i.watch(()=>e.show,I=>{I?f=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():p(),i.nextTick(A)):p()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>ar(s.value.self[Xe("optionHeight",e.size)])),m=i.computed(()=>jt(s.value.self[Xe("padding",e.size)])),_=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=i.computed(()=>{const I=c.value;return I&&I.length===0});function b(I){const{onToggle:V}=e;V&&V(I)}function S(I){const{onScroll:V}=e;V&&V(I)}function x(I){var V;(V=l.value)===null||V===void 0||V.sync(),S(I)}function C(){var I;(I=l.value)===null||I===void 0||I.sync()}function B(){const{value:I}=h;return I||null}function v(I,V){V.disabled||E(V,!1)}function N(I,V){V.disabled||b(V)}function F(I){var V;sr(I,"action")||(V=e.onKeyup)===null||V===void 0||V.call(e,I)}function P(I){var V;sr(I,"action")||(V=e.onKeydown)===null||V===void 0||V.call(e,I)}function q(I){var V;(V=e.onMousedown)===null||V===void 0||V.call(e,I),!e.focusable&&I.preventDefault()}function U(){const{value:I}=h;I&&E(I.getNext({loop:!0}),!0)}function M(){const{value:I}=h;I&&E(I.getPrev({loop:!0}),!0)}function E(I,V=!1){h.value=I,V&&A()}function A(){var I,V;const J=h.value;if(!J)return;const pe=d.value(J.key);pe!==null&&(e.virtualScroll?(I=a.value)===null||I===void 0||I.scrollTo({index:pe}):(V=l.value)===null||V===void 0||V.scrollTo({index:pe,elSize:g.value}))}function K(I){var V,J;!((V=o.value)===null||V===void 0)&&V.contains(I.target)&&((J=e.onFocus)===null||J===void 0||J.call(e,I))}function R(I){var V,J;!((V=o.value)===null||V===void 0)&&V.contains(I.relatedTarget)||(J=e.onBlur)===null||J===void 0||J.call(e,I)}i.provide(Fo,{handleOptionMouseEnter:v,handleOptionClick:N,valueSetRef:_,pendingTmNodeRef:h,nodePropsRef:i.toRef(e,"nodeProps"),showCheckmarkRef:i.toRef(e,"showCheckmark"),multipleRef:i.toRef(e,"multiple"),valueRef:i.toRef(e,"value"),renderLabelRef:i.toRef(e,"renderLabel"),renderOptionRef:i.toRef(e,"renderOption"),labelFieldRef:i.toRef(e,"labelField"),valueFieldRef:i.toRef(e,"valueField")}),i.provide(Vd,o),i.onMounted(()=>{const{value:I}=l;I&&I.sync()});const $=i.computed(()=>{const{size:I}=e,{common:{cubicBezierEaseInOut:V},self:{height:J,borderRadius:pe,color:ie,groupHeaderTextColor:ge,actionDividerColor:re,optionTextColorPressed:Me,optionTextColor:Fe,optionTextColorDisabled:Ge,optionTextColorActive:xe,optionOpacityDisabled:Se,optionCheckColor:st,actionTextColor:Ke,optionColorPending:nt,optionColorActive:Yt,loadingColor:$t,loadingSize:mi,optionColorActivePending:_i,[Xe("optionFontSize",I)]:In,[Xe("optionHeight",I)]:ln,[Xe("optionPadding",I)]:lt}}=s.value;return{"--n-height":J,"--n-action-divider-color":re,"--n-action-text-color":Ke,"--n-bezier":V,"--n-border-radius":pe,"--n-color":ie,"--n-option-font-size":In,"--n-group-header-text-color":ge,"--n-option-check-color":st,"--n-option-color-pending":nt,"--n-option-color-active":Yt,"--n-option-color-active-pending":_i,"--n-option-height":ln,"--n-option-opacity-disabled":Se,"--n-option-text-color":Fe,"--n-option-text-color-active":xe,"--n-option-text-color-disabled":Ge,"--n-option-text-color-pressed":Me,"--n-option-padding":lt,"--n-option-padding-left":jt(lt,"left"),"--n-option-padding-right":jt(lt,"right"),"--n-loading-color":$t,"--n-loading-size":mi}}),{inlineThemeDisabled:j}=e,z=j?ui("internal-select-menu",i.computed(()=>e.size[0]),$,e):void 0,Y={selfRef:o,next:U,prev:M,getPendingTmNode:B};return Wd(o,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:m,flattenedNodes:c,empty:y,virtualListContainer(){const{value:I}=a;return I==null?void 0:I.listElRef},virtualListContent(){const{value:I}=a;return I==null?void 0:I.itemsElRef},doScroll:S,handleFocusin:K,handleFocusout:R,handleKeyUp:F,handleKeyDown:P,handleMouseDown:q,handleVirtualListResize:C,handleVirtualListScroll:x,cssVars:j?void 0:$,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender},Y)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},ci(e.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(oh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Vo(e.empty,()=>[i.h(ow,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(hh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?i.h(Fb,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(ph,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(gh,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(ph,{key:a.key,clsPrefix:n,tmNode:a}):i.h(gh,{clsPrefix:n,key:a.key,tmNode:a})))}),ci(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(X1,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),uw={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function fw(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},uw),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const bh={name:"Popover",common:fi,self:fw},Wo={top:"bottom",bottom:"top",left:"right",right:"left"},tt="var(--n-arrow-height) * 1.414",pw=oe([ue("popover",`
428
+ `,[bh({enterScale:"0.5"})])])]),gw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=hi(e),r=_s("InternalSelectMenu",n,t),s=pt("InternalSelectMenu","-internal-select-menu",pw,ph,e,i.toRef(e,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>e.treeMate.getFlattenedNodes()),d=i.computed(()=>ay(c.value)),h=i.ref(null);function u(){const{treeMate:O}=e;let I=null;const{value:J}=e;J===null?I=O.getFirstAvailableNode():(e.multiple?I=O.getNode((J||[])[(J||[]).length-1]):I=O.getNode(J),(!I||I.disabled)&&(I=O.getFirstAvailableNode())),E(I||null)}function p(){const{value:O}=h;O&&!e.treeMate.getNode(O.key)&&(h.value=null)}let f;i.watch(()=>e.show,O=>{O?f=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():p(),i.nextTick(M)):p()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>ar(s.value.self[Xe("optionHeight",e.size)])),m=i.computed(()=>jt(s.value.self[Xe("padding",e.size)])),_=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function b(O){const{onToggle:I}=e;I&&I(O)}function S(O){const{onScroll:I}=e;I&&I(O)}function x(O){var I;(I=l.value)===null||I===void 0||I.sync(),S(O)}function v(){var O;(O=l.value)===null||O===void 0||O.sync()}function B(){const{value:O}=h;return O||null}function k(O,I){I.disabled||E(I,!1)}function $(O,I){I.disabled||b(I)}function P(O){var I;sr(O,"action")||(I=e.onKeyup)===null||I===void 0||I.call(e,O)}function R(O){var I;sr(O,"action")||(I=e.onKeydown)===null||I===void 0||I.call(e,O)}function j(O){var I;(I=e.onMousedown)===null||I===void 0||I.call(e,O),!e.focusable&&O.preventDefault()}function Y(){const{value:O}=h;O&&E(O.getNext({loop:!0}),!0)}function A(){const{value:O}=h;O&&E(O.getPrev({loop:!0}),!0)}function E(O,I=!1){h.value=O,I&&M()}function M(){var O,I;const J=h.value;if(!J)return;const pe=d.value(J.key);pe!==null&&(e.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:pe}):(I=l.value)===null||I===void 0||I.scrollTo({index:pe,elSize:g.value}))}function K(O){var I,J;!((I=o.value)===null||I===void 0)&&I.contains(O.target)&&((J=e.onFocus)===null||J===void 0||J.call(e,O))}function F(O){var I,J;!((I=o.value)===null||I===void 0)&&I.contains(O.relatedTarget)||(J=e.onBlur)===null||J===void 0||J.call(e,O)}i.provide(Fo,{handleOptionMouseEnter:k,handleOptionClick:$,valueSetRef:_,pendingTmNodeRef:h,nodePropsRef:i.toRef(e,"nodeProps"),showCheckmarkRef:i.toRef(e,"showCheckmark"),multipleRef:i.toRef(e,"multiple"),valueRef:i.toRef(e,"value"),renderLabelRef:i.toRef(e,"renderLabel"),renderOptionRef:i.toRef(e,"renderOption"),labelFieldRef:i.toRef(e,"labelField"),valueFieldRef:i.toRef(e,"valueField")}),i.provide(zd,o),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const N=i.computed(()=>{const{size:O}=e,{common:{cubicBezierEaseInOut:I},self:{height:J,borderRadius:pe,color:ie,groupHeaderTextColor:ge,actionDividerColor:re,optionTextColorPressed:Me,optionTextColor:Fe,optionTextColorDisabled:Ge,optionTextColorActive:xe,optionOpacityDisabled:Se,optionCheckColor:st,actionTextColor:Ke,optionColorPending:nt,optionColorActive:Yt,loadingColor:$t,loadingSize:mi,optionColorActivePending:_i,[Xe("optionFontSize",O)]:On,[Xe("optionHeight",O)]:ln,[Xe("optionPadding",O)]:lt}}=s.value;return{"--n-height":J,"--n-action-divider-color":re,"--n-action-text-color":Ke,"--n-bezier":I,"--n-border-radius":pe,"--n-color":ie,"--n-option-font-size":On,"--n-group-header-text-color":ge,"--n-option-check-color":st,"--n-option-color-pending":nt,"--n-option-color-active":Yt,"--n-option-color-active-pending":_i,"--n-option-height":ln,"--n-option-opacity-disabled":Se,"--n-option-text-color":Fe,"--n-option-text-color-active":xe,"--n-option-text-color-disabled":Ge,"--n-option-text-color-pressed":Me,"--n-option-padding":lt,"--n-option-padding-left":jt(lt,"left"),"--n-option-padding-right":jt(lt,"right"),"--n-loading-color":$t,"--n-loading-size":mi}}),{inlineThemeDisabled:X}=e,z=X?ui("internal-select-menu",i.computed(()=>e.size[0]),N,e):void 0,U={selfRef:o,next:Y,prev:A,getPendingTmNode:B};return jd(o,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:m,flattenedNodes:c,empty:y,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:S,handleFocusin:K,handleFocusout:F,handleKeyUp:P,handleKeyDown:R,handleMouseDown:j,handleVirtualListResize:v,handleVirtualListScroll:x,cssVars:X?void 0:N,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender},U)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},ci(e.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(ah,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Io(e.empty,()=>[i.h(dw,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(uh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?i.h(Ob,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(gh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(mh,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(gh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(mh,{clsPrefix:n,key:a.key,tmNode:a})))}),ci(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(G1,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),mw={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function _w(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},mw),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const wh={name:"Popover",common:fi,self:_w},Wo={top:"bottom",bottom:"top",left:"right",right:"left"},tt="var(--n-arrow-height) * 1.414",yw=oe([ue("popover",`
429
429
  transition:
430
430
  box-shadow .3s var(--n-bezier),
431
431
  background-color .3s var(--n-bezier),
@@ -527,13 +527,13 @@ ${s}
527
527
  `),Dt("right-end",`
528
528
  right: calc(${tt} / -2);
529
529
  bottom: calc(${mn("right-end")} + var(--v-offset-top));
530
- `),...H.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${tt}) / 2)`,c=mn(s);return oe(`[v-placement="${s}"] >`,[ue("popover-shared",[Be("center-arrow",[ue("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function mn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Dt(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return oe(`[v-placement="${e}"] >`,[ue("popover-shared",`
530
+ `),...W.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${tt}) / 2)`,c=mn(s);return oe(`[v-placement="${s}"] >`,[ue("popover-shared",[Be("center-arrow",[ue("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function mn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Dt(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return oe(`[v-placement="${e}"] >`,[ue("popover-shared",`
531
531
  margin-${Wo[n]}: var(--n-space);
532
532
  `,[Be("show-arrow",`
533
533
  margin-${Wo[n]}: var(--n-space-arrow);
534
534
  `),Be("overlap",`
535
535
  margin: 0;
536
- `),Wb("popover-arrow-wrapper",`
536
+ `),Yb("popover-arrow-wrapper",`
537
537
  right: 0;
538
538
  left: 0;
539
539
  top: 0;
@@ -541,7 +541,7 @@ ${s}
541
541
  ${n}: 100%;
542
542
  ${Wo[n]}: auto;
543
543
  ${r}
544
- `,[ue("popover-arrow",t)])])])}const wh=Object.assign(Object.assign({},pt.props),{to:gn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function gw({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,e],style:t}))}const mw=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:wh,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=hi(e),a=pt("Popover","-popover",pw,bh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),u=i.ref(!1);i.watchEffect(()=>{const{show:v}=e;v&&!jb()&&!e.internalDeactivateImmediately&&(u.value=!0)});const p=i.computed(()=>{const{trigger:v,onClickoutside:N}=e,F=[],{positionManuallyRef:{value:P}}=c;return P||(v==="click"&&!N&&F.push([rs,x,void 0,{capture:!0}]),v==="hover"&&F.push([xy,S])),N&&F.push([rs,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&F.push([i.vShow,e.show]),F}),f=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:N,cubicBezierEaseOut:F},self:{space:P,spaceArrow:q,padding:U,fontSize:M,textColor:E,dividerColor:A,color:K,boxShadow:R,borderRadius:$,arrowHeight:j,arrowOffset:z,arrowOffsetVertical:Y}}=a.value;return{"--n-box-shadow":R,"--n-bezier":v,"--n-bezier-ease-in":N,"--n-bezier-ease-out":F,"--n-font-size":M,"--n-text-color":E,"--n-color":K,"--n-divider-color":A,"--n-border-radius":$,"--n-arrow-height":j,"--n-arrow-offset":z,"--n-arrow-offset-vertical":Y,"--n-padding":U,"--n-space":P,"--n-space-arrow":q}}),g=i.computed(()=>{const v=e.width==="trigger"?void 0:Mo(e.width),N=[];v&&N.push({width:v});const{maxWidth:F,minWidth:P}=e;return F&&N.push({maxWidth:Mo(F)}),P&&N.push({maxWidth:Mo(P)}),o||N.push(f.value),N}),m=o?ui("popover",void 0,f,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),v=>{e.animated||(v?h.value=!0:h.value=!1)});function _(){var v;(v=l.value)===null||v===void 0||v.syncPosition()}function y(v){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(v)}function b(v){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(v)}function S(v){e.trigger==="hover"&&!C().contains(or(v))&&c.handleMouseMoveOutside(v)}function x(v){(e.trigger==="click"&&!C().contains(or(v))||e.onClickoutside)&&c.handleClickOutside(v)}function C(){return c.getTriggerElement()}i.provide(Dd,d),i.provide(zd,null),i.provide(Ld,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let N;const F=c.internalRenderBodyRef.value,{value:P}=s;if(F)N=F([`${P}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${P}-popover-shared--overlap`,e.showArrow&&`${P}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${P}-popover-shared--center-arrow`],d,g.value,y,b);else{const{value:q}=c.extraClassRef,{internalTrapFocus:U}=e,M=!eh(t.header)||!eh(t.footer),E=()=>{var A,K;const R=M?i.h(i.Fragment,null,ci(t.header,z=>z?i.h("div",{class:[`${P}-popover__header`,e.headerClass],style:e.headerStyle},z):null),ci(t.default,z=>z?i.h("div",{class:[`${P}-popover__content`,e.contentClass],style:e.contentStyle},t):null),ci(t.footer,z=>z?i.h("div",{class:[`${P}-popover__footer`,e.footerClass],style:e.footerStyle},z):null)):e.scrollable?(A=t.default)===null||A===void 0?void 0:A.call(t):i.h("div",{class:[`${P}-popover__content`,e.contentClass],style:e.contentStyle},t),$=e.scrollable?i.h(tw,{contentClass:M?void 0:`${P}-popover__content ${(K=e.contentClass)!==null&&K!==void 0?K:""}`,contentStyle:M?void 0:e.contentStyle},{default:()=>R}):R,j=e.showArrow?gw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:P}):null;return[$,j]};N=i.h("div",i.mergeProps({class:[`${P}-popover`,`${P}-popover-shared`,m==null?void 0:m.themeClass.value,q.map(A=>`${P}-${A}`),{[`${P}-popover--scrollable`]:e.scrollable,[`${P}-popover--show-header-or-footer`]:M,[`${P}-popover--raw`]:e.raw,[`${P}-popover-shared--overlap`]:e.overlap,[`${P}-popover-shared--show-arrow`]:e.showArrow,[`${P}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:y,onMouseleave:b},n),U?i.h(Ob,{active:e.show,autoFocus:!0},{default:E}):E())}return i.withDirectives(N,p.value)}return{displayed:u,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:gn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(pd,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===gn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var _w={};const yw=Object.keys(wh),bw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function ww(e,t,n){bw[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[r],o=n[r];s?e.props[r]=(...a)=>{s(...a),o(...a)}:e.props[r]=o})}const vw={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:gn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},kw=Object.assign(Object.assign(Object.assign({},pt.props),vw),{internalOnAfterLeave:Function,internalRenderBody:Function}),xw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:kw,slots:Object,__popover__:!0,setup(e){_w.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&An("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&An("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&An("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&An("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&An("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=ss(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=wo(r,s),a=Lt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:A}=e;return!!(A!=null&&A())},c=()=>l()?!1:o.value,d=Uc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let u=null;const p=i.ref(null),f=i.ref(null),g=Lt(()=>e.x!==void 0&&e.y!==void 0);function m(A){const{"onUpdate:show":K,onUpdateShow:R,onShow:$,onHide:j}=e;s.value=A,K&&ft(K,A),R&&ft(R,A),A&&$&&ft($,!0),A&&j&&ft(j,!1)}function _(){u&&u.syncPosition()}function y(){const{value:A}=p;A&&(window.clearTimeout(A),p.value=null)}function b(){const{value:A}=f;A&&(window.clearTimeout(A),f.value=null)}function S(){const A=l();if(e.trigger==="focus"&&!A){if(c())return;m(!0)}}function x(){const A=l();if(e.trigger==="focus"&&!A){if(!c())return;m(!1)}}function C(){const A=l();if(e.trigger==="hover"&&!A){if(b(),p.value!==null||c())return;const K=()=>{m(!0),p.value=null},{delay:R}=e;R===0?K():p.value=window.setTimeout(K,R)}}function B(){const A=l();if(e.trigger==="hover"&&!A){if(y(),f.value!==null||!c())return;const K=()=>{m(!1),f.value=null},{duration:R}=e;R===0?K():f.value=window.setTimeout(K,R)}}function v(){B()}function N(A){var K;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(K=e.onClickoutside)===null||K===void 0||K.call(e,A))}function F(){if(e.trigger==="click"&&!l()){y(),b();const A=!c();m(A)}}function P(A){e.internalTrapFocus&&A.key==="Escape"&&(y(),b(),m(!1))}function q(A){s.value=A}function U(){var A;return(A=n.value)===null||A===void 0?void 0:A.targetRef}function M(A){u=A}return i.provide("NPopover",{getTriggerElement:U,handleKeydown:P,handleMouseEnter:C,handleMouseLeave:B,handleClickOutside:N,handleMouseMoveOutside:v,setBodyInstance:M,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:q,handleClick:F,handleMouseEnter:C,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=Yb(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};ww(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(Jc,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Yc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(Qc,null,{default:()=>r}),i.h(mw,Ub(this.$props,yw,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Cw={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function Sw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:p,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:C,heightTiny:B,heightSmall:v,heightMedium:N,closeColorHover:F,closeColorPressed:P,buttonColor2Hover:q,buttonColor2Pressed:U,fontWeightStrong:M}=e;return Object.assign(Object.assign({},Cw),{closeBorderRadius:_,heightTiny:C,heightSmall:B,heightMedium:v,heightLarge:N,borderRadius:_,opacityDisabled:u,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:M,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:q,colorPressedCheckable:U,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:F,closeColorPressed:P,borderPrimary:`1px solid ${Pe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Pe(s,{alpha:.12}),colorBorderedPrimary:Pe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Pe(s,{alpha:.12}),closeColorPressedPrimary:Pe(s,{alpha:.18}),borderInfo:`1px solid ${Pe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Pe(o,{alpha:.12}),colorBorderedInfo:Pe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Pe(o,{alpha:.12}),closeColorPressedInfo:Pe(o,{alpha:.18}),borderSuccess:`1px solid ${Pe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Pe(a,{alpha:.12}),colorBorderedSuccess:Pe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Pe(a,{alpha:.12}),closeColorPressedSuccess:Pe(a,{alpha:.18}),borderWarning:`1px solid ${Pe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Pe(l,{alpha:.15}),colorBorderedWarning:Pe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Pe(l,{alpha:.12}),closeColorPressedWarning:Pe(l,{alpha:.18}),borderError:`1px solid ${Pe(c,{alpha:.23})}`,textColorError:c,colorError:Pe(c,{alpha:.1}),colorBorderedError:Pe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Pe(c,{alpha:.12}),closeColorPressedError:Pe(c,{alpha:.18})})}const Bw={common:fi,self:Sw},Tw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Ew=ue("tag",`
544
+ `,[ue("popover-arrow",t)])])])}const vh=Object.assign(Object.assign({},pt.props),{to:gn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function bw({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,e],style:t}))}const ww=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vh,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=hi(e),a=pt("Popover","-popover",yw,wh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),u=i.ref(!1);i.watchEffect(()=>{const{show:k}=e;k&&!Ub()&&!e.internalDeactivateImmediately&&(u.value=!0)});const p=i.computed(()=>{const{trigger:k,onClickoutside:$}=e,P=[],{positionManuallyRef:{value:R}}=c;return R||(k==="click"&&!$&&P.push([rs,x,void 0,{capture:!0}]),k==="hover"&&P.push([Ty,S])),$&&P.push([rs,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&P.push([i.vShow,e.show]),P}),f=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:$,cubicBezierEaseOut:P},self:{space:R,spaceArrow:j,padding:Y,fontSize:A,textColor:E,dividerColor:M,color:K,boxShadow:F,borderRadius:N,arrowHeight:X,arrowOffset:z,arrowOffsetVertical:U}}=a.value;return{"--n-box-shadow":F,"--n-bezier":k,"--n-bezier-ease-in":$,"--n-bezier-ease-out":P,"--n-font-size":A,"--n-text-color":E,"--n-color":K,"--n-divider-color":M,"--n-border-radius":N,"--n-arrow-height":X,"--n-arrow-offset":z,"--n-arrow-offset-vertical":U,"--n-padding":Y,"--n-space":R,"--n-space-arrow":j}}),g=i.computed(()=>{const k=e.width==="trigger"?void 0:Mo(e.width),$=[];k&&$.push({width:k});const{maxWidth:P,minWidth:R}=e;return P&&$.push({maxWidth:Mo(P)}),R&&$.push({maxWidth:Mo(R)}),o||$.push(f.value),$}),m=o?ui("popover",void 0,f,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),k=>{e.animated||(k?h.value=!0:h.value=!1)});function _(){var k;(k=l.value)===null||k===void 0||k.syncPosition()}function y(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(k)}function b(k){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(k)}function S(k){e.trigger==="hover"&&!v().contains(or(k))&&c.handleMouseMoveOutside(k)}function x(k){(e.trigger==="click"&&!v().contains(or(k))||e.onClickoutside)&&c.handleClickOutside(k)}function v(){return c.getTriggerElement()}i.provide(Hd,d),i.provide(Ld,null),i.provide(Dd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let $;const P=c.internalRenderBodyRef.value,{value:R}=s;if(P)$=P([`${R}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${R}-popover-shared--overlap`,e.showArrow&&`${R}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${R}-popover-shared--center-arrow`],d,g.value,y,b);else{const{value:j}=c.extraClassRef,{internalTrapFocus:Y}=e,A=!th(t.header)||!th(t.footer),E=()=>{var M,K;const F=A?i.h(i.Fragment,null,ci(t.header,z=>z?i.h("div",{class:[`${R}-popover__header`,e.headerClass],style:e.headerStyle},z):null),ci(t.default,z=>z?i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t):null),ci(t.footer,z=>z?i.h("div",{class:[`${R}-popover__footer`,e.footerClass],style:e.footerStyle},z):null)):e.scrollable?(M=t.default)===null||M===void 0?void 0:M.call(t):i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t),N=e.scrollable?i.h(sw,{contentClass:A?void 0:`${R}-popover__content ${(K=e.contentClass)!==null&&K!==void 0?K:""}`,contentStyle:A?void 0:e.contentStyle},{default:()=>F}):F,X=e.showArrow?bw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:R}):null;return[N,X]};$=i.h("div",i.mergeProps({class:[`${R}-popover`,`${R}-popover-shared`,m==null?void 0:m.themeClass.value,j.map(M=>`${R}-${M}`),{[`${R}-popover--scrollable`]:e.scrollable,[`${R}-popover--show-header-or-footer`]:A,[`${R}-popover--raw`]:e.raw,[`${R}-popover-shared--overlap`]:e.overlap,[`${R}-popover-shared--show-arrow`]:e.showArrow,[`${R}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:y,onMouseleave:b},n),Y?i.h(Lb,{active:e.show,autoFocus:!0},{default:E}):E())}return i.withDirectives($,p.value)}return{displayed:u,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:gn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(gd,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===gn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var vw={};const kw=Object.keys(vh),xw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Cw(e,t,n){xw[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[r],o=n[r];s?e.props[r]=(...a)=>{s(...a),o(...a)}:e.props[r]=o})}const Sw={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:gn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Bw=Object.assign(Object.assign(Object.assign({},pt.props),Sw),{internalOnAfterLeave:Function,internalRenderBody:Function}),Tw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Bw,slots:Object,__popover__:!0,setup(e){vw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&An("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&An("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&An("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&An("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&An("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=ss(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=wo(r,s),a=Lt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:M}=e;return!!(M!=null&&M())},c=()=>l()?!1:o.value,d=Gc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let u=null;const p=i.ref(null),f=i.ref(null),g=Lt(()=>e.x!==void 0&&e.y!==void 0);function m(M){const{"onUpdate:show":K,onUpdateShow:F,onShow:N,onHide:X}=e;s.value=M,K&&ft(K,M),F&&ft(F,M),M&&N&&ft(N,!0),M&&X&&ft(X,!1)}function _(){u&&u.syncPosition()}function y(){const{value:M}=p;M&&(window.clearTimeout(M),p.value=null)}function b(){const{value:M}=f;M&&(window.clearTimeout(M),f.value=null)}function S(){const M=l();if(e.trigger==="focus"&&!M){if(c())return;m(!0)}}function x(){const M=l();if(e.trigger==="focus"&&!M){if(!c())return;m(!1)}}function v(){const M=l();if(e.trigger==="hover"&&!M){if(b(),p.value!==null||c())return;const K=()=>{m(!0),p.value=null},{delay:F}=e;F===0?K():p.value=window.setTimeout(K,F)}}function B(){const M=l();if(e.trigger==="hover"&&!M){if(y(),f.value!==null||!c())return;const K=()=>{m(!1),f.value=null},{duration:F}=e;F===0?K():f.value=window.setTimeout(K,F)}}function k(){B()}function $(M){var K;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(K=e.onClickoutside)===null||K===void 0||K.call(e,M))}function P(){if(e.trigger==="click"&&!l()){y(),b();const M=!c();m(M)}}function R(M){e.internalTrapFocus&&M.key==="Escape"&&(y(),b(),m(!1))}function j(M){s.value=M}function Y(){var M;return(M=n.value)===null||M===void 0?void 0:M.targetRef}function A(M){u=M}return i.provide("NPopover",{getTriggerElement:Y,handleKeydown:R,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:$,handleMouseMoveOutside:k,setBodyInstance:A,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:j,handleClick:P,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=Zb(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};Cw(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(Qc,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Uc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(ed,null,{default:()=>r}),i.h(ww,Jb(this.$props,kw,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Ew={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function $w(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:p,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:$,closeColorHover:P,closeColorPressed:R,buttonColor2Hover:j,buttonColor2Pressed:Y,fontWeightStrong:A}=e;return Object.assign(Object.assign({},Ew),{closeBorderRadius:_,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:$,borderRadius:_,opacityDisabled:u,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:A,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:Y,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:P,closeColorPressed:R,borderPrimary:`1px solid ${Pe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Pe(s,{alpha:.12}),colorBorderedPrimary:Pe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Pe(s,{alpha:.12}),closeColorPressedPrimary:Pe(s,{alpha:.18}),borderInfo:`1px solid ${Pe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Pe(o,{alpha:.12}),colorBorderedInfo:Pe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Pe(o,{alpha:.12}),closeColorPressedInfo:Pe(o,{alpha:.18}),borderSuccess:`1px solid ${Pe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Pe(a,{alpha:.12}),colorBorderedSuccess:Pe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Pe(a,{alpha:.12}),closeColorPressedSuccess:Pe(a,{alpha:.18}),borderWarning:`1px solid ${Pe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Pe(l,{alpha:.15}),colorBorderedWarning:Pe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Pe(l,{alpha:.12}),closeColorPressedWarning:Pe(l,{alpha:.18}),borderError:`1px solid ${Pe(c,{alpha:.23})}`,textColorError:c,colorError:Pe(c,{alpha:.1}),colorBorderedError:Pe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Pe(c,{alpha:.12}),closeColorPressedError:Pe(c,{alpha:.18})})}const Nw={common:fi,self:$w},Rw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Pw=ue("tag",`
545
545
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
546
546
  white-space: nowrap;
547
547
  position: relative;
@@ -611,7 +611,7 @@ ${s}
611
611
  `,[Xt("disabled",[oe("&:hover","background-color: var(--n-color-hover-checkable);",[Xt("checked","color: var(--n-text-color-hover-checkable);")]),oe("&:active","background-color: var(--n-color-pressed-checkable);",[Xt("checked","color: var(--n-text-color-pressed-checkable);")])]),Be("checked",`
612
612
  color: var(--n-text-color-checked);
613
613
  background-color: var(--n-color-checked);
614
- `,[Xt("disabled",[oe("&:hover","background-color: var(--n-color-checked-hover);"),oe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var $w={};const Nw=Object.assign(Object.assign(Object.assign({},pt.props),Tw),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),Rw="n-tag",jo=i.defineComponent({name:"Tag",props:Nw,slots:Object,setup(e){$w.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&An("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const t=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=hi(e),a=pt("Tag","-tag",Ew,Bw,e,r);i.provide(Rw,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":_}=e;m&&m(!f),_&&_(!f),g&&g(!f)}}function c(f){if(e.triggerClickOnClose||f.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&ft(g,f)}}const d={setTextContent(f){const{value:g}=t;g&&(g.textContent=f)}},h=_s("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:m,textColor:_}={}}=e,{common:{cubicBezierEaseInOut:y},self:{padding:b,closeMargin:S,borderRadius:x,opacityDisabled:C,textColorCheckable:B,textColorHoverCheckable:v,textColorPressedCheckable:N,textColorChecked:F,colorCheckable:P,colorHoverCheckable:q,colorPressedCheckable:U,colorChecked:M,colorCheckedHover:E,colorCheckedPressed:A,closeBorderRadius:K,fontWeightStrong:R,[Xe("colorBordered",f)]:$,[Xe("closeSize",g)]:j,[Xe("closeIconSize",g)]:z,[Xe("fontSize",g)]:Y,[Xe("height",g)]:I,[Xe("color",f)]:V,[Xe("textColor",f)]:J,[Xe("border",f)]:pe,[Xe("closeIconColor",f)]:ie,[Xe("closeIconColorHover",f)]:ge,[Xe("closeIconColorPressed",f)]:re,[Xe("closeColorHover",f)]:Me,[Xe("closeColorPressed",f)]:Fe}}=a.value,Ge=jt(S);return{"--n-font-weight-strong":R,"--n-avatar-size-override":`calc(${I} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":pe,"--n-close-icon-size":z,"--n-close-color-pressed":Fe,"--n-close-color-hover":Me,"--n-close-border-radius":K,"--n-close-icon-color":ie,"--n-close-icon-color-hover":ge,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Ge.top,"--n-close-margin-right":Ge.right,"--n-close-margin-bottom":Ge.bottom,"--n-close-margin-left":Ge.left,"--n-close-size":j,"--n-color":m||(n.value?$:V),"--n-color-checkable":P,"--n-color-checked":M,"--n-color-checked-hover":E,"--n-color-checked-pressed":A,"--n-color-hover-checkable":q,"--n-color-pressed-checkable":U,"--n-font-size":Y,"--n-height":I,"--n-opacity-disabled":C,"--n-padding":b,"--n-text-color":_||J,"--n-text-color-checkable":B,"--n-text-color-checked":F,"--n-text-color-hover-checkable":v,"--n-text-color-pressed-checkable":N}}),p=s?ui("tag",i.computed(()=>{let f="";const{type:g,size:m,color:{color:_,textColor:y}={}}=e;return f+=g[0],f+=m[0],_&&(f+=`a${jd(_)}`),y&&(f+=`b${jd(y)}`),n.value&&(f+="c"),f}),u,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:t,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:u,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=ci(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=ci(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?i.h(j1,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),Pw=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:n}=e;return i.h(oh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(H1,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(yr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Vo(t.default,()=>[i.h(O1,null)])})}):null})}}}),Fw={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Mw(e){const{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:p,iconColor:f,iconColorDisabled:g,clearColor:m,clearColorHover:_,clearColorPressed:y,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:B,fontSizeLarge:v,heightTiny:N,heightSmall:F,heightMedium:P,heightLarge:q,fontWeight:U}=e;return Object.assign(Object.assign({},Fw),{fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:B,fontSizeLarge:v,heightTiny:N,heightSmall:F,heightMedium:P,heightLarge:q,borderRadius:t,fontWeight:U,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Pe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Pe(a,{alpha:.2})}`,caretColor:a,arrowColor:f,arrowColorDisabled:g,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:m,clearColorHover:_,clearColorPressed:y})}const vh={name:"InternalSelection",common:fi,peers:{Popover:bh},self:Mw},Aw=oe([ue("base-selection",`
614
+ `,[Xt("disabled",[oe("&:hover","background-color: var(--n-color-checked-hover);"),oe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Fw={};const Mw=Object.assign(Object.assign(Object.assign({},pt.props),Rw),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),Aw="n-tag",jo=i.defineComponent({name:"Tag",props:Mw,slots:Object,setup(e){Fw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&An("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const t=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=hi(e),a=pt("Tag","-tag",Pw,Nw,e,r);i.provide(Aw,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":_}=e;m&&m(!f),_&&_(!f),g&&g(!f)}}function c(f){if(e.triggerClickOnClose||f.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&ft(g,f)}}const d={setTextContent(f){const{value:g}=t;g&&(g.textContent=f)}},h=_s("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:m,textColor:_}={}}=e,{common:{cubicBezierEaseInOut:y},self:{padding:b,closeMargin:S,borderRadius:x,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:$,textColorChecked:P,colorCheckable:R,colorHoverCheckable:j,colorPressedCheckable:Y,colorChecked:A,colorCheckedHover:E,colorCheckedPressed:M,closeBorderRadius:K,fontWeightStrong:F,[Xe("colorBordered",f)]:N,[Xe("closeSize",g)]:X,[Xe("closeIconSize",g)]:z,[Xe("fontSize",g)]:U,[Xe("height",g)]:O,[Xe("color",f)]:I,[Xe("textColor",f)]:J,[Xe("border",f)]:pe,[Xe("closeIconColor",f)]:ie,[Xe("closeIconColorHover",f)]:ge,[Xe("closeIconColorPressed",f)]:re,[Xe("closeColorHover",f)]:Me,[Xe("closeColorPressed",f)]:Fe}}=a.value,Ge=jt(S);return{"--n-font-weight-strong":F,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":pe,"--n-close-icon-size":z,"--n-close-color-pressed":Fe,"--n-close-color-hover":Me,"--n-close-border-radius":K,"--n-close-icon-color":ie,"--n-close-icon-color-hover":ge,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Ge.top,"--n-close-margin-right":Ge.right,"--n-close-margin-bottom":Ge.bottom,"--n-close-margin-left":Ge.left,"--n-close-size":X,"--n-color":m||(n.value?N:I),"--n-color-checkable":R,"--n-color-checked":A,"--n-color-checked-hover":E,"--n-color-checked-pressed":M,"--n-color-hover-checkable":j,"--n-color-pressed-checkable":Y,"--n-font-size":U,"--n-height":O,"--n-opacity-disabled":v,"--n-padding":b,"--n-text-color":_||J,"--n-text-color-checkable":B,"--n-text-color-checked":P,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":$}}),p=s?ui("tag",i.computed(()=>{let f="";const{type:g,size:m,color:{color:_,textColor:y}={}}=e;return f+=g[0],f+=m[0],_&&(f+=`a${Xd(_)}`),y&&(f+=`b${Xd(y)}`),n.value&&(f+="c"),f}),u,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:t,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:u,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=ci(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=ci(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?i.h(U1,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),Vw=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:n}=e;return i.h(ah,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(q1,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(yr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Io(t.default,()=>[i.h(L1,null)])})}):null})}}}),Ow={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Iw(e){const{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:p,iconColor:f,iconColorDisabled:g,clearColor:m,clearColorHover:_,clearColorPressed:y,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:$,heightSmall:P,heightMedium:R,heightLarge:j,fontWeight:Y}=e;return Object.assign(Object.assign({},Ow),{fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:$,heightSmall:P,heightMedium:R,heightLarge:j,borderRadius:t,fontWeight:Y,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Pe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Pe(a,{alpha:.2})}`,caretColor:a,arrowColor:f,arrowColorDisabled:g,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:m,clearColorHover:_,clearColorPressed:y})}const kh={name:"InternalSelection",common:fi,peers:{Popover:wh},self:Iw},zw=oe([ue("base-selection",`
615
615
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
616
616
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
617
617
  position: relative;
@@ -811,7 +811,7 @@ ${s}
811
811
  line-height: 1.25;
812
812
  text-overflow: ellipsis;
813
813
  overflow: hidden;
814
- `)])])]),Ow=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=hi(e),r=_s("InternalSelection",n,t),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),p=i.ref(null),f=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=pt("InternalSelection","-internal-selection",Aw,vh,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(_.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):zi(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const te=e.selectedOption;if(te)return te[e.labelField]}),C=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var te;const{value:ne}=s;if(ne){const{value:We}=o;We&&(We.style.width=`${ne.offsetWidth}px`,e.maxTagCount!=="responsive"&&((te=p.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function v(){const{value:te}=f;te&&(te.style.display="none")}function N(){const{value:te}=f;te&&(te.style.display="inline-block")}i.watch(i.toRef(e,"active"),te=>{te||v()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function F(te){const{onFocus:ne}=e;ne&&ne(te)}function P(te){const{onBlur:ne}=e;ne&&ne(te)}function q(te){const{onDeleteOption:ne}=e;ne&&ne(te)}function U(te){const{onClear:ne}=e;ne&&ne(te)}function M(te){const{onPatternInput:ne}=e;ne&&ne(te)}function E(te){var ne;(!te.relatedTarget||!(!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)))&&F(te)}function A(te){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)||P(te)}function K(te){U(te)}function R(){_.value=!0}function $(){_.value=!1}function j(te){!e.active||!e.filterable||te.target!==o.value&&te.preventDefault()}function z(te){q(te)}const Y=i.ref(!1);function I(te){if(te.key==="Backspace"&&!Y.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&z(ne[ne.length-1])}}let V=null;function J(te){const{value:ne}=s;if(ne){const We=te.target.value;ne.textContent=We,B()}e.ignoreComposition&&Y.value?V=te:M(te)}function pe(){Y.value=!0}function ie(){Y.value=!1,e.ignoreComposition&&M(V),V=null}function ge(te){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,te)}function re(te){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,te)}function Me(){var te,ne;if(e.filterable)m.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ne=o.value)===null||ne===void 0||ne.blur();else if(e.multiple){const{value:We}=l;We==null||We.blur()}else{const{value:We}=c;We==null||We.blur()}}function Fe(){var te,ne,We;e.filterable?(m.value=!1,(te=d.value)===null||te===void 0||te.focus()):e.multiple?(ne=l.value)===null||ne===void 0||ne.focus():(We=c.value)===null||We===void 0||We.focus()}function Ge(){const{value:te}=o;te&&(N(),te.focus())}function xe(){const{value:te}=o;te&&te.blur()}function Se(te){const{value:ne}=h;ne&&ne.setTextContent(`+${te}`)}function st(){const{value:te}=u;return te}function Ke(){return o.value}let nt=null;function Yt(){nt!==null&&window.clearTimeout(nt)}function $t(){e.active||(Yt(),nt=window.setTimeout(()=>{C.value&&(g.value=!0)},100))}function mi(){Yt()}function _i(te){te||(Yt(),g.value=!1)}i.watch(C,te=>{te||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(e.disabled?te.removeAttribute("tabindex"):te.tabIndex=m.value?-1:0)})}),Wd(a,e.onResize);const{inlineThemeDisabled:In}=e,ln=i.computed(()=>{const{size:te}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:We,borderRadius:wr,color:Li,placeholderColor:yi,textColor:Di,paddingSingle:Vn,paddingMultiple:bi,caretColor:Hi,colorDisabled:Ut,textColorDisabled:Cn,placeholderColorDisabled:T,colorActive:L,boxShadowFocus:Q,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:je,arrowColor:cn,arrowColorDisabled:Uo,loadingColor:Go,colorActiveWarning:Ko,boxShadowFocusWarning:Zo,boxShadowActiveWarning:Jo,boxShadowHoverWarning:Qo,borderWarning:ea,borderFocusWarning:ta,borderHoverWarning:na,borderActiveWarning:ia,colorActiveError:ra,boxShadowFocusError:sa,boxShadowActiveError:oa,boxShadowHoverError:aa,borderError:la,borderFocusError:ca,borderHoverError:da,borderActiveError:xk,clearColor:Ck,clearColorHover:Sk,clearColorPressed:Bk,clearSize:Tk,arrowSize:Ek,[Xe("height",te)]:$k,[Xe("fontSize",te)]:Nk}}=y.value,ks=jt(Vn),xs=jt(bi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":je,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":wr,"--n-box-shadow-active":le,"--n-box-shadow-focus":Q,"--n-box-shadow-hover":ce,"--n-caret-color":Hi,"--n-color":Li,"--n-color-active":L,"--n-color-disabled":Ut,"--n-font-size":Nk,"--n-height":$k,"--n-padding-single-top":ks.top,"--n-padding-multiple-top":xs.top,"--n-padding-single-right":ks.right,"--n-padding-multiple-right":xs.right,"--n-padding-single-left":ks.left,"--n-padding-multiple-left":xs.left,"--n-padding-single-bottom":ks.bottom,"--n-padding-multiple-bottom":xs.bottom,"--n-placeholder-color":yi,"--n-placeholder-color-disabled":T,"--n-text-color":Di,"--n-text-color-disabled":Cn,"--n-arrow-color":cn,"--n-arrow-color-disabled":Uo,"--n-loading-color":Go,"--n-color-active-warning":Ko,"--n-box-shadow-focus-warning":Zo,"--n-box-shadow-active-warning":Jo,"--n-box-shadow-hover-warning":Qo,"--n-border-warning":ea,"--n-border-focus-warning":ta,"--n-border-hover-warning":na,"--n-border-active-warning":ia,"--n-color-active-error":ra,"--n-box-shadow-focus-error":sa,"--n-box-shadow-active-error":oa,"--n-box-shadow-hover-error":aa,"--n-border-error":la,"--n-border-focus-error":ca,"--n-border-hover-error":da,"--n-border-active-error":xk,"--n-clear-size":Tk,"--n-clear-color":Ck,"--n-clear-color-hover":Sk,"--n-clear-color-pressed":Bk,"--n-arrow-size":Ek,"--n-font-weight":We}}),lt=In?ui("internal-selection",i.computed(()=>e.size[0]),ln,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:C,showTagsPanel:g,isComposing:Y,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:f,handleMouseDown:j,handleFocusin:E,handleClear:K,handleMouseEnter:R,handleMouseLeave:$,handleDeleteOption:z,handlePatternKeyDown:I,handlePatternInputInput:J,handlePatternInputBlur:re,handlePatternInputFocus:ge,handleMouseEnterCounter:$t,handleMouseLeaveCounter:mi,handleFocusout:A,handleCompositionEnd:ie,handleCompositionStart:pe,onPopoverUpdateShow:_i,focus:Fe,focusInput:Ge,blur:Me,blurInput:xe,updateCounter:Se,getCounter:st,getTail:Ke,renderLabel:e.renderLabel,cssVars:In?void 0:ln,themeClass:lt==null?void 0:lt.themeClass,onRender:lt==null?void 0:lt.onRender}},render(){const{status:e,multiple:t,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const p=o==="responsive",f=typeof o=="number",g=p||f,m=i.h(zo,null,{default:()=>i.h(Pw,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,b;return(b=(y=this.$slots).arrow)===null||b===void 0?void 0:b.call(y)}})});let _;if(t){const{labelField:y}=this,b=M=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:M.value},h?h({option:M,handleClose:()=>{this.handleDeleteOption(M)}}):i.h(jo,{size:n,closable:!M.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(M)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(M,!0):zi(M[y],M,!0)})),S=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),x=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,C=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const M=this.selectedOptions.length-o;M>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${M}`})))}const v=p?s?i.h(Fd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C,tail:()=>x}):i.h(Fd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C}):f&&B?S().concat(B):S(),N=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,F=g?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,q=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,U=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},v,p?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},v,m);_=i.h(i.Fragment,null,g?i.h(xw,Object.assign({},F,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>U,default:N}):U,q)}else if(s){const y=this.pattern||this.isComposing,b=this.active?!y:!this.selected,S=this.active?!1:this.selected;_=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Kd(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):zi(this.label,this.selectedOption,!0))):null,b?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else _=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Kd(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):zi(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},_,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Iw(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Vw={name:"Select",common:fi,peers:{InternalSelection:vh,InternalSelectMenu:fh},self:Iw},zw=oe([ue("select",`
814
+ `)])])]),Lw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=hi(e),r=_s("InternalSelection",n,t),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),p=i.ref(null),f=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=pt("InternalSelection","-internal-selection",zw,kh,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(_.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):zi(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const te=e.selectedOption;if(te)return te[e.labelField]}),v=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var te;const{value:ne}=s;if(ne){const{value:We}=o;We&&(We.style.width=`${ne.offsetWidth}px`,e.maxTagCount!=="responsive"&&((te=p.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:te}=f;te&&(te.style.display="none")}function $(){const{value:te}=f;te&&(te.style.display="inline-block")}i.watch(i.toRef(e,"active"),te=>{te||k()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function P(te){const{onFocus:ne}=e;ne&&ne(te)}function R(te){const{onBlur:ne}=e;ne&&ne(te)}function j(te){const{onDeleteOption:ne}=e;ne&&ne(te)}function Y(te){const{onClear:ne}=e;ne&&ne(te)}function A(te){const{onPatternInput:ne}=e;ne&&ne(te)}function E(te){var ne;(!te.relatedTarget||!(!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)))&&P(te)}function M(te){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)||R(te)}function K(te){Y(te)}function F(){_.value=!0}function N(){_.value=!1}function X(te){!e.active||!e.filterable||te.target!==o.value&&te.preventDefault()}function z(te){j(te)}const U=i.ref(!1);function O(te){if(te.key==="Backspace"&&!U.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&z(ne[ne.length-1])}}let I=null;function J(te){const{value:ne}=s;if(ne){const We=te.target.value;ne.textContent=We,B()}e.ignoreComposition&&U.value?I=te:A(te)}function pe(){U.value=!0}function ie(){U.value=!1,e.ignoreComposition&&A(I),I=null}function ge(te){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,te)}function re(te){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,te)}function Me(){var te,ne;if(e.filterable)m.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ne=o.value)===null||ne===void 0||ne.blur();else if(e.multiple){const{value:We}=l;We==null||We.blur()}else{const{value:We}=c;We==null||We.blur()}}function Fe(){var te,ne,We;e.filterable?(m.value=!1,(te=d.value)===null||te===void 0||te.focus()):e.multiple?(ne=l.value)===null||ne===void 0||ne.focus():(We=c.value)===null||We===void 0||We.focus()}function Ge(){const{value:te}=o;te&&($(),te.focus())}function xe(){const{value:te}=o;te&&te.blur()}function Se(te){const{value:ne}=h;ne&&ne.setTextContent(`+${te}`)}function st(){const{value:te}=u;return te}function Ke(){return o.value}let nt=null;function Yt(){nt!==null&&window.clearTimeout(nt)}function $t(){e.active||(Yt(),nt=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function mi(){Yt()}function _i(te){te||(Yt(),g.value=!1)}i.watch(v,te=>{te||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(e.disabled?te.removeAttribute("tabindex"):te.tabIndex=m.value?-1:0)})}),jd(a,e.onResize);const{inlineThemeDisabled:On}=e,ln=i.computed(()=>{const{size:te}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:We,borderRadius:wr,color:Li,placeholderColor:yi,textColor:Di,paddingSingle:In,paddingMultiple:bi,caretColor:Hi,colorDisabled:Ut,textColorDisabled:Cn,placeholderColorDisabled:T,colorActive:L,boxShadowFocus:Q,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:je,arrowColor:cn,arrowColorDisabled:Uo,loadingColor:Go,colorActiveWarning:Ko,boxShadowFocusWarning:Zo,boxShadowActiveWarning:Jo,boxShadowHoverWarning:Qo,borderWarning:ea,borderFocusWarning:ta,borderHoverWarning:na,borderActiveWarning:ia,colorActiveError:ra,boxShadowFocusError:sa,boxShadowActiveError:oa,boxShadowHoverError:aa,borderError:la,borderFocusError:ca,borderHoverError:da,borderActiveError:Sk,clearColor:Bk,clearColorHover:Tk,clearColorPressed:Ek,clearSize:$k,arrowSize:Nk,[Xe("height",te)]:Rk,[Xe("fontSize",te)]:Pk}}=y.value,ks=jt(In),xs=jt(bi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":je,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":wr,"--n-box-shadow-active":le,"--n-box-shadow-focus":Q,"--n-box-shadow-hover":ce,"--n-caret-color":Hi,"--n-color":Li,"--n-color-active":L,"--n-color-disabled":Ut,"--n-font-size":Pk,"--n-height":Rk,"--n-padding-single-top":ks.top,"--n-padding-multiple-top":xs.top,"--n-padding-single-right":ks.right,"--n-padding-multiple-right":xs.right,"--n-padding-single-left":ks.left,"--n-padding-multiple-left":xs.left,"--n-padding-single-bottom":ks.bottom,"--n-padding-multiple-bottom":xs.bottom,"--n-placeholder-color":yi,"--n-placeholder-color-disabled":T,"--n-text-color":Di,"--n-text-color-disabled":Cn,"--n-arrow-color":cn,"--n-arrow-color-disabled":Uo,"--n-loading-color":Go,"--n-color-active-warning":Ko,"--n-box-shadow-focus-warning":Zo,"--n-box-shadow-active-warning":Jo,"--n-box-shadow-hover-warning":Qo,"--n-border-warning":ea,"--n-border-focus-warning":ta,"--n-border-hover-warning":na,"--n-border-active-warning":ia,"--n-color-active-error":ra,"--n-box-shadow-focus-error":sa,"--n-box-shadow-active-error":oa,"--n-box-shadow-hover-error":aa,"--n-border-error":la,"--n-border-focus-error":ca,"--n-border-hover-error":da,"--n-border-active-error":Sk,"--n-clear-size":$k,"--n-clear-color":Bk,"--n-clear-color-hover":Tk,"--n-clear-color-pressed":Ek,"--n-arrow-size":Nk,"--n-font-weight":We}}),lt=On?ui("internal-selection",i.computed(()=>e.size[0]),ln,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:v,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:f,handleMouseDown:X,handleFocusin:E,handleClear:K,handleMouseEnter:F,handleMouseLeave:N,handleDeleteOption:z,handlePatternKeyDown:O,handlePatternInputInput:J,handlePatternInputBlur:re,handlePatternInputFocus:ge,handleMouseEnterCounter:$t,handleMouseLeaveCounter:mi,handleFocusout:M,handleCompositionEnd:ie,handleCompositionStart:pe,onPopoverUpdateShow:_i,focus:Fe,focusInput:Ge,blur:Me,blurInput:xe,updateCounter:Se,getCounter:st,getTail:Ke,renderLabel:e.renderLabel,cssVars:On?void 0:ln,themeClass:lt==null?void 0:lt.themeClass,onRender:lt==null?void 0:lt.onRender}},render(){const{status:e,multiple:t,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const p=o==="responsive",f=typeof o=="number",g=p||f,m=i.h(zo,null,{default:()=>i.h(Vw,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,b;return(b=(y=this.$slots).arrow)===null||b===void 0?void 0:b.call(y)}})});let _;if(t){const{labelField:y}=this,b=A=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:A.value},h?h({option:A,handleClose:()=>{this.handleDeleteOption(A)}}):i.h(jo,{size:n,closable:!A.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(A)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(A,!0):zi(A[y],A,!0)})),S=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),x=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,v=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const A=this.selectedOptions.length-o;A>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${A}`})))}const k=p?s?i.h(Md,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>x}):i.h(Md,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):f&&B?S().concat(B):S(),$=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,P=g?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,j=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,Y=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,p?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,m);_=i.h(i.Fragment,null,g?i.h(Tw,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>Y,default:$}):Y,j)}else if(s){const y=this.pattern||this.isComposing,b=this.active?!y:!this.selected,S=this.active?!1:this.selected;_=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Zd(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):zi(this.label,this.selectedOption,!0))):null,b?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else _=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Zd(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):zi(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},_,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Dw(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Hw={name:"Select",common:fi,peers:{InternalSelection:kh,InternalSelectMenu:ph},self:Dw},Ww=oe([ue("select",`
815
815
  z-index: auto;
816
816
  outline: none;
817
817
  width: 100%;
@@ -820,5 +820,5 @@ ${s}
820
820
  `),ue("select-menu",`
821
821
  margin: 4px 0;
822
822
  box-shadow: var(--n-menu-box-shadow);
823
- `,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function bs(e){return e.type==="group"}function kh(e){return e.type==="ignored"}function Xo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Lw(e,t){return{getIsGroup:bs,getIgnored:kh,getKey(r){return bs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Dw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(kh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Hw(e,t,n){const r=new Map;return e.forEach(s=>{bs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Ww={};const jw=Object.assign(Object.assign({},pt.props),{to:gn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Xw=i.defineComponent({name:"Select",props:jw,slots:Object,setup(e){Ww.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&An("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&An("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=hi(e),o=pt("Select","-select",zw,Vw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=wo(l,a),d=i.ref(!1),h=i.ref(""),u=Uc(e,["items","options"]),p=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(p.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:L,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[L];if(typeof me=="string")return Xo(le,me);const be=ce[Q];return typeof be=="string"?Xo(le,be):typeof be=="number"?Xo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:L}=h;return!L.length||!e.filterable?T:Dw(T,m.value,L,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:L}=e,Q=Lw(T,L);return _y(_.value,Q)}),b=i.computed(()=>Hw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=wo(i.toRef(e,"show"),S),C=i.ref(null),B=i.ref(null),v=i.ref(null),{localeRef:N}=nh("Select"),F=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:N.value.placeholder}),P=[],q=i.ref(new Map),U=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:L,valueField:Q}=e;return le=>({[L]:String(le),[Q]:le})}return T===!1?!1:L=>Object.assign(T(L),{value:L})});function M(T){const L=e.remote,{value:Q}=q,{value:le}=b,{value:ce}=U,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(L&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const E=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?M(T):[]}return null}),A=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:M([T])[0]||null:null}),K=Kb(e),{mergedSizeRef:R,mergedDisabledRef:$,mergedStatusRef:j}=K;function z(T,L){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=K;Q&&ft(Q,T,L),ce&&ft(ce,T,L),le&&ft(le,T,L),a.value=T,me(),be()}function Y(T){const{onBlur:L}=e,{nTriggerFormBlur:Q}=K;L&&ft(L,T),Q()}function I(){const{onClear:T}=e;T&&ft(T)}function V(T){const{onFocus:L,showOnFocus:Q}=e,{nTriggerFormFocus:le}=K;L&&ft(L,T),le(),Q&&re()}function J(T){const{onSearch:L}=e;L&&ft(L,T)}function pe(T){const{onScroll:L}=e;L&&ft(L,T)}function ie(){var T;const{remote:L,multiple:Q}=e;if(L){const{value:le}=q;if(Q){const{valueField:ce}=e;(T=E.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=A.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:L,"onUpdate:show":Q}=e;L&&ft(L,T),Q&&ft(Q,T),S.value=T}function re(){$.value||(ge(!0),S.value=!0,e.filterable&&Vn())}function Me(){ge(!1)}function Fe(){h.value="",f.value=P}const Ge=i.ref(!1);function xe(){e.filterable&&(Ge.value=!0)}function Se(){e.filterable&&(Ge.value=!1,x.value||Fe())}function st(){$.value||(x.value?e.filterable?Vn():Me():re())}function Ke(T){var L,Q;!((Q=(L=v.value)===null||L===void 0?void 0:L.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,Y(T),Me())}function nt(T){V(T),d.value=!0}function Yt(){d.value=!0}function $t(T){var L;!((L=C.value)===null||L===void 0)&&L.$el.contains(T.relatedTarget)||(d.value=!1,Y(T),Me())}function mi(){var T;(T=C.value)===null||T===void 0||T.focus(),Me()}function _i(T){var L;x.value&&(!((L=C.value)===null||L===void 0)&&L.$el.contains(or(T))||Me())}function In(T){if(!Array.isArray(T))return[];if(U.value)return Array.from(T);{const{remote:L}=e,{value:Q}=b;if(L){const{value:le}=q;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function ln(T){lt(T.rawNode)}function lt(T){if($.value)return;const{tag:L,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(L&&!Q){const{value:me}=f,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],f.value=P}}if(Q&&q.value.set(T[ce],T),e.multiple){const me=In(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),L&&!Q){const ke=te(T[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");z(me,M(me))}else{if(L&&!Q){const me=te(T[ce]);~me?p.value=[p.value[me]]:p.value=P}Di(),Me(),z(T[ce],T)}}function te(T){return p.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){x.value||re();const{value:L}=T.target;h.value=L;const{tag:Q,remote:le}=e;if(J(L),Q&&!le){if(!L){f.value=P;return}const{onCreate:ce}=e,me=ce?ce(L):{[e.labelField]:L,[e.valueField]:L},{valueField:be,labelField:ke}=e;u.value.some(je=>je[be]===me[be]||je[ke]===me[ke])||p.value.some(je=>je[be]===me[be]||je[ke]===me[ke])?f.value=P:f.value=[me]}}function We(T){T.stopPropagation();const{multiple:L}=e;!L&&e.filterable&&Me(),I(),L?z([],[]):z(null,null)}function wr(T){!sr(T,"action")&&!sr(T,"empty")&&!sr(T,"header")&&T.preventDefault()}function Li(T){pe(T)}function yi(T){var L,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((L=C.value)===null||L===void 0)&&L.isComposing)){if(x.value){const be=(Q=v.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?ln(be):e.filterable||(Me(),Di())}else if(re(),e.tag&&Ge.value){const be=f.value[0];if(be){const ke=be[e.valueField],{value:je}=c;e.multiple&&Array.isArray(je)&&je.includes(ke)||lt(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=v.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=v.value)===null||ce===void 0||ce.next():re();break;case"Escape":x.value&&(qb(T),Me()),(me=C.value)===null||me===void 0||me.focus();break}}function Di(){var T;(T=C.value)===null||T===void 0||T.focus()}function Vn(){var T;(T=C.value)===null||T===void 0||T.focusInput()}function bi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}ie(),i.watch(i.toRef(e,"options"),ie);const Hi={focus:()=>{var T;(T=C.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=C.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=C.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=C.value)===null||T===void 0||T.blurInput()}},Ut=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Cn=s?ui("select",void 0,Ut,e):void 0;return Object.assign(Object.assign({},Hi),{mergedStatus:j,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:ss(),triggerRef:C,menuRef:v,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:gn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:F,selectedOption:A,selectedOptions:E,mergedSize:R,mergedDisabled:$,focused:d,activeWithoutMenuOpen:Ge,inlineThemeDisabled:s,onTriggerInputFocus:xe,onTriggerInputBlur:Se,handleTriggerOrMenuResize:bi,handleMenuFocus:Yt,handleMenuBlur:$t,handleMenuTabOut:mi,handleTriggerClick:st,handleToggle:ln,handleDeleteOption:lt,handlePatternInput:ne,handleClear:We,handleTriggerBlur:Ke,handleTriggerFocus:nt,handleKeydown:yi,handleMenuAfterLeave:Fe,handleMenuClickOutside:_i,handleMenuScroll:Li,handleMenuKeydown:yi,handleMenuMousedown:wr,mergedTheme:o,cssVars:s?void 0:Ut,themeClass:Cn==null?void 0:Cn.themeClass,onRender:Cn==null?void 0:Cn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Jc,null,{default:()=>[i.h(Qc,null,{default:()=>i.h(Ow,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(pd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===gn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(hw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[rs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[rs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),qw={},xh=i.defineComponent({...qw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>W.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>H.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(H.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],C=S.filter(B=>!x.some(v=>v.id===B.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let p="";const f=H.debounce(()=>u(p),800),g=b=>{p=b,f()},m=b=>{var S;if(H.isArray(b)){const x=b.length>0?b.map(C=>{var B;return i.toRaw((B=l.value.find(v=>v.value===C))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(C=>C.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(Xw),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Yw={},Ch=i.defineComponent({...Yw,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>W.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?W.HttpRequester.getInstance(W.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?W.HttpRequester.getInstance(W.ProductDataProvider).publicSimpleSearch(u):new Promise(p=>{p([])}),l=u=>r.searchType==="categories"?Ot.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?Ot.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(u,p)=>{if(r.renderLabel)return r.renderLabel(u,p);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,p)=>(i.openBlock(),i.createBlock(xh,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":p[0]||(p[0]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Uw={class:"col-span-2 flex flex-row gap-2.5"},Gw={class:"flex-1"},Kw={class:"text-sc-grey"},Zw={class:"ml-2.5"},Jw={key:0,class:"flex-none"},Qw={},ev=i.defineComponent({...Qw,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>W.AppConfigProvider.getConfig().minSearchTermLength},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(H.isArray(u)?u:[u]).filter(p=>!a.value.some(f=>f.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(p=>p.id===u.id?u:i.toRaw(p)),l())},h=u=>{a.value=a.value.filter(p=>p.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,p)=>{const f=O.NListItem,g=$_,m=O.NButton,_=O.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ch,{value:s.value,"onUpdate:value":[p[0]||(p[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(f,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ")])),_:1,__:[1]})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(f,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Uw,[i.createElementVNode("span",Gw,[i.createElementVNode("span",Kw,i.toDisplayString(y.code),1),i.createElementVNode("span",Zw,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Jw,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),tv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nv(e,t){return i.openBlock(),i.createElementBlock("svg",tv,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)]))}const iv=i.markRaw({name:"tabler-truck-filled",render:nv}),rv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sv(e,t){return i.openBlock(),i.createElementBlock("svg",rv,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)]))}const ov=i.markRaw({name:"tabler-truck-delivery",render:sv}),av={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lv(e,t){return i.openBlock(),i.createElementBlock("svg",av,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)]))}const cv=i.markRaw({name:"tabler-truck-loading",render:lv}),dv={class:"flex flex-col gap-1"},hv={key:0,class:"flex flex-row gap-1 text-base"},uv={key:1,class:"text-sc-dark-grey text-sm"},fv={class:"text-sc-grey mr-1.5"},pv={key:0},gv={key:1},mv={key:2},_v={},ws=i.defineComponent({..._v,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=W.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Sn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,p,f,g,m,_;const a=cv,l=ov,c=iv;return i.openBlock(),i.createElementBlock("div",dv,[s.showType?(i.openBlock(),i.createElementBlock("span",hv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",uv,[i.createElementVNode("span",fv,i.toDisplayString(n.value),1),(g=(f=s.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",pv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",gv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",mv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),yv={class:"flex flex-col gap-2.5"},bv={class:"text-base"},wv=["href"],vv={class:"text-sc-grey"},kv={},Sh=i.defineComponent({...kv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ye.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ye.Status)?(c=(l=W.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ye.CreatedAt)),o=i.computed(()=>t.fields.includes(Ye.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ye.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",yv,[i.createElementVNode("span",bv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,wv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(co,{date:l.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ")),i.createElementVNode("span",vv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Sr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ws,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),xv={},Bh=i.defineComponent({...xv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=W.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Cv={class:"flex flex-row gap-1.5"},Sv={class:"flex-none text-nowrap"},Bv={class:"flex flex-1 flex-col"},Tv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Ev={key:0},$v={key:1},Nv={},Th=i.defineComponent({...Nv,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Cv,[i.createElementVNode("span",Sv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Bv,[i.createVNode(Xi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Tv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Ev,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",$v,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Rv={},Pv=i.defineComponent({...Rv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Xi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(_t.getDeviceTypeByResolution()){case W.WindowResolutionEnum.phone:case W.WindowResolutionEnum.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Th,{product:o,index:a})}];case W.WindowResolutionEnum.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=O.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Eh=Ln(Pv,[["__scopeId","data-v-b1bc6269"]]),Fv={class:"text-base"},Mv={},qo=i.defineComponent({...Mv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Fv,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),Av={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Ov={class:"col-span-2"},Iv={class:"col-span-2"},Vv={class:"btn btn-primary",href:"{{ invoice }}"},zv={},$h=i.defineComponent({...zv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Av,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(qo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Sr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(ka,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Ov,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Bh,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(ws,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Iv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(qo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Vv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Lv={key:0},Dv={class:"text-sc-dark-grey my-2 text-center"},Hv={key:1,class:"text-sc-dark-grey my-2 text-center"},Wv={key:2},jv={class:"text-sc-dark-grey mt-4 text-right font-bold"},Xv={class:"text-sc-primary"},qv={},Nh=i.defineComponent({...qv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new W.Order(t.order)),s=()=>{n.value=!0,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=O.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Lv,[i.createElementVNode("div",Dv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",Hv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Wv,[i.createVNode(Eh,{order:r.value},null,8,["order"]),i.createElementVNode("div",jv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",Xv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode($h,{order:r.value},null,8,["order"])]))}}}),Yv={},Uv=i.defineComponent({...Yv,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>W.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ye.CreatedAt,Ye.Id,Ye.DeliveryInfo,Ye.Status,Ye.SalesDirections,Ye.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:H.constant(!0),renderExpand:S=>i.h(Nh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ye.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(co,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ye.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ye.ClientInfo,resizable:!0,render:S=>i.h(Sr,{client:S.client})},{title:"Тип доставки",key:Ye.DeliveryInfo,resizable:!0,render:S=>i.h(ws,{delivery:S.delivery})},{title:"Статус",key:Ye.Status,resizable:!0,minWidth:90,render:S=>{var x,C;return i.h("span",{class:"text-base"},[((C=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ye.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ye.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(_t.getDeviceTypeByResolution()){case W.WindowResolutionEnum.phone:case W.WindowResolutionEnum.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Sh,{order:S,fields:m,orderUrl:t.orderUrl})}];case W.WindowResolutionEnum.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new W.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},u=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},f=m=>{H.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=O.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":p,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),Gv=Ln(Uv,[["__scopeId","data-v-d66ad43e"]]),Kv=["href"],Zv={class:"text-sc-dark-grey"},Jv={},Qv=i.defineComponent({...Jv,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Sn.format(n.order.createdAt,W.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{H.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,Kv),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",Zv,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),e2={class:"sc-page flex flex-col"},t2={class:"my-2 flex flex-row items-end"},n2={class:"sc-title grow"},i2={key:0,class:"sc-title-buttons flex-1 grow-0"},r2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},s2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},o2={},Rh=i.defineComponent({...o2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=O.NH1;return i.openBlock(),i.createElementBlock("div",e2,[i.createElementVNode("div",t2,[i.createElementVNode("div",n2,[i.renderSlot(t.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",i2,[i.createElementVNode("div",r2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",s2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),a2={class:"overflow-hidden transition-all duration-300"},l2={class:"text-lg font-medium leading-none"},c2={},Ph=i.defineComponent({...c2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(_t.getDeviceTypeByResolution()){case W.WindowResolutionEnum.phone:return window.innerWidth*.66;case W.WindowResolutionEnum.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?H.isUndefined(n.drawerWidth)?s.value=a():s.value=H.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=O.NDrawerContent,u=O.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",a2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=p=>o.value=p),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",l2,i.toDisplayString(c.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),d2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},h2={key:0},u2={class:"sc-page-preview-panel grow"},f2={key:1,class:"sc-page-preview-panel-extra flex-none"},p2={},g2=i.defineComponent({...p2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=O.NButton;return i.openBlock(),i.createBlock(Rh,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",d2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",h2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",u2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",f2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Ph,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),m2={},_2=i.defineComponent({...m2,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>H.isArray(r.value)),a=new W.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=H.isUndefined(r.value)?f:r.value;return H.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>Ot.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=f=>{var g;if(H.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f===a.id||(g=c.value.find(_=>_.value===f))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":f.consistentMenuWidth,disabled:f.disabled||c.value.length===0,filterable:f.filterable,"max-tag-count":f.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),y2={},b2=i.defineComponent({...y2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>H.isArray(r.value)),a=i.computed(()=>{var f;return H.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var m;let f=r.showEmptyValue?[W.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(_=>_.id);if(r.showActualOnly){const _=H.isArray(r.value)?r.value.map(y=>y.id):[(m=r.value)==null?void 0:m.id];g=H.union(g,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),f=r.managerReferenceList.filter(y=>y.isActive||_.includes(y.id))}return Ot.convertReferencesToSelectOptionsList(f,!0,!0,_=>_.salesDirection.isNewRec()?_.name:`${_.name} (${_.salesDirection.name}) ${r.showActualOnly&&!_.isActive?"[Не активен, только снять выбор]":""}`,_=>g.includes(_.id)&&_.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{var g;if(H.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=l.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f>0?(g=l.value.find(_=>_.value===f))==null?void 0:g.item:new W.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value){const g=o.value?r.value:[r.value];H.some(g,m=>H.some(f,["id",m.id]))&&s("update:value",g.filter(m=>!H.some(f,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,"consistent-menu-width":f.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),w2={class:"m-0.5 flex flex-col p-0.5"},v2={class:"flex flex-row gap-1"},k2={key:0},x2={key:1},C2={key:2},S2={key:3},B2={class:"flex flex-row gap-1"},T2={key:0},E2={key:1},$2={key:2},N2={key:3},R2={},Fh=i.defineComponent({...R2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",w2,[i.createElementVNode("span",v2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",x2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",S2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",B2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",N2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Yo={clearable:!1,value:"",field:void 0,disabled:!1},P2={},F2=i.defineComponent({...P2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{}},{...Yo,minTermLength:()=>W.AppConfigProvider.getConfig().minSearchTermLength,searchDataHandler:()=>e=>W.HttpRequester.getInstance(W.DataSuggestionProvider).searchAddresses(e)}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=H.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Fh,{addr:y,selected:_},{default:H.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,_)=>{const y=O.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),M2={class:"m-0.5 flex flex-col p-0.5"},A2={class:"font-medium"},O2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},I2={key:0},V2={key:1},z2={},Mh=i.defineComponent({...z2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",M2,[i.createElementVNode("span",A2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",O2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",I2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",V2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),L2={},D2=i.defineComponent({...L2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Yo,minTermLength:()=>W.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=H.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{bank:y,selected:_},{default:H.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,_)=>{const y=O.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),H2={class:"font-medium"},W2={key:0,class:"flex flex-row gap-2"},j2={key:0,class:"text-xs font-light text-blue-800"},X2={key:1,class:"text-sc-dark-grey text-xs font-light"},q2={},Ah=i.defineComponent({...q2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",H2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",W2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",X2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),Y2={},U2=i.defineComponent({...Y2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Yo,minTermLength:()=>W.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>Ot.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=H.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},p=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Ah,{org:b,selected:y},{default:H.constant("-")})},f=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=O.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),G2={},K2=i.defineComponent({...G2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=O.NButton,h=O.NPopover,u=O.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>c[2]||(c[2]=[i.createTextVNode(" Да ")])),_:1,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),Z2={key:0,class:"whitespace-pre-line"},J2={key:1,class:"text-sc-dark-grey"},Q2={},ek=i.defineComponent({...Q2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=O.NInput;return i.openBlock(),i.createBlock(Mc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",Z2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",J2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),tk={key:0,class:"text-sm"},nk={key:1},ik={},rk=i.defineComponent({...ik,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",tk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",nk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),sk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ok(e,t){return i.openBlock(),i.createElementBlock("svg",sk,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)]))}const ak=i.markRaw({name:"ion-warning",render:ok}),lk={},ck=i.defineComponent({...lk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=ak,s=O.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),dk=i.computed(()=>W.useReferencesStore().deliveryTypeReference??[]),hk=i.computed(()=>W.useReferencesStore().managersList??[]),uk=i.computed(()=>W.useReferencesStore().opfReference??[]),fk=i.computed(()=>W.useReferencesStore().partnerGroupsReference??[]),pk=i.computed(()=>W.useReferencesStore().priceCoefficientsReference??[]),gk=i.computed(()=>W.useReferencesStore().productFilesTypesReference??[]),mk=i.computed(()=>W.useReferencesStore().resourceTypesReference),_k=i.computed(()=>W.useReferencesStore().salesDirectionsReference??[]),yk=i.computed(()=>W.useReferencesStore().warehousesReference??[]),bk=i.computed(()=>Ot.convertReferencesToSelectOptionsList(W.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),wk=i.computed(()=>Ot.convertReferencesToSelectOptionsList(W.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),vk=e=>W.HttpRequester.getInstance(W.ReferenceDataProvider).searchCity(e),kk=e=>Ot.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());D.ConfiguratorSettingsKozyrek=Ym,D.ContentHelper=zn,D.KozyrekLine=ti,D.KozyrekTailTemplate=ao,D.KozyrekTemplate=Pi,D.OrdersTableFields=Ye,D.Point=oo,D.ScAddProductToCartForm=Nf,D.ScAddressSuggestion=F2,D.ScAddressSuggestionLabel=Fh,D.ScBankSuggestion=D2,D.ScBankSuggestionLabel=Mh,D.ScBaseDialog=Z0,D.ScButtonWithConfirmAction=K2,D.ScCategoryCollapse=va,D.ScClientNameWithShortInfo=Sr,D.ScCollapse=wa,D.ScCollapseItem=ga,D.ScCommentEditor=ek,D.ScConfiguratorsProductInfo=qi,D.ScContragentWithShortInfo=ka,D.ScDateRange=z0,D.ScDateTimeLabel=co,D.ScDebouncedInput=m_,D.ScDebouncedInputNumber=Fi,D.ScDebt=rk,D.ScDialogHeader=Y0,D.ScEmail=qf,D.ScExternalLink=B_,D.ScImageGallery=ba,D.ScInlineEditableItem=Mc,D.ScInlineView=ho,D.ScKozyrekConfigurator=qm,D.ScKozyrekConfiguratorParamsForm=Na,D.ScKozyrekConfiguratorPreview=Tc,D.ScKozyrekConfiguratorTemplates=Ta,D.ScLightGallery=ya,D.ScManagerSelect=b2,D.ScMetalForDoorsConfigurator=Qm,D.ScMetalForDoorsConfiguratorForm=Ec,D.ScMosquitoConfigurator=x0,D.ScMosquitoConfiguratorForm=$c,D.ScMosquitoConfiguratorMeasurementInstructions=Nc,D.ScMosquitoConfiguratorPreview=lo,D.ScOrderCommonInfo=Sh,D.ScOrderDeliveryLabel=ws,D.ScOrderDetails=$h,D.ScOrderInfo=Nh,D.ScOrderItemsList=Eh,D.ScOrderPayment=Bh,D.ScOrderProductInfo=Th,D.ScOrdersList=Gv,D.ScOrgSuggestion=U2,D.ScOrgSuggestionLabel=Ah,D.ScPage=Rh,D.ScPageWithSlidingPanel=g2,D.ScPersonContactsBlock=Op,D.ScPhone=mp,D.ScPhoneInput=b_,D.ScProductName=Xi,D.ScProductsList=ev,D.ScReferenceSelect=_2,D.ScSearchableProductSelect=Ch,D.ScSearchableReferenceSelect=xh,D.ScShortTextOrderInfo=Qv,D.ScSingleFileUploadSelector=n_,D.ScSlidingContentWithDrawer=Ph,D.ScStripConfigurator=M0,D.ScStripConfiguratorForm=Pc,D.ScStripConfiguratorLineItem=Rc,D.ScStripConfiguratorPreview=Fc,D.ScUserShortInfo=qo,D.ScWarningIcon=ck,D.SelectOptionHelper=Ot,D.UiProvider=_t,D.channelPrimaryInterestOptionsList=bk,D.componentSizeInjectionKey=vr,D.deliveryTypeReferenceList=dk,D.managersReferenceList=hk,D.naiveUiTheme=vu,D.opfReferenceList=uk,D.partnerGroupReferenceList=fk,D.priceCoefficientsReferenceList=pk,D.productFilesTypesReferenceList=gk,D.renderConfig=Ve,D.resourceReferencesList=mk,D.salesDirectionsReferenceList=_k,D.searchCityReferenceDataHandler=vk,D.searchCityReferenceLabelRenderer=kk,D.sourcePrimaryInterestOptionsList=wk,D.warehousesReferenceList=yk,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
823
+ `,[bh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function bs(e){return e.type==="group"}function xh(e){return e.type==="ignored"}function Xo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function jw(e,t){return{getIsGroup:bs,getIgnored:xh,getKey(r){return bs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Xw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(xh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function qw(e,t,n){const r=new Map;return e.forEach(s=>{bs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Yw={};const Uw=Object.assign(Object.assign({},pt.props),{to:gn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Gw=i.defineComponent({name:"Select",props:Uw,slots:Object,setup(e){Yw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&An("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&An("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=hi(e),o=pt("Select","-select",Ww,Hw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=wo(l,a),d=i.ref(!1),h=i.ref(""),u=Gc(e,["items","options"]),p=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(p.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:L,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[L];if(typeof me=="string")return Xo(le,me);const be=ce[Q];return typeof be=="string"?Xo(le,be):typeof be=="number"?Xo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:L}=h;return!L.length||!e.filterable?T:Xw(T,m.value,L,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:L}=e,Q=jw(T,L);return vy(_.value,Q)}),b=i.computed(()=>qw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=wo(i.toRef(e,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:$}=ih("Select"),P=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:$.value.placeholder}),R=[],j=i.ref(new Map),Y=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:L,valueField:Q}=e;return le=>({[L]:String(le),[Q]:le})}return T===!1?!1:L=>Object.assign(T(L),{value:L})});function A(T){const L=e.remote,{value:Q}=j,{value:le}=b,{value:ce}=Y,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(L&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const E=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?A(T):[]}return null}),M=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:A([T])[0]||null:null}),K=e1(e),{mergedSizeRef:F,mergedDisabledRef:N,mergedStatusRef:X}=K;function z(T,L){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=K;Q&&ft(Q,T,L),ce&&ft(ce,T,L),le&&ft(le,T,L),a.value=T,me(),be()}function U(T){const{onBlur:L}=e,{nTriggerFormBlur:Q}=K;L&&ft(L,T),Q()}function O(){const{onClear:T}=e;T&&ft(T)}function I(T){const{onFocus:L,showOnFocus:Q}=e,{nTriggerFormFocus:le}=K;L&&ft(L,T),le(),Q&&re()}function J(T){const{onSearch:L}=e;L&&ft(L,T)}function pe(T){const{onScroll:L}=e;L&&ft(L,T)}function ie(){var T;const{remote:L,multiple:Q}=e;if(L){const{value:le}=j;if(Q){const{valueField:ce}=e;(T=E.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=M.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:L,"onUpdate:show":Q}=e;L&&ft(L,T),Q&&ft(Q,T),S.value=T}function re(){N.value||(ge(!0),S.value=!0,e.filterable&&In())}function Me(){ge(!1)}function Fe(){h.value="",f.value=R}const Ge=i.ref(!1);function xe(){e.filterable&&(Ge.value=!0)}function Se(){e.filterable&&(Ge.value=!1,x.value||Fe())}function st(){N.value||(x.value?e.filterable?In():Me():re())}function Ke(T){var L,Q;!((Q=(L=k.value)===null||L===void 0?void 0:L.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function nt(T){I(T),d.value=!0}function Yt(){d.value=!0}function $t(T){var L;!((L=v.value)===null||L===void 0)&&L.$el.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function mi(){var T;(T=v.value)===null||T===void 0||T.focus(),Me()}function _i(T){var L;x.value&&(!((L=v.value)===null||L===void 0)&&L.$el.contains(or(T))||Me())}function On(T){if(!Array.isArray(T))return[];if(Y.value)return Array.from(T);{const{remote:L}=e,{value:Q}=b;if(L){const{value:le}=j;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function ln(T){lt(T.rawNode)}function lt(T){if(N.value)return;const{tag:L,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(L&&!Q){const{value:me}=f,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],f.value=R}}if(Q&&j.value.set(T[ce],T),e.multiple){const me=On(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),L&&!Q){const ke=te(T[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");z(me,A(me))}else{if(L&&!Q){const me=te(T[ce]);~me?p.value=[p.value[me]]:p.value=R}Di(),Me(),z(T[ce],T)}}function te(T){return p.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){x.value||re();const{value:L}=T.target;h.value=L;const{tag:Q,remote:le}=e;if(J(L),Q&&!le){if(!L){f.value=R;return}const{onCreate:ce}=e,me=ce?ce(L):{[e.labelField]:L,[e.valueField]:L},{valueField:be,labelField:ke}=e;u.value.some(je=>je[be]===me[be]||je[ke]===me[ke])||p.value.some(je=>je[be]===me[be]||je[ke]===me[ke])?f.value=R:f.value=[me]}}function We(T){T.stopPropagation();const{multiple:L}=e;!L&&e.filterable&&Me(),O(),L?z([],[]):z(null,null)}function wr(T){!sr(T,"action")&&!sr(T,"empty")&&!sr(T,"header")&&T.preventDefault()}function Li(T){pe(T)}function yi(T){var L,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((L=v.value)===null||L===void 0)&&L.isComposing)){if(x.value){const be=(Q=k.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?ln(be):e.filterable||(Me(),Di())}else if(re(),e.tag&&Ge.value){const be=f.value[0];if(be){const ke=be[e.valueField],{value:je}=c;e.multiple&&Array.isArray(je)&&je.includes(ke)||lt(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=k.value)===null||ce===void 0||ce.next():re();break;case"Escape":x.value&&(Kb(T),Me()),(me=v.value)===null||me===void 0||me.focus();break}}function Di(){var T;(T=v.value)===null||T===void 0||T.focus()}function In(){var T;(T=v.value)===null||T===void 0||T.focusInput()}function bi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}ie(),i.watch(i.toRef(e,"options"),ie);const Hi={focus:()=>{var T;(T=v.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=v.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=v.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=v.value)===null||T===void 0||T.blurInput()}},Ut=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Cn=s?ui("select",void 0,Ut,e):void 0;return Object.assign(Object.assign({},Hi),{mergedStatus:X,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:ss(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:gn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:P,selectedOption:M,selectedOptions:E,mergedSize:F,mergedDisabled:N,focused:d,activeWithoutMenuOpen:Ge,inlineThemeDisabled:s,onTriggerInputFocus:xe,onTriggerInputBlur:Se,handleTriggerOrMenuResize:bi,handleMenuFocus:Yt,handleMenuBlur:$t,handleMenuTabOut:mi,handleTriggerClick:st,handleToggle:ln,handleDeleteOption:lt,handlePatternInput:ne,handleClear:We,handleTriggerBlur:Ke,handleTriggerFocus:nt,handleKeydown:yi,handleMenuAfterLeave:Fe,handleMenuClickOutside:_i,handleMenuScroll:Li,handleMenuKeydown:yi,handleMenuMousedown:wr,mergedTheme:o,cssVars:s?void 0:Ut,themeClass:Cn==null?void 0:Cn.themeClass,onRender:Cn==null?void 0:Cn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Qc,null,{default:()=>[i.h(ed,null,{default:()=>i.h(Lw,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(gd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===gn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(gw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[rs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[rs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Kw={},Ch=i.defineComponent({...Kw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>H.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(W.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!x.some(k=>k.id===B.id));l.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let p="";const f=W.debounce(()=>u(p),800),g=b=>{p=b,f()},m=b=>{var S;if(W.isArray(b)){const x=b.length>0?b.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(v=>v.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(Gw),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Zw={},Sh=i.defineComponent({...Zw,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>H.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?H.HttpRequester.getInstance(H.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?H.HttpRequester.getInstance(H.ProductDataProvider).publicSimpleSearch(u):new Promise(p=>{p([])}),l=u=>r.searchType==="categories"?Vt.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?Vt.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(u,p)=>{if(r.renderLabel)return r.renderLabel(u,p);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,p)=>(i.openBlock(),i.createBlock(Ch,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":p[0]||(p[0]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Jw={class:"col-span-2 flex flex-row gap-2.5"},Qw={class:"flex-1"},ev={class:"text-sc-grey"},tv={class:"ml-2.5"},nv={key:0,class:"flex-none"},iv={},rv=i.defineComponent({...iv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>H.AppConfigProvider.getConfig().minSearchTermLength},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(W.isArray(u)?u:[u]).filter(p=>!a.value.some(f=>f.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(p=>p.id===u.id?u:i.toRaw(p)),l())},h=u=>{a.value=a.value.filter(p=>p.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,p)=>{const f=V.NListItem,g=F_,m=V.NButton,_=V.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Sh,{value:s.value,"onUpdate:value":[p[0]||(p[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(f,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ")])),_:1,__:[1]})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(f,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Jw,[i.createElementVNode("span",Qw,[i.createElementVNode("span",ev,i.toDisplayString(y.code),1),i.createElementVNode("span",tv,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",nv,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),sv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ov(e,t){return i.openBlock(),i.createElementBlock("svg",sv,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)]))}const av=i.markRaw({name:"tabler-truck-filled",render:ov}),lv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cv(e,t){return i.openBlock(),i.createElementBlock("svg",lv,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)]))}const dv=i.markRaw({name:"tabler-truck-delivery",render:cv}),hv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uv(e,t){return i.openBlock(),i.createElementBlock("svg",hv,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)]))}const fv=i.markRaw({name:"tabler-truck-loading",render:uv}),pv={class:"flex flex-col gap-1"},gv={key:0,class:"flex flex-row gap-1 text-base"},mv={key:1,class:"text-sc-dark-grey text-sm"},_v={class:"text-sc-grey mr-1.5"},yv={key:0},bv={key:1},wv={key:2},vv={},ws=i.defineComponent({...vv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=H.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Sn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,p,f,g,m,_;const a=fv,l=dv,c=av;return i.openBlock(),i.createElementBlock("div",pv,[s.showType?(i.openBlock(),i.createElementBlock("span",gv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",mv,[i.createElementVNode("span",_v,i.toDisplayString(n.value),1),(g=(f=s.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",yv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",bv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",wv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),kv={class:"flex flex-col gap-2.5"},xv={class:"text-base"},Cv=["href"],Sv={class:"text-sc-grey"},Bv={},Bh=i.defineComponent({...Bv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ye.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ye.Status)?(c=(l=H.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ye.CreatedAt)),o=i.computed(()=>t.fields.includes(Ye.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ye.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",kv,[i.createElementVNode("span",xv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Cv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(co,{date:l.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ")),i.createElementVNode("span",Sv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Sr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ws,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Tv={},Th=i.defineComponent({...Tv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=H.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Ev={class:"flex flex-row gap-1.5"},$v={class:"flex-none text-nowrap"},Nv={class:"flex flex-1 flex-col"},Rv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Pv={key:0},Fv={key:1},Mv={},Eh=i.defineComponent({...Mv,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Ev,[i.createElementVNode("span",$v,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Nv,[i.createVNode(Xi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Rv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Pv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Fv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Av={},Vv=i.defineComponent({...Av,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Xi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(_t.getDeviceTypeByResolution()){case H.WindowResolutionEnum.phone:case H.WindowResolutionEnum.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Eh,{product:o,index:a})}];case H.WindowResolutionEnum.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=V.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),$h=Ln(Vv,[["__scopeId","data-v-b1bc6269"]]),Ov={class:"text-base"},Iv={},qo=i.defineComponent({...Iv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Ov,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),zv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Lv={class:"col-span-2"},Dv={class:"col-span-2"},Hv={class:"btn btn-primary",href:"{{ invoice }}"},Wv={},Nh=i.defineComponent({...Wv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",zv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(qo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Sr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(xa,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Lv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Th,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(ws,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Dv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(qo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Hv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),jv={key:0},Xv={class:"text-sc-dark-grey my-2 text-center"},qv={key:1,class:"text-sc-dark-grey my-2 text-center"},Yv={key:2},Uv={class:"text-sc-dark-grey mt-4 text-right font-bold"},Gv={class:"text-sc-primary"},Kv={},Rh=i.defineComponent({...Kv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new H.Order(t.order)),s=()=>{n.value=!0,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",jv,[i.createElementVNode("div",Xv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",qv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Yv,[i.createVNode($h,{order:r.value},null,8,["order"]),i.createElementVNode("div",Uv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",Gv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Nh,{order:r.value},null,8,["order"])]))}}}),Zv={},Jv=i.defineComponent({...Zv,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>H.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ye.CreatedAt,Ye.Id,Ye.DeliveryInfo,Ye.Status,Ye.SalesDirections,Ye.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:W.constant(!0),renderExpand:S=>i.h(Rh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ye.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(co,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ye.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ye.ClientInfo,resizable:!0,render:S=>i.h(Sr,{client:S.client})},{title:"Тип доставки",key:Ye.DeliveryInfo,resizable:!0,render:S=>i.h(ws,{delivery:S.delivery})},{title:"Статус",key:Ye.Status,resizable:!0,minWidth:90,render:S=>{var x,v;return i.h("span",{class:"text-base"},[((v=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ye.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ye.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(_t.getDeviceTypeByResolution()){case H.WindowResolutionEnum.phone:case H.WindowResolutionEnum.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Bh,{order:S,fields:m,orderUrl:t.orderUrl})}];case H.WindowResolutionEnum.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new H.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},u=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},f=m=>{W.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=V.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":p,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),Qv=Ln(Jv,[["__scopeId","data-v-d66ad43e"]]),e2=["href"],t2={class:"text-sc-dark-grey"},n2={},i2=i.defineComponent({...n2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Sn.format(n.order.createdAt,H.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{W.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,e2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",t2,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),r2={class:"sc-page flex flex-col"},s2={class:"my-2 flex flex-row items-end"},o2={class:"sc-title grow"},a2={key:0,class:"sc-title-buttons flex-1 grow-0"},l2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},c2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},d2={},Ph=i.defineComponent({...d2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",r2,[i.createElementVNode("div",s2,[i.createElementVNode("div",o2,[i.renderSlot(t.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",a2,[i.createElementVNode("div",l2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",c2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),h2={class:"overflow-hidden transition-all duration-300"},u2={class:"text-lg font-medium leading-none"},f2={},Fh=i.defineComponent({...f2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(_t.getDeviceTypeByResolution()){case H.WindowResolutionEnum.phone:return window.innerWidth*.66;case H.WindowResolutionEnum.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?W.isUndefined(n.drawerWidth)?s.value=a():s.value=W.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",h2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=p=>o.value=p),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",u2,i.toDisplayString(c.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),p2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},g2={key:0},m2={class:"sc-page-preview-panel grow"},_2={key:1,class:"sc-page-preview-panel-extra flex-none"},y2={},b2=i.defineComponent({...y2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=V.NButton;return i.openBlock(),i.createBlock(Ph,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",p2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",g2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",m2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",_2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Fh,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),w2={},v2=i.defineComponent({...w2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>{var f;return W.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var m;let f=r.showEmptyValue?[H.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(_=>_.id);if(r.showActualOnly){const _=W.isArray(r.value)?r.value.map(y=>y.id):[(m=r.value)==null?void 0:m.id];g=W.union(g,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),f=r.managerReferenceList.filter(y=>y.isActive||_.includes(y.id))}return Vt.convertReferencesToSelectOptionsList(f,!0,!0,_=>_.salesDirection.isNewRec()?_.name:`${_.name} (${_.salesDirection.name}) ${r.showActualOnly&&!_.isActive?"[Не активен, только снять выбор]":""}`,_=>g.includes(_.id)&&_.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{var g;if(W.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=l.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f>0?(g=l.value.find(_=>_.value===f))==null?void 0:g.item:new H.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value){const g=o.value?r.value:[r.value];W.some(g,m=>W.some(f,["id",m.id]))&&s("update:value",g.filter(m=>!W.some(f,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,"consistent-menu-width":f.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),k2={class:"m-0.5 flex flex-col p-0.5"},x2={class:"flex flex-row gap-1"},C2={key:0},S2={key:1},B2={key:2},T2={key:3},E2={class:"flex flex-row gap-1"},$2={key:0},N2={key:1},R2={key:2},P2={key:3},F2={},Mh=i.defineComponent({...F2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",k2,[i.createElementVNode("span",x2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",S2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",E2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",N2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",R2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",P2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Yo={clearable:!1,value:"",field:void 0,disabled:!1},M2={},A2=i.defineComponent({...M2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Yo,minTermLength:()=>H.AppConfigProvider.getConfig().minSearchTermLength,searchDataHandler:()=>e=>H.HttpRequester.getInstance(H.DataSuggestionProvider).searchAddresses(e)}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{addr:y,selected:_},{default:W.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),V2={class:"m-0.5 flex flex-col p-0.5"},O2={class:"font-medium"},I2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},z2={key:0},L2={key:1},D2={},Ah=i.defineComponent({...D2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",V2,[i.createElementVNode("span",O2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",I2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",z2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",L2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),H2={},W2=i.defineComponent({...H2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Yo,minTermLength:()=>H.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Ah,{bank:y,selected:_},{default:W.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),j2={class:"font-medium"},X2={key:0,class:"flex flex-row gap-2"},q2={key:0,class:"text-xs font-light text-blue-800"},Y2={key:1,class:"text-sc-dark-grey text-xs font-light"},U2={},Vh=i.defineComponent({...U2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",j2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",X2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",q2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",Y2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),G2={},K2=i.defineComponent({...G2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Yo,minTermLength:()=>H.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=W.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},p=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Vh,{org:b,selected:y},{default:W.constant("-")})},f=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=V.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),Z2={},J2=i.defineComponent({...Z2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=V.NButton,h=V.NPopover,u=V.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>c[2]||(c[2]=[i.createTextVNode(" Да ")])),_:1,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),Q2={key:0,class:"whitespace-pre-line"},ek={key:1,class:"text-sc-dark-grey"},tk={},nk=i.defineComponent({...tk,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=V.NInput;return i.openBlock(),i.createBlock(Ac,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",Q2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",ek," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),ik={key:0,class:"text-sm"},rk={key:1},sk={},ok=i.defineComponent({...sk,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",ik,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",rk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),ak={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lk(e,t){return i.openBlock(),i.createElementBlock("svg",ak,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)]))}const ck=i.markRaw({name:"ion-warning",render:lk}),dk={},hk=i.defineComponent({...dk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=ck,s=V.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),uk=i.computed(()=>H.useReferencesStore().deliveryTypeReference??[]),fk=i.computed(()=>H.useReferencesStore().managersList??[]),pk=i.computed(()=>H.useReferencesStore().opfReference??[]),gk=i.computed(()=>H.useReferencesStore().partnerGroupsReference??[]),mk=i.computed(()=>H.useReferencesStore().priceCoefficientsReference??[]),_k=i.computed(()=>H.useReferencesStore().productFilesTypesReference??[]),yk=i.computed(()=>H.useReferencesStore().resourceTypesReference),bk=i.computed(()=>H.useReferencesStore().salesDirectionsReference??[]),wk=i.computed(()=>H.useReferencesStore().warehousesReference??[]),vk=i.computed(()=>Vt.convertReferencesToSelectOptionsList(H.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),kk=i.computed(()=>Vt.convertReferencesToSelectOptionsList(H.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),xk=e=>H.HttpRequester.getInstance(H.ReferenceDataProvider).searchCity(e),Ck=e=>Vt.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());D.ConfiguratorSettingsKozyrek=Zm,D.ContentHelper=zn,D.KozyrekLine=ti,D.KozyrekTailTemplate=ao,D.KozyrekTemplate=Pi,D.OrdersTableFields=Ye,D.Point=oo,D.ScAddProductToCartForm=Rf,D.ScAddressSuggestion=A2,D.ScAddressSuggestionLabel=Mh,D.ScBankSuggestion=W2,D.ScBankSuggestionLabel=Ah,D.ScBaseDialog=t_,D.ScButtonWithConfirmAction=J2,D.ScCategoryCollapse=va,D.ScClientNameWithShortInfo=Sr,D.ScCollapse=wa,D.ScCollapseItem=ga,D.ScCommentEditor=nk,D.ScConfiguratorsProductInfo=qi,D.ScContragentWithShortInfo=xa,D.ScDateRange=W0,D.ScDateTimeLabel=co,D.ScDebouncedInput=w_,D.ScDebouncedInputNumber=Fi,D.ScDebt=ok,D.ScDialogHeader=Z0,D.ScEmail=Kf,D.ScExternalLink=N_,D.ScImageGallery=ba,D.ScInlineEditableItem=Ac,D.ScInlineView=ho,D.ScKozyrekConfigurator=Km,D.ScKozyrekConfiguratorParamsForm=Ra,D.ScKozyrekConfiguratorPreview=Ec,D.ScKozyrekConfiguratorTemplates=Ea,D.ScLightGallery=ya,D.ScManagerSelect=v2,D.ScMetalForDoorsConfigurator=i0,D.ScMetalForDoorsConfiguratorForm=$c,D.ScMosquitoConfigurator=T0,D.ScMosquitoConfiguratorForm=Nc,D.ScMosquitoConfiguratorMeasurementInstructions=Rc,D.ScMosquitoConfiguratorPreview=lo,D.ScOrderCommonInfo=Bh,D.ScOrderDeliveryLabel=ws,D.ScOrderDetails=Nh,D.ScOrderInfo=Rh,D.ScOrderItemsList=$h,D.ScOrderPayment=Th,D.ScOrderProductInfo=Eh,D.ScOrdersList=Qv,D.ScOrgSuggestion=K2,D.ScOrgSuggestionLabel=Vh,D.ScPage=Ph,D.ScPageWithSlidingPanel=b2,D.ScPersonContactsBlock=Lp,D.ScPhone=wp,D.ScPhoneInput=x_,D.ScProductName=Xi,D.ScProductsList=rv,D.ScReferenceSelect=ka,D.ScSearchableProductSelect=Sh,D.ScSearchableReferenceSelect=Ch,D.ScSetClientPriceFormItem=Mf,D.ScShortTextOrderInfo=i2,D.ScSingleFileUploadSelector=o_,D.ScSlidingContentWithDrawer=Fh,D.ScStripConfigurator=I0,D.ScStripConfiguratorForm=Fc,D.ScStripConfiguratorLineItem=Pc,D.ScStripConfiguratorPreview=Mc,D.ScUserShortInfo=qo,D.ScWarningIcon=hk,D.SelectOptionHelper=Vt,D.UiProvider=_t,D.channelPrimaryInterestOptionsList=vk,D.componentSizeInjectionKey=vr,D.deliveryTypeReferenceList=uk,D.managersReferenceList=fk,D.naiveUiTheme=ku,D.opfReferenceList=pk,D.partnerGroupReferenceList=gk,D.priceCoefficientsReferenceList=mk,D.productFilesTypesReferenceList=_k,D.renderConfig=Ie,D.resourceReferencesList=yk,D.salesDirectionsReferenceList=bk,D.searchCityReferenceDataHandler=xk,D.searchCityReferenceLabelRenderer=Ck,D.sourcePrimaryInterestOptionsList=kk,D.warehousesReferenceList=wk,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
824
824
  //# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map